Loading cloudcontrol/common/client/tags.py +20 −0 Original line number Diff line number Diff line Loading @@ -282,6 +282,26 @@ class TagDB(object): self._parent.add_sub_object(sub_id, db.itervalues(), self._object_types[sub_id]) def check_tags_conflict(self, *tag_names): """Checks a list of tag names that might conflict before inserting in TagDB hierarchy .. warning:: This is in no way a guarantee that following inserts will succeed. """ conflicts = [] parent_check = [] for name in tag_names: if name in self.db['__main__']: conflicts.append(name) else: parent_check.append(name) if self._parent is not None and parent_check: conflicts.extend(self._parent.check_tags_conflict(*parent_check)) return conflicts # tag handling part, used by plugins def add_tags(self, tags, ignore_errors=False): """ Loading Loading
cloudcontrol/common/client/tags.py +20 −0 Original line number Diff line number Diff line Loading @@ -282,6 +282,26 @@ class TagDB(object): self._parent.add_sub_object(sub_id, db.itervalues(), self._object_types[sub_id]) def check_tags_conflict(self, *tag_names): """Checks a list of tag names that might conflict before inserting in TagDB hierarchy .. warning:: This is in no way a guarantee that following inserts will succeed. """ conflicts = [] parent_check = [] for name in tag_names: if name in self.db['__main__']: conflicts.append(name) else: parent_check.append(name) if self._parent is not None and parent_check: conflicts.extend(self._parent.check_tags_conflict(*parent_check)) return conflicts # tag handling part, used by plugins def add_tags(self, tags, ignore_errors=False): """ Loading