summaryrefslogtreecommitdiff
path: root/examples/scripts
diff options
context:
space:
mode:
authorMarius Gedminas <marius@gedmin.as>2015-09-03 09:23:27 +0300
committerMarius Gedminas <marius@gedmin.as>2015-09-03 09:23:27 +0300
commit823677b490d3ddc3bcfe8fa2f215d9d9c2167b14 (patch)
tree1e0915306f5dec06cb369b3aa5b30cac6b7699bb /examples/scripts
parent9e1bc434c768dab26468220de4bc57490f5666cd (diff)
downloadansible-823677b490d3ddc3bcfe8fa2f215d9d9c2167b14.tar.gz
Replace .iteritems() with six.iteritems()
Replace .iteritems() with six.iteritems() everywhere except in module_utils (because there's no 'six' on the remote host). And except in lib/ansible/galaxy/data/metadata_template.j2, because I'm not sure six is available there.
Diffstat (limited to 'examples/scripts')
-rwxr-xr-xexamples/scripts/yaml_to_ini.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/examples/scripts/yaml_to_ini.py b/examples/scripts/yaml_to_ini.py
index 09b9b5ec82..981176b2f2 100755
--- a/examples/scripts/yaml_to_ini.py
+++ b/examples/scripts/yaml_to_ini.py
@@ -23,6 +23,7 @@ from ansible import utils
import os
import yaml
import sys
+from six import iteritems
class InventoryParserYaml(object):
''' Host inventory parser for ansible '''
@@ -176,7 +177,7 @@ if __name__ == "__main__":
groupfh.write(yaml.dump(record.get_variables()))
groupfh.close()
- for (host_name, host_record) in yamlp._hosts.iteritems():
+ for (host_name, host_record) in iteritems(yamlp._hosts):
hostfiledir = os.path.join(dirname, "host_vars")
if not os.path.exists(hostfiledir):
print "* creating: %s" % hostfiledir