fix: what bandit and the remaining lint rules found
- The six except Exception: pass (REST logout, the extra-ports lookup, the per-port detail in get_interfaces, closing CLI and REST sessions) now log at debug level (B110), so a swallowed failure leaves a trace. - nosec for comparing a reported address with 0.0.0.0 (B104) and for the empty password field of get_users (B105, now a named constant); both are false positives. - A long error message is split into adjacent f-strings; the unused ARP entry type is named _entry_type. - tests: the failed-open test expects ConnectionException instead of any Exception; raise ... from exc.
This commit is contained in:
1 parent
c2a788fa7a
commit
fc24495b83
5 files changed
+19
-13
No files matched your search
@@ -535,7 +535,7 @@ class TestDriverTransportDetection:
|
||||
with patch("napalm_procurve.procurve.ProcurveApiClient.probe", return_value=(None, None)):
|
||||
with patch("napalm_procurve.procurve.ConnectHandler", side_effect=Exception("no conn")):
|
||||
drv = ProcurveDriver("192.168.0.1", "manager", "secret")
|
||||
with pytest.raises(Exception):
|
||||
with pytest.raises(ConnectionException):
|
||||
drv.open()
|
||||
|
||||
def test_auth_failure_names_why_earlier_transports_failed(self):
|
||||
|
||||
Reference in new issue
Block a user