]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume: adds Volume.clear_tags
authorAndrew Schoen <aschoen@redhat.com>
Thu, 19 Oct 2017 19:55:02 +0000 (14:55 -0500)
committerAndrew Schoen <aschoen@redhat.com>
Fri, 27 Oct 2017 16:15:43 +0000 (11:15 -0500)
Will remove all tags for the current lv

Signed-off-by: Andrew Schoen <aschoen@redhat.com>
src/ceph-volume/ceph_volume/api/lvm.py

index 9c384ce09ca3468ecaa1d7cde989c67654b7b555..d82aee685f7b2bba90d80f5e35bc725e4c838230 100644 (file)
@@ -652,6 +652,14 @@ class Volume(object):
         obj['path'] = self.lv_path
         return obj
 
+    def clear_tags(self):
+        """
+        Removes all tags from the Logical Volume.
+        """
+        for k, v in self.tags.items():
+            tag = "%s=%s" % (k, v)
+            process.run(['sudo', 'lvchange', '--deltag', tag, self.lv_path])
+
     def set_tags(self, tags):
         """
         :param tags: A dictionary of tag names and values, like::