mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-05-03 07:41:30 -07:00
Cmp python3 compat (#25008)
* Use double-quotes for expect integration tests * Cast user input to string for expect integration tests * Remove usage of cmp() for python3 compatibility - Add code smell test to look for cmp usage - Fixes #24756
This commit is contained in:
parent
64f63a3cac
commit
5c43bd3bae
5 changed files with 20 additions and 4 deletions
|
@ -1755,7 +1755,8 @@ def present(manager, containers, count, name):
|
|||
if delta < 0:
|
||||
# If both running and stopped containers exist, remove
|
||||
# stopped containers first.
|
||||
containers.deployed.sort(lambda cx, cy: cmp(is_running(cx), is_running(cy)))
|
||||
# Use key param for python 2/3 compatibility.
|
||||
containers.deployed.sort(key=is_running)
|
||||
|
||||
to_stop = []
|
||||
to_remove = []
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue