diff --git a/python/nav/models/manage.py b/python/nav/models/manage.py index 3aa6b748bf..2d5c3492ce 100644 --- a/python/nav/models/manage.py +++ b/python/nav/models/manage.py @@ -160,10 +160,17 @@ def is_snmp(self): def snmp_version(self): """Returns the configured SNMP version as an integer""" if self.protocol == self.PROTOCOL_SNMP: - value = self.configuration['version'] + value = self.configuration.get("version") if value == "2c": return 2 - return int(value) + if value: + return int(value) + else: + _logger.error( + "Broken management profile %s has no SNMP version", self.name + ) + return None + elif self.protocol == self.PROTOCOL_SNMPV3: return 3