From 823677b490d3ddc3bcfe8fa2f215d9d9c2167b14 Mon Sep 17 00:00:00 2001 From: Marius Gedminas Date: Thu, 3 Sep 2015 09:23:27 +0300 Subject: 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. --- examples/scripts/yaml_to_ini.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'examples/scripts') 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 -- cgit v1.2.1