From d26d76ea5844202d11fe2c04303ab8889b638a66 Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Wed, 6 Jan 2016 15:46:42 -0800 Subject: [PATCH] Fix typo --- lib/ansible/inventory/script.py | 7 ++----- 1 file 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)) -