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:
Marius Gedminas 2015-09-03 09:23:27 +03:00
parent 9e1bc434c7
commit 823677b490
28 changed files with 81 additions and 41 deletions

View file

@ -22,9 +22,10 @@ __metaclass__ = type
import os
import subprocess
import sys
from collections import Mapping
from six import iteritems
from ansible import constants as C
from ansible.errors import *
from ansible.inventory.host import Host
@ -122,7 +123,7 @@ class InventoryScript:
raise AnsibleError("You defined a group \"%s\" with bad "
"data for variables:\n %s" % (group_name, data))
for k, v in data['vars'].iteritems():
for k, v in iteritems(data['vars']):
if group.name == all.name:
all.set_variable(k, v)
else: