From b525eedb8eccb721bd981169ff26f1d09bdfe694 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Fri, 28 Aug 2015 15:42:57 -0400 Subject: [PATCH] less misleading message for when someone looks up vars for a host not in inventory --- lib/ansible/inventory/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/inventory/__init__.py b/lib/ansible/inventory/__init__.py index fa2e8283f4..cbcd8186a2 100644 --- a/lib/ansible/inventory/__init__.py +++ b/lib/ansible/inventory/__init__.py @@ -507,7 +507,7 @@ class Inventory(object): host = self.get_host(hostname) if not host: - raise Exception("host not found: %s" % hostname) + raise AnsibleError("no vars as host is not in inventory: %s" % hostname) return host.get_vars() def get_host_variables(self, hostname, update_cached=False, vault_password=None): @@ -520,7 +520,7 @@ class Inventory(object): host = self.get_host(hostname) if host is None: - raise AnsibleError("host not found: %s" % hostname) + raise AnsibleError("no host vars as host is not in inventory: %s" % hostname) vars = {}