From f209c9d4d50bd7abe0f7f6b9fb29359cb7196718 Mon Sep 17 00:00:00 2001 From: Alfredo Deza Date: Fri, 20 Oct 2017 08:48:01 -0400 Subject: [PATCH] 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 --- src/ceph-volume/ceph_volume/api/lvm.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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): -- 2.39.5