diff --git a/CHANGELOG.md b/CHANGELOG.md index 14b03a4665..4428768288 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 This changelog format was introduced in NAV 5.4.0. Older changelogs can be found in the [HISTORY](HISTORY) file. +## [Unreleased] + +### Fixed + +- Fix non-working SNMPv1 communication ([#2772](https://github.com/Uninett/nav/issues/2772), [#2779](https://github.com/Uninett/nav/issues/2779), [#2780](https://github.com/Uninett/nav/pull/2780)) + ## [5.8.2] - 2023-11-30 ### Fixed diff --git a/python/nav/ipdevpoll/snmp/common.py b/python/nav/ipdevpoll/snmp/common.py index b17447e1cb..21a3f2b10c 100644 --- a/python/nav/ipdevpoll/snmp/common.py +++ b/python/nav/ipdevpoll/snmp/common.py @@ -240,7 +240,7 @@ def as_agentproxy_args(self) -> Dict[str, Any]: """Returns the SNMP session parameters in a dict format compatible with pynetsnmp.twistedsnmp.AgentProxy() keyword arguments. """ - kwargs = {"snmpVersion": self.version_string} + kwargs = {"snmpVersion": f"v{self.version_string}"} if self.version in (1, 2): kwargs["community"] = self.community if self.timeout: diff --git a/tests/unittests/ipdevpoll/snmp/common_test.py b/tests/unittests/ipdevpoll/snmp/common_test.py index 6b34caffd7..dc7558b729 100644 --- a/tests/unittests/ipdevpoll/snmp/common_test.py +++ b/tests/unittests/ipdevpoll/snmp/common_test.py @@ -31,7 +31,7 @@ def test_should_contain_cmdline_args(self, snmpv3_params): def test_should_contain_version_argument(self, snmpv3_params): kwargs = snmpv3_params.as_agentproxy_args() - assert kwargs.get("snmpVersion") == "3" + assert kwargs.get("snmpVersion") == "v3" def test_should_contain_sec_level_cmdline_argument(self, snmpv3_params): kwargs = snmpv3_params.as_agentproxy_args()