From: Jan Fajerski Date: Wed, 11 Dec 2019 12:17:02 +0000 (+0100) Subject: api/lvm: add deactivate method to Volume class X-Git-Tag: v14.2.8~58^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=44b7312ef294569e16271df859a2c5fb8f176133;p=ceph.git api/lvm: add deactivate method to Volume class Simply calls lvchange -an to deactivate a logical volume. Signed-off-by: Jan Fajerski (cherry picked from commit 8087600d4853554794b709291a08d97befd07ed1) --- diff --git a/src/ceph-volume/ceph_volume/api/lvm.py b/src/ceph-volume/ceph_volume/api/lvm.py index f53de0deec5f..c1a30ea51feb 100644 --- a/src/ceph-volume/ceph_volume/api/lvm.py +++ b/src/ceph-volume/ceph_volume/api/lvm.py @@ -998,6 +998,12 @@ class Volume(object): ) self.tags[key] = value + def deactivate(self): + """ + Deactivate the LV by calling lvchange -an + """ + process.call(['lvchange', '-an', self.lv_path]) + class Volumes(list): """