mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-26 04:11: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
|
@ -19,7 +19,7 @@
|
|||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
from six import string_types
|
||||
from six import iteritems, string_types
|
||||
|
||||
from ansible.errors import AnsibleError
|
||||
|
||||
|
@ -118,7 +118,7 @@ class Task(Base, Conditional, Taggable, Become):
|
|||
return ds
|
||||
elif isinstance(ds, dict):
|
||||
buf = ""
|
||||
for (k,v) in ds.iteritems():
|
||||
for (k,v) in iteritems(ds):
|
||||
if k.startswith('_'):
|
||||
continue
|
||||
buf = buf + "%s=%s " % (k,v)
|
||||
|
@ -180,7 +180,7 @@ class Task(Base, Conditional, Taggable, Become):
|
|||
else:
|
||||
new_ds['vars'] = dict()
|
||||
|
||||
for (k,v) in ds.iteritems():
|
||||
for (k,v) in iteritems(ds):
|
||||
if k in ('action', 'local_action', 'args', 'connection') or k == action or k == 'shell':
|
||||
# we don't want to re-assign these values, which were
|
||||
# determined by the ModuleArgsParser() above
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue