Commit f1d739e1 authored by Anael Beutot's avatar Anael Beutot
Browse files

Fix tag registering for infinite ttl.

Tag that had infinite TTL and with a periodic refresh didn't had their
registration done in case off None -> not None value and vice versa.
parent 2c69d365
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -65,13 +65,10 @@ class Tag(object):
        """Called when the tag value may change."""
        prev_value = self.value
        self.calculate_value()
        # if tag is not pushed
        # if self.ttl is not None:
        if self.ttl != -1:
            return

        if prev_value == self.value:
            return
        if prev_value is None:
        elif prev_value is None:
            # we need to register tag again
            if self.sub_id == '__main__':
                logger.debug('Register tag %s', self.name)
@@ -88,6 +85,10 @@ class Tag(object):
            else:
                logger.debug('Unregister sub tag %s.%s', self.sub_id, self.name)
                self.db.rpc_unregister_sub_tag(self.sub_id, self.name)
        # if tag is not pushed
        # if self.ttl is not None:
        elif self.ttl != -1:
            return
        else:
            # update the tag value
            logger.debug('Update tag value %s', self.name)