Skip to content

Commit

Permalink
ceph-volume api.lvm allow passing a Volume object to remove_lv
Browse files Browse the repository at this point in the history
Signed-off-by: Alfredo Deza <adeza@redhat.com>
  • Loading branch information
Alfredo Deza committed Nov 13, 2018
1 parent 4656bf0 commit e7daa71
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/ceph-volume/ceph_volume/api/lvm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit e7daa71

Please sign in to comment.