From 3c9401f1618f7fcbea827fe7279e8dfde617d957 Mon Sep 17 00:00:00 2001 From: Andrew Schoen Date: Thu, 19 Oct 2017 14:55:02 -0500 Subject: [PATCH] ceph-volume: adds Volume.clear_tags Will remove all tags for the current lv Signed-off-by: Andrew Schoen --- src/ceph-volume/ceph_volume/api/lvm.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/ceph-volume/ceph_volume/api/lvm.py b/src/ceph-volume/ceph_volume/api/lvm.py index 9c384ce09ca..d82aee685f7 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:: -- 2.39.5