mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 11:21:25 -07:00
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.
This commit is contained in:
parent
9e1bc434c7
commit
823677b490
28 changed files with 81 additions and 41 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue