From: Alfredo Deza Date: Fri, 20 Oct 2017 12:48:01 +0000 (-0400) Subject: ceph-volume api.lvm return result of get_lv when using arguments X-Git-Tag: v12.2.2~83^2~30 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=40cfec281cc2584b2e2987f356109c6c160d4597;p=ceph.git ceph-volume api.lvm return result of get_lv when using arguments If the argument is an absolute path it is fine to just return whatever get_lv finds since it is a "safe" call, it will return a None if nothing is found Signed-off-by: Alfredo Deza (cherry picked from commit f209c9d4d50bd7abe0f7f6b9fb29359cb7196718) --- diff --git a/src/ceph-volume/ceph_volume/api/lvm.py b/src/ceph-volume/ceph_volume/api/lvm.py index 110e990071f..05f6cb2f07b 100644 --- a/src/ceph-volume/ceph_volume/api/lvm.py +++ b/src/ceph-volume/ceph_volume/api/lvm.py @@ -139,8 +139,7 @@ def get_lv_from_argument(argument): """ if argument.startswith('/'): lv = get_lv(lv_path=argument) - if lv: - return lv + return lv try: vg_name, lv_name = argument.split('/') except (ValueError, AttributeError):