Merge "Cleanup pep8 un-used variable warnings"
This commit is contained in:
commit
4ae4240c80
|
@ -33,7 +33,8 @@ def get_token(auth_uri, project_name, project_domain_name, username, password,
|
||||||
Ask OpenStack for a token
|
Ask OpenStack for a token
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
request_url = urllib.request.urlopen(auth_uri)
|
# handle auth_uri re-direct (300)
|
||||||
|
urllib.request.urlopen(auth_uri)
|
||||||
except urllib.error.HTTPError as e:
|
except urllib.error.HTTPError as e:
|
||||||
if e.code == 300:
|
if e.code == 300:
|
||||||
auth_uri = e.headers['location']
|
auth_uri = e.headers['location']
|
||||||
|
|
|
@ -210,7 +210,7 @@ def setup_fw_update_parser(commands):
|
||||||
|
|
||||||
# define the create command
|
# define the create command
|
||||||
# alarm restrictions, defaults to strict
|
# alarm restrictions, defaults to strict
|
||||||
create_strategy_cmd = setup_create_cmd(
|
_ = setup_create_cmd(
|
||||||
sub_cmds,
|
sub_cmds,
|
||||||
[sw_update.APPLY_TYPE_IGNORE], # controller supports ignore
|
[sw_update.APPLY_TYPE_IGNORE], # controller supports ignore
|
||||||
[sw_update.APPLY_TYPE_IGNORE], # storage supports ignore
|
[sw_update.APPLY_TYPE_IGNORE], # storage supports ignore
|
||||||
|
@ -227,13 +227,13 @@ def setup_fw_update_parser(commands):
|
||||||
# There are no additional create options for firmware update
|
# There are no additional create options for firmware update
|
||||||
|
|
||||||
# define the delete command
|
# define the delete command
|
||||||
delete_strategy_cmd = setup_delete_cmd(sub_cmds)
|
_ = setup_delete_cmd(sub_cmds)
|
||||||
# define the apply command
|
# define the apply command
|
||||||
apply_strategy_cmd = setup_apply_cmd(sub_cmds)
|
_ = setup_apply_cmd(sub_cmds)
|
||||||
# define the abort command
|
# define the abort command
|
||||||
abort_strategy_cmd = setup_abort_cmd(sub_cmds)
|
_ = setup_abort_cmd(sub_cmds)
|
||||||
# define the show command
|
# define the show command
|
||||||
show_strategy_cmd = setup_show_cmd(sub_cmds)
|
_ = setup_show_cmd(sub_cmds)
|
||||||
|
|
||||||
|
|
||||||
def setup_kube_rootca_update_parser(commands):
|
def setup_kube_rootca_update_parser(commands):
|
||||||
|
@ -283,13 +283,13 @@ def setup_kube_rootca_update_parser(commands):
|
||||||
help='Path to a file to be used, otherwise system will generate one')
|
help='Path to a file to be used, otherwise system will generate one')
|
||||||
|
|
||||||
# define the delete command
|
# define the delete command
|
||||||
delete_strategy_cmd = setup_delete_cmd(sub_cmds)
|
_ = setup_delete_cmd(sub_cmds)
|
||||||
# define the apply command
|
# define the apply command
|
||||||
apply_strategy_cmd = setup_apply_cmd(sub_cmds)
|
_ = setup_apply_cmd(sub_cmds)
|
||||||
# define the abort command
|
# define the abort command
|
||||||
abort_strategy_cmd = setup_abort_cmd(sub_cmds)
|
_ = setup_abort_cmd(sub_cmds)
|
||||||
# define the show command
|
# define the show command
|
||||||
show_strategy_cmd = setup_show_cmd(sub_cmds)
|
_ = setup_show_cmd(sub_cmds)
|
||||||
|
|
||||||
|
|
||||||
def setup_kube_upgrade_parser(commands):
|
def setup_kube_upgrade_parser(commands):
|
||||||
|
@ -332,13 +332,13 @@ def setup_kube_upgrade_parser(commands):
|
||||||
help='The kubernetes version')
|
help='The kubernetes version')
|
||||||
|
|
||||||
# define the delete command
|
# define the delete command
|
||||||
delete_strategy_cmd = setup_delete_cmd(sub_cmds)
|
_ = setup_delete_cmd(sub_cmds)
|
||||||
# define the apply command
|
# define the apply command
|
||||||
apply_strategy_cmd = setup_apply_cmd(sub_cmds)
|
_ = setup_apply_cmd(sub_cmds)
|
||||||
# define the abort command
|
# define the abort command
|
||||||
abort_strategy_cmd = setup_abort_cmd(sub_cmds)
|
_ = setup_abort_cmd(sub_cmds)
|
||||||
# define the show command
|
# define the show command
|
||||||
show_strategy_cmd = setup_show_cmd(sub_cmds)
|
_ = setup_show_cmd(sub_cmds)
|
||||||
|
|
||||||
|
|
||||||
def setup_patch_parser(commands):
|
def setup_patch_parser(commands):
|
||||||
|
@ -356,7 +356,7 @@ def setup_patch_parser(commands):
|
||||||
|
|
||||||
# define the create command
|
# define the create command
|
||||||
# alarm restrictions, defaults to strict
|
# alarm restrictions, defaults to strict
|
||||||
create_strategy_cmd = setup_create_cmd(
|
_ = setup_create_cmd(
|
||||||
sub_cmds,
|
sub_cmds,
|
||||||
[sw_update.APPLY_TYPE_SERIAL, # controller supports serial
|
[sw_update.APPLY_TYPE_SERIAL, # controller supports serial
|
||||||
sw_update.APPLY_TYPE_IGNORE],
|
sw_update.APPLY_TYPE_IGNORE],
|
||||||
|
@ -375,13 +375,13 @@ def setup_patch_parser(commands):
|
||||||
)
|
)
|
||||||
|
|
||||||
# define the delete command
|
# define the delete command
|
||||||
delete_strategy_cmd = setup_delete_cmd(sub_cmds)
|
_ = setup_delete_cmd(sub_cmds)
|
||||||
# define the apply command
|
# define the apply command
|
||||||
apply_strategy_cmd = setup_apply_cmd(sub_cmds)
|
_ = setup_apply_cmd(sub_cmds)
|
||||||
# define the abort command
|
# define the abort command
|
||||||
abort_strategy_cmd = setup_abort_cmd(sub_cmds)
|
_ = setup_abort_cmd(sub_cmds)
|
||||||
# define the show command
|
# define the show command
|
||||||
show_strategy_cmd = setup_show_cmd(sub_cmds)
|
_ = setup_show_cmd(sub_cmds)
|
||||||
|
|
||||||
|
|
||||||
def setup_upgrade_parser(commands):
|
def setup_upgrade_parser(commands):
|
||||||
|
@ -428,13 +428,13 @@ def setup_upgrade_parser(commands):
|
||||||
help=argparse.SUPPRESS)
|
help=argparse.SUPPRESS)
|
||||||
|
|
||||||
# define the delete command
|
# define the delete command
|
||||||
delete_strategy_cmd = setup_delete_cmd(sub_cmds)
|
_ = setup_delete_cmd(sub_cmds)
|
||||||
# define the apply command
|
# define the apply command
|
||||||
apply_strategy_cmd = setup_apply_cmd(sub_cmds)
|
_ = setup_apply_cmd(sub_cmds)
|
||||||
# define the abort command
|
# define the abort command
|
||||||
abort_strategy_cmd = setup_abort_cmd(sub_cmds)
|
_ = setup_abort_cmd(sub_cmds)
|
||||||
# define the show command
|
# define the show command
|
||||||
show_strategy_cmd = setup_show_cmd(sub_cmds)
|
_ = setup_show_cmd(sub_cmds)
|
||||||
|
|
||||||
|
|
||||||
def process_main(argv=sys.argv[1:]): # pylint: disable=dangerous-default-value
|
def process_main(argv=sys.argv[1:]): # pylint: disable=dangerous-default-value
|
||||||
|
|
|
@ -462,7 +462,6 @@ class EventLogManagement(event_log_handlers_v1.EventLogHandler):
|
||||||
fm_probable_cause = fm_constants.ALARM_PROBABLE_CAUSE_65
|
fm_probable_cause = fm_constants.ALARM_PROBABLE_CAUSE_65
|
||||||
fm_event_state = fm_constants.FM_ALARM_STATE_MSG
|
fm_event_state = fm_constants.FM_ALARM_STATE_MSG
|
||||||
fm_severity = _fm_event_importance_mapping[log_data.importance]
|
fm_severity = _fm_event_importance_mapping[log_data.importance]
|
||||||
fm_uuid = None
|
|
||||||
fm_reason_text = six.text_type(log_data.reason_text)
|
fm_reason_text = six.text_type(log_data.reason_text)
|
||||||
format_log = fm_api.Fault(fm_event_id, fm_event_state,
|
format_log = fm_api.Fault(fm_event_id, fm_event_state,
|
||||||
log_data.entity_type, log_data.entity,
|
log_data.entity_type, log_data.entity,
|
||||||
|
|
|
@ -1365,7 +1365,9 @@ class NFVIInfrastructureAPI(nfvi.api.v1.NFVIInfrastructureAPI):
|
||||||
future.work(sysinv.get_kube_host_upgrades, self._platform_token)
|
future.work(sysinv.get_kube_host_upgrades, self._platform_token)
|
||||||
future.result = (yield)
|
future.result = (yield)
|
||||||
if not future.result.is_complete():
|
if not future.result.is_complete():
|
||||||
DLOG.error("Sysinv Get Kube Host Upgrades did not complete.")
|
error_string = "{} did not complete".format(activity)
|
||||||
|
DLOG.error(error_string)
|
||||||
|
response['reason'] = error_string
|
||||||
return
|
return
|
||||||
kube_host_upgrade_list = future.result.data["kube_host_upgrades"]
|
kube_host_upgrade_list = future.result.data["kube_host_upgrades"]
|
||||||
|
|
||||||
|
|
|
@ -590,7 +590,7 @@ def delete_network_agents(token, host_name):
|
||||||
if (agent['host'] == host_name and
|
if (agent['host'] == host_name and
|
||||||
agent['agent_type'] in supported_agents):
|
agent['agent_type'] in supported_agents):
|
||||||
api_cmd = url + "/v2.0/agents/%s" % agent['id']
|
api_cmd = url + "/v2.0/agents/%s" % agent['id']
|
||||||
response = rest_api_request(token, "DELETE", api_cmd,
|
rest_api_request(token, "DELETE", api_cmd,
|
||||||
api_cmd_headers)
|
api_cmd_headers)
|
||||||
num_agents_found = num_agents_found + 1
|
num_agents_found = num_agents_found + 1
|
||||||
|
|
||||||
|
|
|
@ -66,7 +66,6 @@ def build_get_dhcp_agent_networks_response(agent_id,
|
||||||
get_dhcp_agent_networks_response['result-data'] = list()
|
get_dhcp_agent_networks_response['result-data'] = list()
|
||||||
|
|
||||||
for x in range(0, random.randint(0, MAX_NETWORKS - 1)):
|
for x in range(0, random.randint(0, MAX_NETWORKS - 1)):
|
||||||
host_name = "compute-" + str(x)
|
|
||||||
net_idx = 0
|
net_idx = 0
|
||||||
net = "physnet0"
|
net = "physnet0"
|
||||||
if use_strange_networks:
|
if use_strange_networks:
|
||||||
|
|
|
@ -1988,7 +1988,6 @@ class TestFwUpdateStrategy(sw_update_testcase.SwUpdateStrategyTestCase):
|
||||||
default_instance_action=SW_UPDATE_INSTANCE_ACTION.STOP_START,
|
default_instance_action=SW_UPDATE_INSTANCE_ACTION.STOP_START,
|
||||||
max_parallel_worker_hosts=10)
|
max_parallel_worker_hosts=10)
|
||||||
|
|
||||||
fw_update_controller_host_list = []
|
|
||||||
fw_update_worker_host_list = []
|
fw_update_worker_host_list = []
|
||||||
for host in list(self._host_table.values()):
|
for host in list(self._host_table.values()):
|
||||||
if host._nfvi_host.admin_state == nfvi.objects.v1.HOST_ADMIN_STATE.UNLOCKED:
|
if host._nfvi_host.admin_state == nfvi.objects.v1.HOST_ADMIN_STATE.UNLOCKED:
|
||||||
|
|
|
@ -71,7 +71,6 @@ def build_get_agent_routers_response(agent_id):
|
||||||
get_agent_routers_response['result-data'] = list()
|
get_agent_routers_response['result-data'] = list()
|
||||||
|
|
||||||
for x in range(0, random.randint(0, MAX_ROUTERS - 1)):
|
for x in range(0, random.randint(0, MAX_ROUTERS - 1)):
|
||||||
host_name = "compute-" + str(x)
|
|
||||||
get_agent_routers_response_entry = \
|
get_agent_routers_response_entry = \
|
||||||
{"id": agent_id + "_router_" + str(x)}
|
{"id": agent_id + "_router_" + str(x)}
|
||||||
get_agent_routers_response['result-data'].append(
|
get_agent_routers_response['result-data'].append(
|
||||||
|
|
|
@ -90,7 +90,7 @@ class TestNFVPluginsK8SNodeTaint(testcase.NFVTestCase):
|
||||||
try:
|
try:
|
||||||
kube_client = kubernetes_client.get_client()
|
kube_client = kubernetes_client.get_client()
|
||||||
response = kube_client.read_node(node_name)
|
response = kube_client.read_node(node_name)
|
||||||
except ApiException as e:
|
except ApiException:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
taints = response.spec.taints
|
taints = response.spec.taints
|
||||||
|
|
|
@ -2352,7 +2352,7 @@ class FwUpdateHostsStep(strategy.StrategyStep):
|
||||||
DLOG.error("failed to monitor firmware update ; no strategy")
|
DLOG.error("failed to monitor firmware update ; no strategy")
|
||||||
else:
|
else:
|
||||||
DLOG.error("get host request did not complete")
|
DLOG.error("get host request did not complete")
|
||||||
except Exception as e:
|
except Exception:
|
||||||
DLOG.exception("Caught exception interpreting host info")
|
DLOG.exception("Caught exception interpreting host info")
|
||||||
DLOG.error("Response: %s" % response)
|
DLOG.error("Response: %s" % response)
|
||||||
|
|
||||||
|
|
|
@ -77,12 +77,9 @@ verbosity=2
|
||||||
# E127 continuation line over-indented for visual indent
|
# E127 continuation line over-indented for visual indent
|
||||||
# E128 continuation line under-indented for visual indent
|
# E128 continuation line under-indented for visual indent
|
||||||
# E129 visually indented line with same indent as next logical line
|
# E129 visually indented line with same indent as next logical line
|
||||||
# flake8
|
|
||||||
# F841 local variable 'e' is assigned to but never used
|
|
||||||
ignore = H104,H404,H405,H501,
|
ignore = H104,H404,H405,H501,
|
||||||
W503,W504,W605,
|
W503,W504,W605,
|
||||||
E121,E122,E124,E126,E127,E128,E129,
|
E121,E122,E124,E126,E127,E128,E129
|
||||||
F841
|
|
||||||
# H106 Don’t put vim configuration in source files (off by default).
|
# H106 Don’t put vim configuration in source files (off by default).
|
||||||
# H203 Use assertIs(Not)None to check for None (off by default).
|
# H203 Use assertIs(Not)None to check for None (off by default).
|
||||||
# TODO: enable: H904 Delay string interpolations at logging calls (off by default).
|
# TODO: enable: H904 Delay string interpolations at logging calls (off by default).
|
||||||
|
|
Loading…
Reference in New Issue