diff --git a/daemon/core/nodes/interface.py b/daemon/core/nodes/interface.py index deaaf261..5424bc1b 100644 --- a/daemon/core/nodes/interface.py +++ b/daemon/core/nodes/interface.py @@ -141,8 +141,11 @@ class CoreInterface(object): :return: True if parameter changed, False otherwise """ # treat None and 0 as unchanged values + if value is None or value <= 0: + return False + current_value = self._params.get(key) - if value is None or current_value == value or current_value <= 0 and value <= 0: + if current_value is not None and current_value == value: return False self._params[key] = value diff --git a/daemon/core/nodes/ipaddress.py b/daemon/core/nodes/ipaddress.py index 23144ce1..f1a763d1 100644 --- a/daemon/core/nodes/ipaddress.py +++ b/daemon/core/nodes/ipaddress.py @@ -236,7 +236,7 @@ class IpPrefix(object): self.prefixlen = int(tmp[1]) else: self.prefixlen = self.addrlen - self.prefix = socket.inet_pton(self.af, tmp[0]).decode("ISO-8859-1") + self.prefix = socket.inet_pton(self.af, tmp[0]) if self.addrlen > self.prefixlen: addrbits = self.addrlen - self.prefixlen netmask = ((1 << self.prefixlen) - 1) << addrbits