]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
ceph-volume api.lvm allow passing a Volume object to remove_lv
authorAlfredo Deza <adeza@redhat.com>
Tue, 13 Nov 2018 21:56:02 +0000 (16:56 -0500)
committerAlfredo Deza <adeza@redhat.com>
Tue, 13 Nov 2018 22:07:01 +0000 (17:07 -0500)
Signed-off-by: Alfredo Deza <adeza@redhat.com>
src/ceph-volume/ceph_volume/api/lvm.py

index 0bbf9ee9436dcb6fa8892350485c04de08070808..0099ce3905bab7407bd42b4fe99626fe974e0bdd 100644 (file)
@@ -505,13 +505,20 @@ def remove_pv(pv_name):
     )
 
 
-def remove_lv(path):
+def remove_lv(lv):
     """
     Removes a logical volume given it's absolute path.
 
     Will return True if the lv is successfully removed or
     raises a RuntimeError if the removal fails.
+
+    :param lv: A ``Volume`` object or the path for an LV
     """
+    if isinstance(lv, Volume):
+        path = lv.lv_path
+    else:
+        path = lv
+
     stdout, stderr, returncode = process.call(
         [
             'lvremove',