diff --git a/python/nav/portadmin/snmp/base.py b/python/nav/portadmin/snmp/base.py index 1ed3ae22de..c9186f622f 100644 --- a/python/nav/portadmin/snmp/base.py +++ b/python/nav/portadmin/snmp/base.py @@ -176,10 +176,8 @@ def _get_read_only_handle(self): if not profile: raise NoReadOnlyManagementProfileError - self.read_only_handle = Snmp.Snmp( + self.read_only_handle = get_snmp_session_for_profile(profile)( host=self.netbox.ip, - community=profile.snmp_community, - version=profile.snmp_version, retries=self.retries, timeout=self.timeout, ) @@ -206,10 +204,8 @@ def _get_read_write_handle(self): """ if self.read_write_handle is None: profile = self.netbox.get_preferred_snmp_management_profile(writeable=True) - self.read_write_handle = Snmp.Snmp( + self.read_write_handle = get_snmp_session_for_profile(profile)( host=self.netbox.ip, - community=profile.snmp_community, - version=profile.snmp_version, retries=self.retries, timeout=self.timeout, )