Merge "Add upload plan-environment action for update and upgrade"

This commit is contained in:
Zuul 2018-02-13 10:52:50 +00:00 committed by Gerrit Code Review
commit 071307c460
4 changed files with 25 additions and 8 deletions

View File

@ -125,6 +125,7 @@ mistral.actions =
tripleo.swift.swift_information = tripleo_common.actions.swifthelper:SwiftInformationAction
tripleo.templates.process = tripleo_common.actions.templates:ProcessTemplatesAction
tripleo.templates.upload = tripleo_common.actions.templates:UploadTemplatesAction
tripleo.templates.upload_plan_environment = tripleo_common.actions.templates:UploadPlanEnvironmentAction
tripleo.validations.check_boot_images = tripleo_common.actions.validations:CheckBootImagesAction
tripleo.validations.check_flavors = tripleo_common.actions.validations:CheckFlavorsAction
tripleo.validations.check_node_boot_configuration = tripleo_common.actions.validations:CheckNodeBootConfigurationAction

View File

@ -94,6 +94,21 @@ class UploadTemplatesAction(base.TripleOAction):
self.container)
class UploadPlanEnvironmentAction(base.TripleOAction):
"""Upload the plan environment into swift"""
def __init__(self, plan_environment,
container=constants.DEFAULT_CONTAINER_NAME):
super(UploadPlanEnvironmentAction, self).__init__()
self.container = container
self.plan_environment = plan_environment
def run(self, context):
# Get object client
swift = self.get_object_client(context)
# Push plan environment to the swift container
plan_utils.put_env(swift, self.plan_environment)
class ProcessTemplatesAction(base.TripleOAction):
"""Process Templates and Environments

View File

@ -22,15 +22,8 @@ workflows:
- tripleo-common-managed
tasks:
update_plan:
action: tripleo.plan.update_from_dir
input:
container: <% $.container %>
on-success: update
on-error: set_update_failed
update:
action: tripleo.package_update.update_stack container=<% $.container %> timeout=<% $.timeout %> container_registry=<% $.container_registry %> ceph_ansible_playbook=<% $.ceph_ansible_playbook %>
action: tripleo.package_update.update_stack
input:
timeout: <% $.timeout %>
container: <% $.container %>

View File

@ -218,6 +218,7 @@ workflows:
- source_url: null
- queue_name: tripleo
- generate_passwords: true
- plan_environment: null
tags:
- tripleo-common-managed
tasks:
@ -268,6 +269,13 @@ workflows:
process_templates:
action: tripleo.templates.process container=<% $.container %>
on-success:
- set_status_success: <% $.plan_environment = null %>
- upload_plan_environment: <% $.plan_environment != null %>
on-error: process_templates_set_status_failed
upload_plan_environment:
action: tripleo.templates.upload_plan_environment container=<% $.container %> plan_environment=<% $.plan_environment %>
on-success: set_status_success
on-error: process_templates_set_status_failed