Enforce upgrade_batch_tasks before upgrade_tasks order

If we really want upgrade_batch_tasks before the upgrade_tasks
as described in the README then we should enforce the ordering

Noticed this working on bug 1671504 upgrade tasks were being
executed before batch upgrade tasks.

Closes-Bug: 1678101
Change-Id: Iaa1bce960a37c072b5f8441132705a6bb6eb6ede
This commit is contained in:
marios 2017-03-22 16:09:22 +02:00 committed by Marios Andreou
parent d286892c78
commit 299b9f5323
1 changed files with 12 additions and 19 deletions

View File

@ -32,15 +32,6 @@ parameters:
type: string
hidden: true
conditions:
# Conditions to disable any steps where the task list is empty
{%- for role in roles %}
{{role.name}}UpgradeBatchConfigEnabled:
not:
equals:
- {get_param: [role_data, {{role.name}}, upgrade_batch_tasks]}
- []
{%- endfor %}
resources:
@ -98,12 +89,11 @@ resources:
{{role.name}}UpgradeBatchConfig_Step{{step}}:
type: OS::TripleO::UpgradeConfig
{%- if step > 0 %}
condition: {{role.name}}UpgradeBatchConfigEnabled
{% if role.name in enabled_roles %}
{%- if role in enabled_roles %}
depends_on:
- {{role.name}}UpgradeBatch_Step{{step -1}}
{%- endif %}
{% else %}
{%- else %}
{% for role in roles if role.disable_upgrade_deployment|default(false) %}
{% if deliver_script.update({'deliver': True}) %} {% endif %}
{% endfor %}
@ -123,13 +113,11 @@ resources:
{%- for role in enabled_roles %}
{{role.name}}UpgradeBatch_Step{{step}}:
type: OS::Heat::SoftwareDeploymentGroup
condition: {{role.name}}UpgradeBatchConfigEnabled
{%- if step > 0 %}
depends_on:
- {{role.name}}UpgradeBatch_Step{{step -1}}
{% else %}
depends_on:
- {{role.name}}UpgradeBatchConfig_Step{{step}}
{%- for role_inside in enabled_roles %}
- {{role_inside.name}}UpgradeBatch_Step{{step -1}}
{%- endfor %}
{%- endif %}
update_policy:
batch_create:
@ -183,10 +171,10 @@ resources:
# do, and there should be minimal performance hit (creating the
# config is cheap compared to the time to apply the deployment).
{%- if step > 0 %}
{% if role.name in enabled_roles %}
{%- if role in enabled_roles %}
depends_on:
- {{role.name}}Upgrade_Step{{step -1}}
{% endif %}
{%- endif %}
{%- endif %}
properties:
UpgradeStepConfig: {get_param: [role_data, {{role.name}}, upgrade_tasks]}
@ -205,6 +193,11 @@ resources:
{%- for role_inside in enabled_roles %}
- {{role_inside.name}}Upgrade_Step{{step -1}}
{%- endfor %}
{%- else %}
depends_on:
{%- for role_inside in enabled_roles %}
- {{role_inside.name}}UpgradeBatch_Step{{batch_upgrade_steps_max -1}}
{%- endfor %}
{%- endif %}
properties:
name: {{role.name}}Upgrade_Step{{step}}