Fix incorrect use of is for comparisons.

See https://bugs.python.org/issue34850 for details.
This commit is contained in:
Matt Clay 2019-02-12 15:15:23 -08:00
commit 0a461380a3
21 changed files with 42 additions and 42 deletions

View file

@ -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