]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume: remove legacy release check 41177/head
authorDimitri Savineau <dsavinea@redhat.com>
Wed, 5 May 2021 14:52:41 +0000 (10:52 -0400)
committerDimitri Savineau <dsavinea@redhat.com>
Wed, 5 May 2021 15:19:25 +0000 (11:19 -0400)
Those conditions don't make sense anymore so we can remove them.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
src/ceph-volume/ceph_volume/devices/lvm/activate.py
src/ceph-volume/ceph_volume/tests/util/test_prepare.py
src/ceph-volume/ceph_volume/util/prepare.py

index e4ac074a4f4147e935528b94df250f68cdf823fe..6e82d30b566aa9a0c6edae1462ce74c2279c4c9c 100644 (file)
@@ -3,7 +3,7 @@ import argparse
 import logging
 import os
 from textwrap import dedent
-from ceph_volume import process, conf, decorators, terminal, __release__, configuration
+from ceph_volume import process, conf, decorators, terminal, configuration
 from ceph_volume.util import system, disk
 from ceph_volume.util import prepare as prepare_utils
 from ceph_volume.util import encryption as encryption_utils
@@ -185,11 +185,7 @@ def activate_bluestore(osd_lvs, no_systemd=False):
     prime_command = [
         'ceph-bluestore-tool', '--cluster=%s' % conf.cluster,
         'prime-osd-dir', '--dev', osd_lv_path,
-        '--path', osd_path]
-
-    if __release__ != "luminous":
-        # mon-config changes are not available in Luminous
-        prime_command.append('--no-mon-config')
+        '--path', osd_path, '--no-mon-config']
 
     process.run(prime_command)
     # always re-do the symlink regardless if it exists, so that the block,
index ced5d49e76c9cb155baf83409c17bf556db56c68..9298a305acff127368ac6b96e61fdaea6d3284ba 100644 (file)
@@ -145,17 +145,10 @@ class TestOsdMkfsFilestore(object):
 
     @pytest.mark.parametrize('flag', mkfs_filestore_flags)
     def test_keyring_is_used(self, fake_call, monkeypatch, flag):
-        monkeypatch.setattr(prepare, '__release__', 'mimic')
         monkeypatch.setattr(system, 'chown', lambda path: True)
         prepare.osd_mkfs_filestore(1, 'asdf', keyring='secret')
         assert flag in fake_call.calls[0]['args'][0]
 
-    def test_keyring_is_used_luminous(self, fake_call, monkeypatch):
-        monkeypatch.setattr(prepare, '__release__', 'luminous')
-        monkeypatch.setattr(system, 'chown', lambda path: True)
-        prepare.osd_mkfs_filestore(1, 'asdf', keyring='secret')
-        assert '--keyfile' not in fake_call.calls[0]['args'][0]
-
 
 class TestOsdMkfsBluestore(object):
 
@@ -169,12 +162,6 @@ class TestOsdMkfsBluestore(object):
         prepare.osd_mkfs_bluestore(1, 'asdf')
         assert '--keyfile' not in fake_call.calls[0]['args'][0]
 
-    def test_keyring_is_not_added_luminous(self, fake_call, monkeypatch):
-        monkeypatch.setattr(system, 'chown', lambda path: True)
-        prepare.osd_mkfs_bluestore(1, 'asdf')
-        monkeypatch.setattr(prepare, '__release__', 'luminous')
-        assert '--keyfile' not in fake_call.calls[0]['args'][0]
-
     def test_wal_is_added(self, fake_call, monkeypatch):
         monkeypatch.setattr(system, 'chown', lambda path: True)
         prepare.osd_mkfs_bluestore(1, 'asdf', wal='/dev/smm1')
index 85b7033c212a883af51bd71e8e1f06111d9f15ee..8c773bbaff8048b33f1f2b0480590e176c404d9b 100644 (file)
@@ -9,7 +9,7 @@ import os
 import logging
 import json
 import time
-from ceph_volume import process, conf, __release__, terminal
+from ceph_volume import process, conf, terminal
 from ceph_volume.util import system, constants, str_to_int, disk
 
 logger = logging.getLogger(__name__)
@@ -512,11 +512,8 @@ def osd_mkfs_filestore(osd_id, fsid, keyring):
     if get_osdspec_affinity():
         command.extend(['--osdspec-affinity', get_osdspec_affinity()])
 
-    if __release__ != 'luminous':
-        # goes through stdin
-        command.extend(['--keyfile', '-'])
-
     command.extend([
+        '--keyfile', '-',
         '--osd-data', path,
         '--osd-journal', journal,
         '--osd-uuid', fsid,