]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
use extent count for slots conversion instead of free count
authorJan Fajerski <jfajerski@suse.com>
Wed, 4 Mar 2020 12:28:46 +0000 (13:28 +0100)
committerJan Fajerski <jfajerski@suse.com>
Tue, 21 Apr 2020 11:21:17 +0000 (13:21 +0200)
Signed-off-by: Jan Fajerski <jfajerski@suse.com>
(cherry picked from commit 4a81b4a2fbb4cafe45a8fe8cceeece636e51adb6)

src/ceph-volume/ceph_volume/api/lvm.py
src/ceph-volume/ceph_volume/tests/api/test_lvm.py

index 7f41f56ff531d0aa4471fb2143388537887236ce..f4ef1cf6a1aaa03c2fb1967b8831fcdc57994f9f 100644 (file)
@@ -649,7 +649,7 @@ class VolumeGroup(object):
         '''
         Return how many extents fit the VG slot times
         '''
-        return int(int(self.vg_free_count) / slots)
+        return int(int(self.vg_extent_count) / slots)
 
 
 class VolumeGroups(list):
index c0f8e3f53917da03bed85dbd248c16e5848369a7..fea6fefaa085781e82b8b6d7e12bf2668f3c6b98 100644 (file)
@@ -533,6 +533,7 @@ class TestCreateLV(object):
         self.foo_volume = api.Volume(lv_name='foo', lv_path='/path', vg_name='foo_group', lv_tags='')
         self.foo_group = api.VolumeGroup(vg_name='foo_group',
                                          vg_extent_size=4194304,
+                                         vg_extent_count=100,
                                          vg_free_count=100)
 
     @patch('ceph_volume.api.lvm.process.run')