Skip to content

Commit

Permalink
Fix hostvars lookup of locahost based on 5f1bbb4
Browse files Browse the repository at this point in the history
  • Loading branch information
jimi-c committed Jun 8, 2016
1 parent 5f1bbb4 commit b51d0dd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/ansible/vars/hostvars.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,11 @@ def set_inventory(self, inventory):
self._inventory = inventory

def _find_host(self, host_name):
return self._inventory.get_host(host_name)
if host_name in C.LOCALHOST:
host = self._inventory.localhost
else:
host = self._inventory.get_host(host_name)
return host

def __getitem__(self, host_name):
host = self._find_host(host_name)
Expand Down

0 comments on commit b51d0dd

Please sign in to comment.