Merge "Check for neutron resources with ephemeral Heat"

This commit is contained in:
Zuul 2021-08-20 06:56:01 +00:00 committed by Gerrit Code Review
commit 14c027ae58
3 changed files with 34 additions and 0 deletions

View File

@ -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))

View File

@ -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

View File

@ -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,