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
This commit is contained in:
parent
4e6a3d52ed
commit
e02ab89410
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue