summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToshio Kuratomi <toshio@fedoraproject.org>2016-01-06 15:46:42 -0800
committerToshio Kuratomi <toshio@fedoraproject.org>2016-01-07 06:01:44 -0800
commit80f0380312a91c694317f79af736458ba84ed919 (patch)
treee5fce521ecd3951b350bb262e151200e4377ea37
parenta8f160d2fd0158972eefc70c5eb01af15675a0d3 (diff)
downloadansible-80f0380312a91c694317f79af736458ba84ed919.tar.gz
Fix typo
-rw-r--r--lib/ansible/inventory/script.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/ansible/inventory/script.py b/lib/ansible/inventory/script.py
index cdfe676bcd..1fa49e5053 100644
--- a/lib/ansible/inventory/script.py
+++ b/lib/ansible/inventory/script.py
@@ -63,7 +63,6 @@ class InventoryScript:
self.host_vars_from_top = None
self._parse(stderr)
-
def _parse(self, err):
all_hosts = {}
@@ -73,7 +72,7 @@ class InventoryScript:
self.raw = self._loader.load(self.data)
except Exception as e:
sys.stderr.write(err + "\n")
- raise AnsibleError("failed to parse executable inventory script results from {0}: {1}".format(to_str(self.filename_, to_str(e)))
+ raise AnsibleError("failed to parse executable inventory script results from {0}: {1}".format(to_str(self.filename), to_str(e)))
if not isinstance(self.raw, Mapping):
sys.stderr.write(err + "\n")
@@ -113,7 +112,7 @@ class InventoryScript:
"data for the host list:\n %s" % (group_name, data))
for hostname in data['hosts']:
- if not hostname in all_hosts:
+ if hostname not in all_hosts:
all_hosts[hostname] = Host(hostname)
host = all_hosts[hostname]
group.add_host(host)
@@ -149,7 +148,6 @@ class InventoryScript:
got = self.host_vars_from_top.get(host.name, {})
return got
-
cmd = [self.filename, "--host", host.name]
try:
sp = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
@@ -162,4 +160,3 @@ class InventoryScript:
return json_dict_bytes_to_unicode(self._loader.load(out))
except ValueError:
raise AnsibleError("could not parse post variable response: %s, %s" % (cmd, out))
-