Merge "Fix local variable is assigned to but never used"

This commit is contained in:
Jenkins 2016-12-14 06:15:44 +00:00 committed by Gerrit Code Review
commit adf77a5440
5 changed files with 5 additions and 6 deletions

View File

@ -52,7 +52,7 @@ class IndexView(tables.DataTableView):
paginator = Paginator(results, limit)
results = paginator.page(1)
except EmptyPage:
contacts = paginator.page(paginator.num_pages)
results = paginator.page(paginator.num_pages)
except Exception:
messages.error(self.request, _("Could not retrieve alarm definitions"))

View File

@ -149,7 +149,7 @@ class SetAlarmDefinitionExpressionAction(workflows.Action):
try:
self.fields['expression'].metrics = ad_forms._get_metrics(request)
except Exception as ex:
except Exception:
exceptions.handle(request, _('Unable to retrieve metrics'))

View File

@ -205,7 +205,7 @@ class AlarmServiceView(tables.DataTableView):
try:
name, value = self.service.split("=")
results = [api.monitor.alarm_show(self.request, value)]
except Exception as e:
except Exception:
messages.error(self.request, _("Could not retrieve alarms"))
results = []
else:

View File

@ -49,7 +49,7 @@ class IndexView(tables.DataTableView):
paginator = Paginator(results, LIMIT)
results = paginator.page(1)
except EmptyPage:
contacts = paginator.page(paginator.num_pages)
results = paginator.page(paginator.num_pages)
except Exception:
messages.error(self.request, _("Could not retrieve notifications"))
return results

View File

@ -29,7 +29,6 @@ exclude = .venv,.git,.tox,dist,*lib/python*,*egg,build,panel_template,dash_templ
# E127 continuation line over-indented for visual indent
# E128 continuation line under-indented for visual indent
# E501 line too long
# F841 local variable is assigned to but never used
# H102 Apache 2.0 license header not found
# H238 old style class declaration, use new style
# H301 one import per line
@ -39,4 +38,4 @@ exclude = .venv,.git,.tox,dist,*lib/python*,*egg,build,panel_template,dash_templ
# H405 multi line docstring summary not separated with an empty line
# H803 git commit title should not end with period (disabled on purpose, see bug #1236621)
# H904 Wrap long lines in parentheses instead of a backslash
ignore = E127,E128,E501,F841,H102,H238,H301,H305,H306,H307,H405,H803,H904
ignore = E127,E128,E501,H102,H238,H301,H305,H306,H307,H405,H803,H904