diff --git a/tripleoclient/tests/test_utils.py b/tripleoclient/tests/test_utils.py index 14c6ba61d..d4b5664d2 100644 --- a/tripleoclient/tests/test_utils.py +++ b/tripleoclient/tests/test_utils.py @@ -2277,3 +2277,21 @@ class TestProhibitedOverrides(base.TestCommand): self.assertIsNone( utils.check_prohibited_overrides(protected_overrides, [(user_env, user_env)])) + + def test_check_neutron_resources(self): + resource_registry = { + "a": "A", + "neutron": "OS::Neutron::Port" + } + environment = dict(resource_registry=resource_registry) + self.assertRaises( + exceptions.InvalidConfiguration, + utils.check_neutron_resources, + environment) + resource_registry["neutron"] = "OS::Neutron::Network" + self.assertRaises( + exceptions.InvalidConfiguration, + utils.check_neutron_resources, + environment) + resource_registry.pop("neutron") + self.assertIsNone(utils.check_neutron_resources(environment)) diff --git a/tripleoclient/utils.py b/tripleoclient/utils.py index 047a86e16..9b8e10bd3 100644 --- a/tripleoclient/utils.py +++ b/tripleoclient/utils.py @@ -1193,6 +1193,20 @@ def check_service_vips_migrated_to_service(stack, environment): raise exceptions.InvalidConfiguration(msg) +def check_neutron_resources(environment): + registry = environment.get('resource_registry', {}) + msg = ("Resource {} maps to type {} and the Neutron " + "service is not available when using ephemeral Heat. " + "The generated environments from " + "'openstack overcloud baremetal provision' and " + "'openstack overcloud network provision' must be included " + "with the deployment command.") + for rsrc, rsrc_type in registry.items(): + if (type(rsrc_type) == str and + rsrc_type.startswith("OS::Neutron")): + raise exceptions.InvalidConfiguration(msg.format(rsrc, rsrc_type)) + + def check_stack_network_matches_env_files(stack, environment): """Check stack against proposed env files to ensure non-breaking change diff --git a/tripleoclient/v1/overcloud_deploy.py b/tripleoclient/v1/overcloud_deploy.py index 2a93e91b6..d0fbe53aa 100644 --- a/tripleoclient/v1/overcloud_deploy.py +++ b/tripleoclient/v1/overcloud_deploy.py @@ -391,6 +391,8 @@ class DeployOvercloud(command.Command): utils.check_nic_config_with_ansible(stack, env) # check migration to service vips managed by servce utils.check_service_vips_migrated_to_service(stack, env) + if parsed_args.heat_type != 'installed': + utils.check_neutron_resources(env) self._try_overcloud_deploy_with_compat_yaml( new_tht_root, stack,