From a8c7b0dc414783bba59911a87c30683a2abca302 Mon Sep 17 00:00:00 2001 From: Matthew Jones Date: Mon, 19 Jan 2015 12:04:58 -0500 Subject: [PATCH] Emit an error message if the host doesn't exist in azure --- awx/plugins/inventory/windows_azure.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/awx/plugins/inventory/windows_azure.py b/awx/plugins/inventory/windows_azure.py index 214aa1d910..8a53fadfa1 100755 --- a/awx/plugins/inventory/windows_azure.py +++ b/awx/plugins/inventory/windows_azure.py @@ -117,6 +117,8 @@ class AzureInventory(object): """Return information about the given hostname, based on what the Windows Azure API provides. """ + if hostname not in self.host_metadata: + return "No host found: %s" % hostname if jsonify: return json.dumps(self.host_metadata[hostname]) return self.host_metadata[hostname]