]> git.apps.os.sepia.ceph.com Git - ceph.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>
Wed, 14 Nov 2018 18:24:10 +0000 (13:24 -0500)
Signed-off-by: Alfredo Deza <adeza@redhat.com>
(cherry picked from commit e7daa71604f4d08ace1125bb63dcfe909796d3ab)

src/ceph-volume/ceph_volume/api/lvm.py

index f6527e33f595ab7643122155f1a9860d956d7291..aed4a8f6417c4fc31337f3868efd190cf9104041 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',