+ def update_tag(self, tagname, value, slicetags, dryrun, node = None):
+ tag = self.get_tag(tagname, slicetags, node)
+
+ if tag and tag.value == value:
+ value = "no change"
+ elif not dryrun:
+ if tag:
+ UpdateSliceTag(tag.id, value)
+ else:
+ tag = self.add_tag(tagname, value, slicetags, dryrun, node)
+
+ if tag:
+ tag.updated = 1
+ id = tag.id
+ else:
+ id = 'new'
+
+ if dryrun:
+ if node:
+ print "[%s] %s: %s (%s)" % (id, tagname, value, node.shortname)
+ else:
+ print "[%s] %s: %s" % (id, tagname, value)