]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume: set a lvm_size property on the fakedevice fixture
authorAndrew Schoen <aschoen@redhat.com>
Thu, 6 Dec 2018 18:37:56 +0000 (12:37 -0600)
committerAndrew Schoen <aschoen@redhat.com>
Thu, 6 Dec 2018 18:37:56 +0000 (12:37 -0600)
This is so tests can continue to set sys_api['size'] and the code
can retrieve that as Device.lvm_size

Signed-off-by: Andrew Schoen <aschoen@redhat.com>
src/ceph-volume/ceph_volume/tests/conftest.py

index 8ec99bb8469c4f453515affb444c83a94d4f40df..e9dbd123eeda404f436f37f81eba422dda6b56b4 100644 (file)
@@ -1,5 +1,6 @@
 import os
 import pytest
+from ceph_volume.util import disk
 from ceph_volume.api import lvm as lvm_api
 from ceph_volume import conf, configuration
 
@@ -66,6 +67,7 @@ def fakedevice(factory):
             is_lvm_member=True,
         )
         params.update(dict(kw))
+        params['lvm_size'] = disk.Size(b=params['sys_api'].get("size", 0))
         return factory(**params)
     return apply