Merge "Remove logic to detect legacy network resources"
This commit is contained in:
commit
0cba88a0c1
@ -668,18 +668,6 @@ class TestWaitForStackUtil(TestCase):
|
||||
result = utils.wait_for_stack_ready(self.mock_orchestration, 'stack')
|
||||
self.assertEqual(False, result)
|
||||
|
||||
def test_check_heat_network_config(self):
|
||||
env_reg = {
|
||||
'OS::TripleO::Controller::Net::SoftwareConfig': 'val',
|
||||
'OS::TripleO::Compute::Net::SoftwareConfig': 'val',
|
||||
}
|
||||
env = {
|
||||
'resource_registry': env_reg
|
||||
}
|
||||
|
||||
self.assertRaises(exceptions.InvalidConfiguration,
|
||||
utils.check_nic_config_with_ansible, env)
|
||||
|
||||
def test_check_service_vips_migrated_to_service(self):
|
||||
env_reg = {
|
||||
'OS::TripleO::Network::Ports::RedisVipPort': 'val',
|
||||
@ -693,28 +681,6 @@ class TestWaitForStackUtil(TestCase):
|
||||
utils.check_service_vips_migrated_to_service,
|
||||
env)
|
||||
|
||||
def test_check_heat_none_network_config(self):
|
||||
env_reg = {
|
||||
'OS::TripleO::Controller::Net::SoftwareConfig': 'OS::Heat::None',
|
||||
'OS::TripleO::Compute::Net::SoftwareConfig': 'OS::Heat::None',
|
||||
}
|
||||
env = {
|
||||
'resource_registry': env_reg,
|
||||
'parameter_defaults': {'NetworkConfigWithAnsible': True}
|
||||
}
|
||||
utils.check_nic_config_with_ansible(env)
|
||||
|
||||
def test_check_heat_network_config_no_ansible(self):
|
||||
env_reg = {
|
||||
'OS::TripleO::Controller::Net::SoftwareConfig': 'val',
|
||||
'OS::TripleO::Compute::Net::SoftwareConfig': 'val',
|
||||
}
|
||||
env = {
|
||||
'resource_registry': env_reg,
|
||||
'parameter_defaults': {'NetworkConfigWithAnsible': False}
|
||||
}
|
||||
utils.check_nic_config_with_ansible(env)
|
||||
|
||||
def test_check_ceph_fsid_matches_env_files(self):
|
||||
stack_params = {
|
||||
'CephClusterFSID': 'ceph_fsid_val',
|
||||
|
@ -155,7 +155,6 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
|
||||
autospec=True, return_value={})
|
||||
@mock.patch('heatclient.common.template_utils.'
|
||||
'process_environment_and_files', autospec=True)
|
||||
@mock.patch('tripleoclient.utils.check_nic_config_with_ansible')
|
||||
@mock.patch('tripleoclient.utils.get_ctlplane_attrs', autospec=True,
|
||||
return_value={})
|
||||
@mock.patch('tripleoclient.utils.copy_clouds_yaml')
|
||||
@ -180,7 +179,7 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
|
||||
mock_ceph_fsid, mock_swift_rgw,
|
||||
mock_ceph_ansible,
|
||||
mock_get_undercloud_host_entry, mock_copy,
|
||||
mock_get_ctlplane_attrs, mock_nic_ansiblei,
|
||||
mock_get_ctlplane_attrs,
|
||||
mock_process_env, mock_roles_data,
|
||||
mock_container_prepare, mock_generate_password,
|
||||
mock_rc_params, mock_default_image_params,
|
||||
@ -472,7 +471,6 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
|
||||
autospec=True, return_value={})
|
||||
@mock.patch('heatclient.common.template_utils.'
|
||||
'process_environment_and_files', autospec=True)
|
||||
@mock.patch('tripleoclient.utils.check_nic_config_with_ansible')
|
||||
@mock.patch('tripleoclient.utils.copy_clouds_yaml')
|
||||
@mock.patch('tripleoclient.utils.get_undercloud_host_entry', autospec=True,
|
||||
return_value='192.168.0.1 uc.ctlplane.localhost uc.ctlplane')
|
||||
@ -496,7 +494,7 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
|
||||
mock_ceph_fsid, mock_swift_rgw,
|
||||
mock_ceph_ansible,
|
||||
mock_get_undercloud_host_entry,
|
||||
mock_copy, mock_nic_ansible,
|
||||
mock_copy,
|
||||
mock_process_env,
|
||||
mock_roles_data,
|
||||
mock_image_prepare,
|
||||
@ -573,7 +571,6 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
|
||||
@mock.patch('tripleoclient.utils.get_rc_params', autospec=True)
|
||||
@mock.patch('tripleoclient.utils.process_multiple_environments',
|
||||
autospec=True)
|
||||
@mock.patch('tripleoclient.utils.check_nic_config_with_ansible')
|
||||
@mock.patch('tripleoclient.utils.copy_clouds_yaml')
|
||||
@mock.patch('tripleoclient.utils.check_ceph_fsid_matches_env_files')
|
||||
@mock.patch('tripleoclient.utils.check_swift_and_rgw')
|
||||
@ -590,7 +587,7 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
|
||||
mock_update_parameters, mock_post_config,
|
||||
mock_ceph_fsid,
|
||||
mock_swift_rgw, mock_ceph_ansible,
|
||||
mock_copy, mock_nic_ansible,
|
||||
mock_copy,
|
||||
mock_process_env, mock_rc_params,
|
||||
mock_check_service_vip_migr):
|
||||
fixture = deployment.DeploymentWorkflowFixture()
|
||||
@ -795,7 +792,6 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
|
||||
return_value={})
|
||||
@mock.patch('tripleoclient.utils.get_roles_data',
|
||||
autospec=True, return_value={})
|
||||
@mock.patch('tripleoclient.utils.check_nic_config_with_ansible')
|
||||
@mock.patch('tripleoclient.utils.copy_clouds_yaml')
|
||||
@mock.patch('tripleoclient.utils.get_undercloud_host_entry', autospec=True,
|
||||
return_value='192.168.0.1 uc.ctlplane.localhost uc.ctlplane')
|
||||
@ -811,7 +807,7 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
|
||||
mock_ceph_fsid, mock_swift_rgw,
|
||||
mock_ceph_ansible,
|
||||
mock_get_undercloud_host_entry,
|
||||
mock_copy, mock_nic_ansible,
|
||||
mock_copy,
|
||||
mock_roles_data, mock_image_prepare,
|
||||
mock_generate_password, mock_rc_params,
|
||||
mock_check_service_vip_migr,
|
||||
@ -1339,7 +1335,6 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
|
||||
autospec=True, return_value={})
|
||||
@mock.patch('tripleoclient.utils.process_multiple_environments',
|
||||
autospec=True)
|
||||
@mock.patch('tripleoclient.utils.check_nic_config_with_ansible')
|
||||
@mock.patch('tripleoclient.utils.get_ctlplane_attrs', autospec=True,
|
||||
return_value={})
|
||||
@mock.patch('tripleoclient.utils.copy_clouds_yaml')
|
||||
@ -1355,7 +1350,7 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
|
||||
self, mock_hc,
|
||||
mock_ceph_fsid, mock_swift_rgw, mock_ceph_ansible,
|
||||
mock_hd, mock_get_undercloud_host_entry, mock_copy,
|
||||
mock_get_ctlplane_attrs, mock_nic_ansible,
|
||||
mock_get_ctlplane_attrs,
|
||||
mock_process_env, mock_roles_data,
|
||||
mock_container_prepare, mock_generate_password,
|
||||
mock_rc_params, mock_default_image_params,
|
||||
|
@ -1202,22 +1202,6 @@ def check_network_plugin(output_dir, env):
|
||||
raise exceptions.InvalidConfiguration(message)
|
||||
|
||||
|
||||
def check_nic_config_with_ansible(environment):
|
||||
registry = environment.get('resource_registry', {})
|
||||
is_ansible_config = environment.get(
|
||||
'parameter_defaults', {}).get(
|
||||
'NetworkConfigWithAnsible', True)
|
||||
if is_ansible_config:
|
||||
for k, v in registry.items():
|
||||
if k.endswith('Net::SoftwareConfig'):
|
||||
if v != 'OS::Heat::None':
|
||||
raise exceptions.InvalidConfiguration(
|
||||
"DEPRECATED: Old heat nic configs are used, "
|
||||
"Migrate to ansible jinja templates or use "
|
||||
"'NetworkConfigWithAnsible: false' "
|
||||
"in 'parameter_defaults'.")
|
||||
|
||||
|
||||
def check_service_vips_migrated_to_service(environment):
|
||||
registry = environment.get('resource_registry', {})
|
||||
removed_resources = {'OS::TripleO::Network::Ports::RedisVipPort',
|
||||
|
@ -353,8 +353,6 @@ class DeployOvercloud(command.Command):
|
||||
# upgrades: check if swift is deployed
|
||||
utils.check_swift_and_rgw(old_stack_env, env,
|
||||
self.__class__.__name__)
|
||||
# check migration to new nic config with ansible
|
||||
utils.check_nic_config_with_ansible(env)
|
||||
# check migration to service vips managed by servce
|
||||
utils.check_service_vips_migrated_to_service(env)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user