From 573c53a25d4a48220bc82e1d8ebdd689cb0838a5 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Wed, 27 Jan 2021 13:33:50 +0800 Subject: [PATCH] mgr/zabbix: do not catch exception with name silences flake8 warning of F841: https://www.flake8rules.com/rules/F841.html Signed-off-by: Kefu Chai --- src/pybind/mgr/zabbix/module.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pybind/mgr/zabbix/module.py b/src/pybind/mgr/zabbix/module.py index c4f19f38c8b..b586de5e7b4 100644 --- a/src/pybind/mgr/zabbix/module.py +++ b/src/pybind/mgr/zabbix/module.py @@ -459,7 +459,7 @@ class Module(MgrModule): if discovery_counter == discovery_interval: try: self.discovery() - except Exception as exc: + except Exception: # Shouldn't happen, but let's log it and retry next interval, # rather than dying completely. self.log.exception("Unexpected error during discovery():") @@ -469,7 +469,7 @@ class Module(MgrModule): try: data = self.get_data() self.send(data) - except Exception as exc: + except Exception: # Shouldn't happen, but let's log it and retry next interval, # rather than dying completely. self.log.exception("Unexpected error during send():")