Merge "Remove the environments from Mistral when removing from Swift"

This commit is contained in:
Jenkins 2016-09-19 13:41:27 +00:00 committed by Gerrit Code Review
commit e7af1094d2
2 changed files with 16 additions and 0 deletions

View File

@ -326,6 +326,10 @@ class DeployOvercloud(command.Command):
contents = yaml.safe_dump(env)
# Until we have a well defined plan update workflow in tripleo-common
# we need to manually add an environment in swift and mistral for users
# custom environments passed to the deploy command.
# See bug: https://bugs.launchpad.net/tripleo/+bug/1623431
swift_path = "user-environment.yaml"
swift_client.put_object(container_name, swift_path, contents)

View File

@ -119,6 +119,18 @@ def update_plan_from_templates(clients, name, tht_root):
for object_ in objects:
swift_client.delete_object(name, object_['name'])
# Until we have a well defined plan update workflow in tripleo-common we
# need to manually reset the environments here. This is to ensure that
# no environments are in the mistral environment but not in swift.
# See bug: https://bugs.launchpad.net/tripleo/+bug/1623431
mistral = clients.workflow_engine
mistral_env = mistral.environments.get(name)
mistral_env.variables['environments'] = []
mistral.environments.update(
name=name,
variables=mistral_env.variables
)
print("Uploading new plan files")
_upload_templates(swift_client, name, tht_root)
update_deployment_plan(clients, container=name,