summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulia Kreger <juliaashleykreger@gmail.com>2022-03-07 11:53:57 -0800
committerJulia Kreger <juliaashleykreger@gmail.com>2022-10-10 15:53:41 +0000
commit640b10663e1d3722d91c118be1adce1f500ebcde (patch)
tree6d516f17c64b1c147a116d2d57b7bbcbe8f86f04
parent06a22998818adfec9394c42486a62ede9addfb8a (diff)
downloadironic-640b10663e1d3722d91c118be1adce1f500ebcde.tar.gz
Suppress Bandit B509 in snmp.py
Bandit's B509 (SNMPv3 no authentication/privacy) check is triggered by our line wrapping, as the check looks at the number of arguments, and triggers if it only parses 3 arguments. In Ironic's case, we pass five arguments. Presumably, this is due to the line wrapping. Ultimately this bandit check is very new having only been added with in the last few months. Change-Id: Idaee72a53a1f33bcab940c6ebe1e7c113a1cb1ce (cherry picked from commit e02ab89410c194faf54eaa4133e64ff24f873120) (cherry picked from commit 7aa40c5fa165c8090c9fa58b95ed1aa2931cd2f2)
-rw-r--r--ironic/drivers/modules/snmp.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/ironic/drivers/modules/snmp.py b/ironic/drivers/modules/snmp.py
index ab6c3ade4..95d68ff15 100644
--- a/ironic/drivers/modules/snmp.py
+++ b/ironic/drivers/modules/snmp.py
@@ -230,7 +230,10 @@ class SNMPClient(object):
object depending on SNMP version being used.
"""
if self.version == SNMP_V3:
- return snmp.UsmUserData(
+ # NOTE(TheJulia): Ignore Bandit error B509 argument parsing as
+ # the check is for a count of <3 arguments, however our line
+ # wrapping causes the check to trigger.
+ return snmp.UsmUserData( # nosec B509
self.user,
authKey=self.auth_key,
authProtocol=self.auth_proto,