Merge "Undercloud: Deprecate options for removed services"

This commit is contained in:
Zuul 2022-06-07 01:36:13 +00:00 committed by Gerrit Code Review
commit 5871c8a6ec
4 changed files with 37 additions and 75 deletions

View File

@ -0,0 +1,12 @@
---
deprecations:
- |
The following ``[DEFAULT]`` options of ``undercloud.conf`` have been
deprecated and have no effect, because the correponding services are no
longer supported in Undercloud.
- ``enable_cinder``
- ``enable_keystone``
- ``enable_swift``
- ``enable_swift_encryption``
- ``enable_telemetry``

View File

@ -60,6 +60,9 @@ class StandaloneConfig(BaseConfig):
# service enablement
cfg.BoolOpt('enable_cinder',
default=cinder,
deprecated_for_removal=True,
deprecated_reason=_('Cinder can no longer be enabled '
'via the config settings.'),
help=_('Whether to install the cinder service.')),
cfg.BoolOpt('enable_frr',
default=frr,
@ -88,10 +91,17 @@ class StandaloneConfig(BaseConfig):
),
cfg.BoolOpt('enable_swift',
default=swift,
deprecated_for_removal=True,
deprecated_reason=_('Swift can no longer be enabled '
'via the config settings.'),
help=_('Whether to install the swift services')
),
cfg.BoolOpt('enable_telemetry',
default=telemetry,
deprecated_for_removal=True,
deprecated_reason=_('Telemetry can no longer be '
'enabled via the config '
'settings.'),
help=_('Whether to install Telemetry services '
'(ceilometer, gnocchi, aodh).')
),
@ -113,6 +123,10 @@ class StandaloneConfig(BaseConfig):
help=_('Whether to enable the heat service.')),
cfg.BoolOpt('enable_keystone',
default=keystone,
deprecated_for_removal=True,
deprecated_reason=_('Keystone can no longer be '
'enabled via the config '
'settings.'),
help=_('Whether to enable the keystone service.')),
]

View File

@ -492,63 +492,6 @@ class TestUndercloudInstall(TestPluginV1):
'/usr/share/openstack-tripleo-heat-templates/'
'undercloud-stack-vstate-dropin.yaml'])
# TODO(cjeanner) drop once we have proper oslo.privsep
@mock.patch('os.geteuid', return_value=1001)
@mock.patch('getpass.getuser', return_value='stack')
@mock.patch('shutil.copy')
@mock.patch('os.mkdir')
@mock.patch('tripleoclient.utils.write_env_file', autospec=True)
@mock.patch('subprocess.check_call', autospec=True)
def test_undercloud_install_with_swift_encryption(self, mock_subprocess,
mock_wr, mock_os,
mock_copy, mock_user,
mock_getuid):
arglist = ['--no-validations']
verifylist = []
self.conf.set_default('enable_swift_encryption', True)
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
# DisplayCommandBase.take_action() returns two tuples
self.cmd.take_action(parsed_args)
mock_subprocess.assert_called_with(
['sudo', '--preserve-env', 'openstack', 'tripleo', 'deploy',
'--standalone-role', 'Undercloud', '--stack',
'undercloud', '--local-domain=localdomain',
'--local-ip=192.168.24.1/24',
'--templates=/usr/share/openstack-tripleo-heat-templates/',
'--networks-file=/usr/share/openstack-tripleo-heat-templates/'
'network_data_undercloud.yaml',
'--heat-native', '-e',
'/usr/share/openstack-tripleo-heat-templates/environments/'
'undercloud.yaml', '-e',
'/usr/share/openstack-tripleo-heat-templates/environments/'
'use-dns-for-vips.yaml', '-e',
'/home/stack/foo.yaml', '-e',
'/usr/share/openstack-tripleo-heat-templates/environments/'
'services/ironic.yaml', '-e',
'/usr/share/openstack-tripleo-heat-templates/environments/'
'services/ironic-inspector.yaml', '-e',
'/usr/share/openstack-tripleo-heat-templates/environments/'
'services/barbican.yaml', '-e',
'/usr/share/openstack-tripleo-heat-templates/environments/'
'barbican-backend-simple-crypto.yaml', '-e',
'/usr/share/openstack-tripleo-heat-templates/environments/'
'public-tls-undercloud.yaml',
'--public-virtual-ip', '192.168.24.2',
'--control-virtual-ip', '192.168.24.3', '-e',
'/usr/share/openstack-tripleo-heat-templates/environments/'
'ssl/tls-endpoints-public-ip.yaml', '-e',
'/usr/share/openstack-tripleo-heat-templates/environments/'
'services/undercloud-haproxy.yaml',
'--deployment-user', 'stack',
'--output-dir=/home/stack', '--cleanup',
'-e', '/home/stack/tripleo-config-generated-env-files/'
'undercloud_parameters.yaml',
'--log-file=install-undercloud.log', '-e',
'/usr/share/openstack-tripleo-heat-templates/'
'undercloud-stack-vstate-dropin.yaml'])
class TestUndercloudUpgrade(TestPluginV1):
def setUp(self):

View File

@ -592,8 +592,9 @@ def prepare_undercloud_deploy(upgrade=False, no_validations=True,
tht_templates, "environments/services/masquerade-networks.yaml")]
if CONF.get('enable_keystone'):
deploy_args += ['-e', os.path.join(
tht_templates, "environments/undercloud-enable-keystone.yaml")]
LOG.warning('Keystone has been deprecated and no longer be installed '
'using the enable_keystone. Please remove it from '
'undercloud.conf.')
if CONF.get('enable_ironic'):
deploy_args += ['-e', os.path.join(
@ -634,28 +635,20 @@ def prepare_undercloud_deploy(upgrade=False, no_validations=True,
env_data['UndercloudIpaOtp'] = CONF['ipa_otp']
if CONF.get('enable_swift'):
deploy_args += ['-e', os.path.join(
tht_templates, "environments/undercloud-enable-swift.yaml")]
LOG.warning('Swift has been deprecated and no longer be installed '
'using the enable_swift')
if CONF.get('enable_telemetry'):
deploy_args += ['-e', os.path.join(
tht_templates, "environments/enable-legacy-telemetry.yaml")]
LOG.warning('Telemetry has been deprecated and no longer be installed '
'using the enable_telemetry')
if CONF.get('enable_cinder'):
deploy_args += ['-e', os.path.join(
tht_templates,
"environments/services/undercloud-cinder.yaml")]
LOG.warning('Cinder has been deprecated and no longer be installed '
'using the enable_cinder')
if CONF.get('enable_swift_encryption'):
deploy_args += [
'-e', os.path.join(tht_templates,
"environments/services/barbican.yaml"),
'-e', os.path.join(
tht_templates,
"environments/barbican-backend-simple-crypto.yaml")
]
env_data['BarbicanSimpleCryptoGlobalDefault'] = True
env_data['SwiftEncryptionEnabled'] = True
LOG.warning('Swift has been deprecated and no longer be installed '
'using the enable_swift_encryption')
if CONF.get('enable_frr'):
deploy_args += ['-e', os.path.join(