Remove the environments from Mistral when removing from Swift

When the new filesa re re-created the environments will be re-added
based on the capabilities map and the users choices.

Partial-Bug: #1622683
Depends-On: Ia014d85d7e601d436ae9267df5988f4a6e962574
Change-Id: I1e1d6634663bf38fd21cb5f10f1422294321c5aa
This commit is contained in:
Dougal Matthews 2016-09-13 14:25:22 +00:00
parent c0f79d4477
commit a7b2e5eb05
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

@ -117,6 +117,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,