mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-25 06:10:22 -07:00
Fix incorrect use of is
for comparisons.
See https://bugs.python.org/issue34850 for details.
This commit is contained in:
parent
cd7a144515
commit
0a461380a3
21 changed files with 42 additions and 42 deletions
|
@ -660,7 +660,7 @@ def main():
|
|||
if len(instances) > count:
|
||||
for i in range(0, len(instances) - count):
|
||||
inst = instances[len(instances) - 1]
|
||||
if inst.status is not 'stopped' and not force:
|
||||
if inst.status != 'stopped' and not force:
|
||||
module.fail_json(msg="That to delete instance {0} is failed results from it is running, "
|
||||
"and please stop it or set 'force' as True.".format(inst.id))
|
||||
try:
|
||||
|
@ -765,7 +765,7 @@ def main():
|
|||
else:
|
||||
try:
|
||||
for inst in instances:
|
||||
if inst.status is not 'stopped' and not force:
|
||||
if inst.status != 'stopped' and not force:
|
||||
module.fail_json(msg="Instance is running, and please stop it or set 'force' as True.")
|
||||
if inst.terminate(force=module.params['force']):
|
||||
changed = True
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue