From: Dimitri Savineau Date: Wed, 5 May 2021 14:52:41 +0000 (-0400) Subject: ceph-volume: remove legacy release check X-Git-Tag: v17.1.0~2039^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F41177%2Fhead;p=ceph.git ceph-volume: remove legacy release check Those conditions don't make sense anymore so we can remove them. Signed-off-by: Dimitri Savineau --- diff --git a/src/ceph-volume/ceph_volume/devices/lvm/activate.py b/src/ceph-volume/ceph_volume/devices/lvm/activate.py index e4ac074a4f41..6e82d30b566a 100644 --- a/src/ceph-volume/ceph_volume/devices/lvm/activate.py +++ b/src/ceph-volume/ceph_volume/devices/lvm/activate.py @@ -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, diff --git a/src/ceph-volume/ceph_volume/tests/util/test_prepare.py b/src/ceph-volume/ceph_volume/tests/util/test_prepare.py index ced5d49e76c9..9298a305acff 100644 --- a/src/ceph-volume/ceph_volume/tests/util/test_prepare.py +++ b/src/ceph-volume/ceph_volume/tests/util/test_prepare.py @@ -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') diff --git a/src/ceph-volume/ceph_volume/util/prepare.py b/src/ceph-volume/ceph_volume/util/prepare.py index 85b7033c212a..8c773bbaff80 100644 --- a/src/ceph-volume/ceph_volume/util/prepare.py +++ b/src/ceph-volume/ceph_volume/util/prepare.py @@ -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,