mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-23 05:10:22 -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
|
@ -51,7 +51,7 @@ def hash_params(params):
|
|||
return params
|
||||
else:
|
||||
s = set()
|
||||
for k,v in params.iteritems():
|
||||
for k,v in iteritems(params):
|
||||
if isinstance(v, dict):
|
||||
s.update((k, hash_params(v)))
|
||||
elif isinstance(v, list):
|
||||
|
@ -105,7 +105,7 @@ class Role(Base, Become, Conditional, Taggable):
|
|||
params['tags'] = role_include.tags
|
||||
hashed_params = hash_params(params)
|
||||
if role_include.role in play.ROLE_CACHE:
|
||||
for (entry, role_obj) in play.ROLE_CACHE[role_include.role].iteritems():
|
||||
for (entry, role_obj) in iteritems(play.ROLE_CACHE[role_include.role]):
|
||||
if hashed_params == entry:
|
||||
if parent_role:
|
||||
role_obj.add_parent(parent_role)
|
||||
|
|
|
@ -181,7 +181,7 @@ class RoleDefinition(Base, Become, Conditional, Taggable):
|
|||
for (key, value) in iteritems(ds):
|
||||
# use the list of FieldAttribute values to determine what is and is not
|
||||
# an extra parameter for this role (or sub-class of this role)
|
||||
if key not in [attr_name for (attr_name, attr_value) in self._get_base_attributes().iteritems()]:
|
||||
if key not in [attr_name for (attr_name, attr_value) in iteritems(self._get_base_attributes())]:
|
||||
# this key does not match a field attribute, so it must be a role param
|
||||
role_params[key] = value
|
||||
else:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue