From e4a5f3b4099765a103ab949741312e520e8d35d6 Mon Sep 17 00:00:00 2001 From: Brian Richards Date: Thu, 20 Aug 2015 11:07:58 -0500 Subject: [PATCH] Preventing servers that are deleted and left in the deleted state from being included in the server list --- cloud/rackspace/rax_facts.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cloud/rackspace/rax_facts.py b/cloud/rackspace/rax_facts.py index c30df5b9462..481732c0af7 100644 --- a/cloud/rackspace/rax_facts.py +++ b/cloud/rackspace/rax_facts.py @@ -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')