Merge "Make modern flake8 happy about our code"

This commit is contained in:
Zuul 2019-09-20 17:19:35 +00:00 committed by Gerrit Code Review
commit e7f82ba7ef
4 changed files with 9 additions and 8 deletions

View File

@ -606,9 +606,8 @@ def _add_additional_networks(key, inventory, ip_q, q_name, netmask, interface,
container = base_hosts[container_host]
physical_host = container.get('physical_host')
if (reference_group and
physical_host not in
inventory.get(reference_group).get('hosts')):
if (reference_group and physical_host
not in inventory.get(reference_group).get('hosts')):
continue
# TODO(cloudnull) after a few releases this should be removed.
@ -1025,8 +1024,8 @@ def _check_config_settings(cidr_networks, config, container_skel):
raise SystemExit(
"can't find " + q_name + " in cidr_networks"
)
if (p_net.get('container_bridge') ==
overrides.get('management_bridge')):
if (p_net.get('container_bridge') == overrides.get(
'management_bridge')):
if not p_net.get('is_container_address'):
raise ProviderNetworkMisconfiguration(q_name)

View File

@ -133,9 +133,8 @@ def get_groups_for_container(inventory, container_name):
"""
# Beware, this dictionary comprehension requires Python 2.7, but we should
# have this on openstack-ansible hosts already.
groups = {k for (k, v) in inventory.items() if
('hosts' in v and
container_name in v['hosts'])}
groups = {k for (k, v) in inventory.items()
if ('hosts' in v and container_name in v['hosts'])}
return groups
@ -352,5 +351,6 @@ def main():
remove_inventory_item(user_args['remove_item'], inventory, filepath)
print('Success. . .')
if __name__ == "__main__":
main()

View File

@ -131,6 +131,7 @@ def TestUrl(workQueue, resultQueue):
# Subthread returned a time. Store it.
resultQueue.put((url, result[0]))
# Set the number of threads to use
numThreads = min(MAX_THREADS, len(MIRROR_LIST))

View File

@ -52,6 +52,7 @@ def args(arg_list):
return vars(parser.parse_args(arg_list))
if __name__ == "__main__":
script_args = args(sys.argv[1:])