mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-12 03:14:24 -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
|
@ -20,6 +20,8 @@ from __future__ import (absolute_import, division, print_function)
|
|||
__metaclass__ = type
|
||||
|
||||
from six.moves import queue as Queue
|
||||
from six import iteritems
|
||||
|
||||
import time
|
||||
|
||||
from ansible import constants as C
|
||||
|
@ -207,7 +209,7 @@ class StrategyBase:
|
|||
if task_result._task._role is not None and result[0] in ('host_task_ok', 'host_task_failed'):
|
||||
# lookup the role in the ROLE_CACHE to make sure we're dealing
|
||||
# with the correct object and mark it as executed
|
||||
for (entry, role_obj) in iterator._play.ROLE_CACHE[task_result._task._role._role_name].iteritems():
|
||||
for (entry, role_obj) in iteritems(iterator._play.ROLE_CACHE[task_result._task._role._role_name]):
|
||||
if role_obj._uuid == task_result._task._role._uuid:
|
||||
role_obj._had_task_run[host.name] = True
|
||||
|
||||
|
@ -358,7 +360,7 @@ class StrategyBase:
|
|||
groups[group_name] = []
|
||||
groups[group_name].append(host)
|
||||
|
||||
for group_name, hosts in groups.iteritems():
|
||||
for group_name, hosts in iteritems(groups):
|
||||
new_group = self._inventory.get_group(group_name)
|
||||
if not new_group:
|
||||
# create the new group and add it to inventory
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue