fix: what bandit and the remaining lint rules found
- set_interface: the except Exception: pass around reading the old untagged VLANs now logs at debug level (B110), with a module logger. - nosec for the empty password field of get_users (B105, now a named constant); a false positive. - Two docstrings quoting tabular device output keep their lines (noqa E501); a long docstring and an error message are shortened or split; the unused duplex column is named _duplex. - tests: a get_facts test named SHOW_INTERFACE, which does not exist; it is SHOW_INTERFACE_STATUS. raise ... from exc.
This commit is contained in:
1 parent
e53a4b4cc6
commit
bef2f23ab2
3 files changed
+16
-9
No files matched your search
@@ -96,7 +96,7 @@ class TestGetFacts:
|
||||
|
||||
# _get_interface_list needs show interface
|
||||
driver.device.send_command.side_effect = lambda cmd, **kw: (
|
||||
SHOW_SYSTEM_INFO if "system-info" in cmd else SHOW_INTERFACE
|
||||
SHOW_SYSTEM_INFO if "system-info" in cmd else SHOW_INTERFACE_STATUS
|
||||
)
|
||||
|
||||
facts = driver.get_facts()
|
||||
|
||||
@@ -76,7 +76,7 @@ def test_a_changed_key_is_refused():
|
||||
try:
|
||||
raise paramiko.BadHostKeyException("10.0.0.8", SERVER_KEY, OTHER_KEY)
|
||||
except paramiko.SSHException as exc: # what netmiko does with it
|
||||
raise NetmikoTimeoutException(f"A paramiko SSHException occurred: {exc}")
|
||||
raise NetmikoTimeoutException(f"A paramiko SSHException occurred: {exc}") from exc
|
||||
|
||||
driver = _driver(seen, SshHostKey.of(OTHER_KEY))
|
||||
with patch(HANDLER, side_effect=refuse):
|
||||
|
||||
Reference in new issue
Block a user