]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume: return lvs as vg/lv from ValidDevice if as_string is True
authorAndrew Schoen <aschoen@redhat.com>
Tue, 13 Nov 2018 19:02:39 +0000 (13:02 -0600)
committerAlfredo Deza <adeza@redhat.com>
Wed, 14 Nov 2018 20:07:07 +0000 (15:07 -0500)
All code in prepare and activate expect lvs to be in that format.
Eventually we can refactor all that to use the Device class as well.

Signed-off-by: Andrew Schoen <aschoen@redhat.com>
Resolves: rm#27062
(cherry picked from commit fdf7f3c575299b6be0ac40fb6eee5106cea010c9)

src/ceph-volume/ceph_volume/util/arg_validators.py

index d13ed878048747d2bc271d058b618c6864cf8a9c..534c9aa64673693c617f461ab14c897fc3f553ab 100644 (file)
@@ -23,6 +23,9 @@ class ValidDevice(object):
             raise argparse.ArgumentError(None, error)
 
         if self.as_string:
+            if device.is_lv:
+                # all codepaths expect an lv path to be returned in this format
+                return "{}/{}".format(device.vg_name, device.lv_name)
             return string
         return device