mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
less misleading message for when someone looks up vars for a host not in inventory
This commit is contained in:
parent
6154ed1dda
commit
b525eedb8e
1 changed files with 2 additions and 2 deletions
|
@ -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 = {}
|
||||
|
||||
|
|
Loading…
Reference in a new issue