1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Preventing servers that are deleted and left in the deleted state from being included in the server list

This commit is contained in:
Brian Richards 2015-08-20 11:07:58 -05:00 committed by Matt Clay
parent eb3f28effc
commit c054a058c0

View file

@ -97,7 +97,9 @@ def rax_facts(module, address, name, server_id):
servers.append(cs.servers.get(server_id))
except Exception, e:
pass
servers[:] = [server for server in servers if server.status != "DELETED"]
if len(servers) > 1:
module.fail_json(msg='Multiple servers found matching provided '
'search parameters')