fix: checks wasn't idempotent

This commit is contained in:
Adrien Waksberg 2019-06-22 20:46:26 +02:00
parent af0452b5f7
commit d27714948f

View file

@ -20,7 +20,10 @@ class SensuCheck:
return {} return {}
def labels_has_changed(self, new_labels, old_labels): def labels_has_changed(self, new_labels, old_labels):
if old_labels is None or len(new_labels) != len(old_labels): if not old_labels and not new_labels:
return False
if len(new_labels) != len(old_labels):
return True return True
for old_label, old_value in old_labels.iteritems(): for old_label, old_value in old_labels.iteritems():