mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 11:21:25 -07:00
Removed dict.iteritems() in modules. (#18859)
This is for py3 compatibility, addressed in #18506
This commit is contained in:
parent
4b27d08643
commit
ef391a11ec
99 changed files with 251 additions and 250 deletions
|
@ -902,11 +902,11 @@ class DockerManager(object):
|
|||
self.ensure_capability('env_file')
|
||||
parsed_env_file = docker.utils.parse_env_file(env_file)
|
||||
|
||||
for name, value in parsed_env_file.iteritems():
|
||||
for name, value in parsed_env_file.items():
|
||||
final_env[name] = str(value)
|
||||
|
||||
if env:
|
||||
for name, value in env.iteritems():
|
||||
for name, value in env.items():
|
||||
final_env[name] = str(value)
|
||||
|
||||
return final_env
|
||||
|
@ -998,7 +998,7 @@ class DockerManager(object):
|
|||
self.ensure_capability('log_driver')
|
||||
log_config = docker.utils.LogConfig(type=docker.utils.LogConfig.types.JSON)
|
||||
if optionals['log_opt'] is not None:
|
||||
for k, v in optionals['log_opt'].iteritems():
|
||||
for k, v in optionals['log_opt'].items():
|
||||
log_config.set_config_value(k, v)
|
||||
log_config.type = optionals['log_driver']
|
||||
params['log_config'] = log_config
|
||||
|
@ -1073,7 +1073,7 @@ class DockerManager(object):
|
|||
'''
|
||||
|
||||
parts = []
|
||||
for k, v in self.counters.iteritems():
|
||||
for k, v in self.counters.items():
|
||||
if v == 0:
|
||||
continue
|
||||
|
||||
|
@ -1100,7 +1100,7 @@ class DockerManager(object):
|
|||
|
||||
def get_summary_counters_msg(self):
|
||||
msg = ""
|
||||
for k, v in self.counters.iteritems():
|
||||
for k, v in self.counters.items():
|
||||
msg = msg + "%s %d " % (k, v)
|
||||
|
||||
return msg
|
||||
|
@ -1109,7 +1109,7 @@ class DockerManager(object):
|
|||
self.counters[name] = self.counters[name] + 1
|
||||
|
||||
def has_changed(self):
|
||||
for k, v in self.counters.iteritems():
|
||||
for k, v in self.counters.items():
|
||||
if v > 0:
|
||||
return True
|
||||
|
||||
|
@ -1287,7 +1287,7 @@ class DockerManager(object):
|
|||
expected_env[name] = value
|
||||
|
||||
if self.environment:
|
||||
for name, value in self.environment.iteritems():
|
||||
for name, value in self.environment.items():
|
||||
expected_env[name] = str(value)
|
||||
|
||||
actual_env = {}
|
||||
|
@ -1304,7 +1304,7 @@ class DockerManager(object):
|
|||
# LABELS
|
||||
|
||||
expected_labels = {}
|
||||
for name, value in self.module.params.get('labels').iteritems():
|
||||
for name, value in self.module.params.get('labels').items():
|
||||
expected_labels[name] = str(value)
|
||||
|
||||
if isinstance(container['Config']['Labels'], dict):
|
||||
|
@ -1401,7 +1401,7 @@ class DockerManager(object):
|
|||
|
||||
expected_bound_ports = {}
|
||||
if self.port_bindings:
|
||||
for container_port, config in self.port_bindings.iteritems():
|
||||
for container_port, config in self.port_bindings.items():
|
||||
if isinstance(container_port, int):
|
||||
container_port = "{0}/tcp".format(container_port)
|
||||
if len(config) == 1:
|
||||
|
@ -1437,7 +1437,7 @@ class DockerManager(object):
|
|||
# LINKS
|
||||
|
||||
expected_links = set()
|
||||
for link, alias in (self.links or {}).iteritems():
|
||||
for link, alias in (self.links or {}).items():
|
||||
expected_links.add("/{0}:{1}/{2}".format(link, container["Name"], alias))
|
||||
|
||||
actual_links = set(container['HostConfig']['Links'] or [])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue