浏览代码

Remove nova-cert service during FFU

As nova-cert service doesn't exist on fresh queens
deployment, but it is enabled in newton.
During FFU from newton to queens, it is shown in
nova service list in ocata, pike and queens as well.

And since ocata and pike are EOL, we need to remove
it in queens during FFU from undercloud.

Change-Id: I1da2599ae6b0c5e860ce3a71fe6359ec649e8958
changes/30/690930/3
Rajesh Tailor 7 个月前
父节点
当前提交
86b55944cc
共有 2 个文件被更改,包括 21 次插入3 次删除
  1. +6
    -3
      instack_undercloud/tests/test_undercloud.py
  2. +15
    -0
      instack_undercloud/undercloud.py

+ 6
- 3
instack_undercloud/tests/test_undercloud.py 查看文件

@@ -946,13 +946,15 @@ class TestPostConfig(BaseTestCase):
@mock.patch('instack_undercloud.undercloud._delete_default_flavors')
@mock.patch('instack_undercloud.undercloud._copy_stackrc')
@mock.patch('instack_undercloud.undercloud._get_auth_values')
@mock.patch('instack_undercloud.undercloud._delete_nova_cert_service')
@mock.patch('instack_undercloud.undercloud._configure_ssh_keys')
@mock.patch('instack_undercloud.undercloud._ensure_flavor')
@mock.patch('instack_undercloud.undercloud._post_config_mistral')
def test_post_config(self, mock_post_config_mistral, mock_ensure_flavor,
mock_configure_ssh_keys, mock_get_auth_values,
mock_copy_stackrc, mock_delete, mock_mistral_client,
mock_swift_client, mock_nova_client, mock_ir_client,
mock_configure_ssh_keys, mock_delete_nova_cert,
mock_get_auth_values, mock_copy_stackrc,
mock_delete, mock_mistral_client, mock_swift_client,
mock_nova_client, mock_ir_client,
mock_get_session, mock_member_role_exists,
mock_ensure_neutron_network,
mock_config_neutron_segments_and_subnets,
@@ -987,6 +989,7 @@ class TestPostConfig(BaseTestCase):
2, session=mock_get_session.return_value)
self.assertTrue(mock_copy_stackrc.called)
mock_configure_ssh_keys.assert_called_with(mock_instance_nova)
mock_delete_nova_cert.assert_called_with(mock_instance_nova)
calls = [mock.call(mock_instance_nova, flavors[0], 'baremetal', None),
mock.call(mock_instance_nova, None, 'control', 'control'),
mock.call(mock_instance_nova, None, 'compute', 'compute'),


+ 15
- 0
instack_undercloud/undercloud.py 查看文件

@@ -2091,6 +2091,20 @@ def _migrate_to_convergence(heat):
LOG.info('Finished migrating stack "%s"', stack.id)


def _delete_nova_cert_service(nova):
"""Delete nova-cert service."""
try:
undercloud_host = CONF.undercloud_hostname or socket.gethostname()
nova.services.disable(undercloud_host, 'nova-cert')
service_list = nova.services.list()
for service in service_list:
if service.binary == 'nova-cert':
nova_cert_id = service.id
nova.services.delete(nova_cert_id)
except Exception:
LOG.debug('Continuing as nova-cert service is already deleted.')


def _post_config(instack_env, upgrade):
_copy_stackrc()
user, password, project, auth_url = _get_auth_values()
@@ -2113,6 +2127,7 @@ def _post_config(instack_env, upgrade):
_configure_ssh_keys(nova)
_ensure_ssh_selinux_permission()
_delete_default_flavors(nova)
_delete_nova_cert_service(nova)

_ensure_node_resource_classes(ironic)



正在加载...
取消
保存