From 6cdae2f901e3329f6c5f66f78558101da596507b Mon Sep 17 00:00:00 2001 From: Steve Baker Date: Wed, 21 Oct 2015 16:22:15 +1300 Subject: [PATCH] Include registry on update when other envs are specified On an openstack overcloud deploy which results in a stack-update, implicitly include overcloud-resource-registry-puppet.yaml if the user specifies any other custom environments. Do not include overcloud-resource-registry-puppet.yaml if the user specifies no extra environments. This solution would be an improvement over the current situation, but it isn't perfect. It does the right thing when: - the user does an openstack overcloud with no environments specified - the user does an openstack overcloud with all custom environments specified It will sometimes do the wrong thing when: - the user specifies a partial list of custom environments (like -e do_my_custom_oneoff_thing.yaml) Change-Id: I60fbf2182429f6bb83e000fc4d45269d7f83171b Related-Bug: #1498607 Closes-Bug: #1504363 --- tripleoclient/v1/overcloud_deploy.py | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/tripleoclient/v1/overcloud_deploy.py b/tripleoclient/v1/overcloud_deploy.py index 8f2cf6494..d24ff5980 100644 --- a/tripleoclient/v1/overcloud_deploy.py +++ b/tripleoclient/v1/overcloud_deploy.py @@ -306,23 +306,31 @@ class DeployOvercloud(command.Command): # parameters and keystone cert is generated on create only env_path = utils.create_environment_file() environments = [] + add_registry = False if stack is None: self.log.debug("Creating Keystone certificates") keystone_pki.generate_certs_into_json(env_path, False) - # default resource registry file should be passed only - # when creating a new stack, otherwise it might overwrite - # resource_registries in existing stack - resource_registry_path = os.path.join( - tht_root, constants.RESOURCE_REGISTRY_NAME) - environments.extend([resource_registry_path, env_path]) + environments.append(env_path) + add_registry = True environments.extend(self._create_parameters_env(parameters)) if parsed_args.rhel_reg: reg_env = self._create_registration_env(parsed_args) environments.extend(reg_env) + add_registry = True if parsed_args.environment_files: environments.extend(parsed_args.environment_files) + add_registry = True + + if add_registry: + # default resource registry file should be passed only + # when creating a new stack, or when custom environments are + # specified, otherwise it might overwrite + # resource_registries in existing stack + resource_registry_path = os.path.join( + tht_root, constants.RESOURCE_REGISTRY_NAME) + environments.insert(0, resource_registry_path) overcloud_yaml = os.path.join(tht_root, constants.OVERCLOUD_YAML_NAME)