mirror of
https://github.com/ceph/ceph
synced 2025-03-11 02:39:05 +00:00
ceph-volume lvm.api use a helper to get an lv from an arg
Signed-off-by: Alfredo Deza <adeza@redhat.com>
This commit is contained in:
parent
ff72fd0ed5
commit
3c5bbbc582
@ -131,6 +131,19 @@ def get_api_pvs():
|
||||
return _output_parser(stdout, fields)
|
||||
|
||||
|
||||
def get_lv_from_argument(argument):
|
||||
"""
|
||||
Helper proxy function that consumes a possible logical volume passed in from the CLI
|
||||
in the form of `vg/lv`, but with some validation so that an argument that is a full
|
||||
path to a device can be ignored
|
||||
"""
|
||||
try:
|
||||
vg_name, lv_name = argument.split('/')
|
||||
except (ValueError, AttributeError):
|
||||
return None
|
||||
return get_lv(lv_name=lv_name, vg_name=vg_name)
|
||||
|
||||
|
||||
def get_lv(lv_name=None, vg_name=None, lv_path=None, lv_uuid=None, lv_tags=None):
|
||||
"""
|
||||
Return a matching lv for the current system, requiring ``lv_name``,
|
||||
|
Loading…
Reference in New Issue
Block a user