diff options
author | Julia Kreger <juliaashleykreger@gmail.com> | 2022-03-07 11:53:57 -0800 |
---|---|---|
committer | Julia Kreger <juliaashleykreger@gmail.com> | 2022-03-07 11:53:57 -0800 |
commit | e02ab89410c194faf54eaa4133e64ff24f873120 (patch) | |
tree | f00ef29950a2a22427973df2d938c99575d5a79c /ironic/drivers/modules/snmp.py | |
parent | 4e6a3d52edc42b490c10c110dee5ea9e64fc3467 (diff) | |
download | ironic-e02ab89410c194faf54eaa4133e64ff24f873120.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
Diffstat (limited to 'ironic/drivers/modules/snmp.py')
-rw-r--r-- | ironic/drivers/modules/snmp.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ironic/drivers/modules/snmp.py b/ironic/drivers/modules/snmp.py index a200b6717..4e700c6f8 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, |