]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume: fix journal size argument not work 37377/head
authorwanghongxu <wanghognxu@t2cloud.net>
Thu, 27 Aug 2020 07:11:28 +0000 (15:11 +0800)
committerShyukri Shyukriev <shshyukriev@suse.com>
Wed, 23 Sep 2020 16:39:35 +0000 (19:39 +0300)
Journal size argument not work in batch prepare
filestore with SSD journal device.

Fixes: https://tracker.ceph.com/issues/41374
Signed-off-by: wanghongxu <wanghongxu@t2cloud.net>
(cherry picked from commit a7077dc661478a762a86b88452c98b30717c0b3c)

src/ceph-volume/ceph_volume/devices/lvm/strategies/filestore.py
src/ceph-volume/ceph_volume/tests/util/test_arg_validators.py

index bc10473eee9d9e7ecc06e3a0fe8ad00d04a5c56a..bc4eaba4613f7233c19f934553049e7dddf5a0ea 100644 (file)
@@ -351,8 +351,6 @@ class MixedType(MixedStrategy):
         else:
             journal_vg = self.common_vg
 
-        journal_size = prepare.get_journal_size(lv_format=False)
-
         # create 1 vg per data device first, mapping them to the device path,
         # when the lv gets created later, it can create as many as needed (or
         # even just 1)
@@ -371,7 +369,7 @@ class MixedType(MixedStrategy):
                 'osd-data', data_uuid, vg=data_vg, extents=data_lv_extents)
             journal_uuid = system.generate_uuid()
             journal_lv = lvm.create_lv(
-                'osd-journal', journal_uuid, vg=journal_vg, size=journal_size)
+                'osd-journal', journal_uuid, vg=journal_vg, size=self.journal_size)
 
             command = ['--filestore', '--data']
             command.append('%s/%s' % (data_vg.name, data_lv.name))
index 844518a44363948ebe01d5460e8b6b5dd1876f00..d4565ef4dcb5c3f6e2edfaff331c5ada65348ceb 100644 (file)
@@ -1,5 +1,6 @@
 import argparse
 import pytest
+import os
 from ceph_volume import exceptions
 from ceph_volume.util import arg_validators
 
@@ -9,7 +10,8 @@ class TestOSDPath(object):
     def setup(self):
         self.validator = arg_validators.OSDPath()
 
-    def test_is_not_root(self):
+    def test_is_not_root(self, monkeypatch):
+        monkeypatch.setattr(os, 'getuid', lambda: 100)
         with pytest.raises(exceptions.SuperUserError):
             self.validator('')