Make modern flake8 happy about our code
In order to fit modern flake8, some minor changes required for scripts Change-Id: Ic3a02c6c19d230ca6edb6b068a03044225cd9fc4
This commit is contained in:
parent
54419bd5f4
commit
5ae62b53ce
@ -606,9 +606,8 @@ def _add_additional_networks(key, inventory, ip_q, q_name, netmask, interface,
|
|||||||
container = base_hosts[container_host]
|
container = base_hosts[container_host]
|
||||||
|
|
||||||
physical_host = container.get('physical_host')
|
physical_host = container.get('physical_host')
|
||||||
if (reference_group and
|
if (reference_group and physical_host
|
||||||
physical_host not in
|
not in inventory.get(reference_group).get('hosts')):
|
||||||
inventory.get(reference_group).get('hosts')):
|
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# TODO(cloudnull) after a few releases this should be removed.
|
# 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(
|
raise SystemExit(
|
||||||
"can't find " + q_name + " in cidr_networks"
|
"can't find " + q_name + " in cidr_networks"
|
||||||
)
|
)
|
||||||
if (p_net.get('container_bridge') ==
|
if (p_net.get('container_bridge') == overrides.get(
|
||||||
overrides.get('management_bridge')):
|
'management_bridge')):
|
||||||
if not p_net.get('is_container_address'):
|
if not p_net.get('is_container_address'):
|
||||||
raise ProviderNetworkMisconfiguration(q_name)
|
raise ProviderNetworkMisconfiguration(q_name)
|
||||||
|
|
||||||
|
@ -133,9 +133,8 @@ def get_groups_for_container(inventory, container_name):
|
|||||||
"""
|
"""
|
||||||
# Beware, this dictionary comprehension requires Python 2.7, but we should
|
# Beware, this dictionary comprehension requires Python 2.7, but we should
|
||||||
# have this on openstack-ansible hosts already.
|
# have this on openstack-ansible hosts already.
|
||||||
groups = {k for (k, v) in inventory.items() if
|
groups = {k for (k, v) in inventory.items()
|
||||||
('hosts' in v and
|
if ('hosts' in v and container_name in v['hosts'])}
|
||||||
container_name in v['hosts'])}
|
|
||||||
return groups
|
return groups
|
||||||
|
|
||||||
|
|
||||||
@ -352,5 +351,6 @@ def main():
|
|||||||
remove_inventory_item(user_args['remove_item'], inventory, filepath)
|
remove_inventory_item(user_args['remove_item'], inventory, filepath)
|
||||||
print('Success. . .')
|
print('Success. . .')
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
@ -131,6 +131,7 @@ def TestUrl(workQueue, resultQueue):
|
|||||||
# Subthread returned a time. Store it.
|
# Subthread returned a time. Store it.
|
||||||
resultQueue.put((url, result[0]))
|
resultQueue.put((url, result[0]))
|
||||||
|
|
||||||
|
|
||||||
# Set the number of threads to use
|
# Set the number of threads to use
|
||||||
numThreads = min(MAX_THREADS, len(MIRROR_LIST))
|
numThreads = min(MAX_THREADS, len(MIRROR_LIST))
|
||||||
|
|
||||||
|
@ -52,6 +52,7 @@ def args(arg_list):
|
|||||||
|
|
||||||
return vars(parser.parse_args(arg_list))
|
return vars(parser.parse_args(arg_list))
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
script_args = args(sys.argv[1:])
|
script_args = args(sys.argv[1:])
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user