From: Andrew Schoen Date: Thu, 19 Oct 2017 19:55:02 +0000 (-0500) Subject: ceph-volume: adds Volume.clear_tags X-Git-Tag: v13.0.1~367^2~8 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3c9401f1618f7fcbea827fe7279e8dfde617d957;p=ceph.git ceph-volume: adds Volume.clear_tags Will remove all tags for the current lv Signed-off-by: Andrew Schoen --- diff --git a/src/ceph-volume/ceph_volume/api/lvm.py b/src/ceph-volume/ceph_volume/api/lvm.py index 9c384ce09ca3..d82aee685f7b 100644 --- a/src/ceph-volume/ceph_volume/api/lvm.py +++ b/src/ceph-volume/ceph_volume/api/lvm.py @@ -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::