config-download: missing deployment_name in group_vars for ExtraConfigPost, PreConfig, PostConfig

Bug #1755078 reported by zenghui.shi
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
Fix Released
Medium
Mike Fedosin

Bug Description

deployment_name should be set via the name property on the
Deployment resources in the templates, however, if it's None,
it will be defaulted to the name of the parent_resource.
for resources such as ExtraConfigPost, PreConfig, PostConfig,
there is no default parent resource name which means the
generated ansible group_vars will be an empty string if custom
templates don't contain a name property; this in turn will
cause syntax error when executing ansible playbooks.

note: the customized templates can be forced to include a name
property in order to solve above problem, but it worked without
having a name property before, would be good to fix it in the
parent resource in heat templates or tripleo-common.

Changed in tripleo:
milestone: none → rocky-1
status: New → Triaged
Changed in tripleo:
importance: Undecided → Medium
tags: added: config-download
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to tripleo-common (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/552274

Mike Fedosin (mfedosin)
Changed in tripleo:
assignee: nobody → Mike Fedosin (mfedosin)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to tripleo-common (master)

Reviewed: https://review.openstack.org/552274
Committed: https://git.openstack.org/cgit/openstack/tripleo-common/commit/?id=204947c9084f9b85d7377e389a2500da48cdf2d8
Submitter: Zuul
Branch: master

commit 204947c9084f9b85d7377e389a2500da48cdf2d8
Author: Zenghui Shi <email address hidden>
Date: Tue Mar 13 12:14:59 2018 +0800

    Defaults to parent_resource name correctly

    When name attribute of deployment is an empty
    string, dict.get will return that empty string
    instead of returning the default value set in
    the second param of dict.get(first, second).
    This patch fixes it by returning the default
    value.

    Change-Id: I7b48414fd18e01594f6d9b0d106c2abb71b7f676
    Related-Bug: #1755078

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-common (master)

Fix proposed to branch: master
Review: https://review.openstack.org/554614

Changed in tripleo:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-common (master)

Reviewed: https://review.openstack.org/554614
Committed: https://git.openstack.org/cgit/openstack/tripleo-common/commit/?id=3fd4f24e90a2686f20472a78d59b4ce1963cdb62
Submitter: Zuul
Branch: master

commit 3fd4f24e90a2686f20472a78d59b4ce1963cdb62
Author: Mike Fedosin <email address hidden>
Date: Tue Mar 20 16:59:39 2018 +0100

    Raise an error if deployment_name cannot be determined

    Parameter deployment_name should be set via the name property on
    the Deployment resources in the templates, however, if it's None,
    it will be defaulted to the name of the parent_resource.
    for resources such as ExtraConfigPost, PreConfig, PostConfig,
    there is no default parent resource name which means the
    generated ansible group_vars will be an empty string if custom
    templates don't contain a name property; this in turn will
    cause syntax error when executing ansible playbooks.

    This code prevents such situations and raises an error if
    the value cannpt be determined.

    Change-Id: Ibe884331b5fb9269b796a13beb489e91aeca71ed
    Closes-bug: #1755078

Changed in tripleo:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to tripleo-common (stable/queens)

Related fix proposed to branch: stable/queens
Review: https://review.openstack.org/558845

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to tripleo-common (stable/queens)

Reviewed: https://review.openstack.org/558845
Committed: https://git.openstack.org/cgit/openstack/tripleo-common/commit/?id=2dd6d146c7dd5d983a349fe2d323b25271588cdb
Submitter: Zuul
Branch: stable/queens

commit 2dd6d146c7dd5d983a349fe2d323b25271588cdb
Author: Zenghui Shi <email address hidden>
Date: Tue Mar 13 12:14:59 2018 +0800

    Defaults to parent_resource name correctly

    When name attribute of deployment is an empty
    string, dict.get will return that empty string
    instead of returning the default value set in
    the second param of dict.get(first, second).
    This patch fixes it by returning the default
    value.

    Change-Id: I7b48414fd18e01594f6d9b0d106c2abb71b7f676
    Related-Bug: #1755078
    (cherry picked from commit 204947c9084f9b85d7377e389a2500da48cdf2d8)

tags: added: in-stable-queens
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to tripleo-common (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/560110

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tripleo-common 9.0.0

This issue was fixed in the openstack/tripleo-common 9.0.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on tripleo-common (master)

Change abandoned by Lukas Bezdicka (<email address hidden>) on branch: master
Review: https://review.openstack.org/560110
Reason: https://review.openstack.org/#/c/561943

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to tripleo-common (stable/queens)

Related fix proposed to branch: stable/queens
Review: https://review.openstack.org/567249

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on tripleo-common (stable/queens)

Change abandoned by Alex Schultz (<email address hidden>) on branch: stable/queens
Review: https://review.openstack.org/567249
Reason: abandoning to clear gate for Bug 1770355. Will restore after fix lands.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to tripleo-common (stable/queens)

Reviewed: https://review.openstack.org/567249
Committed: https://git.openstack.org/cgit/openstack/tripleo-common/commit/?id=091e603ef97ff18e0a0ca7964d05f5c8970758aa
Submitter: Zuul
Branch: stable/queens

commit 091e603ef97ff18e0a0ca7964d05f5c8970758aa
Author: Thomas Herve <email address hidden>
Date: Tue Apr 17 15:32:37 2018 +0200

    Find deployment name in config download

    In some cases we get a ResourceGroup as parent resource of a deployment,
    so the name will be a number. Ansible will be unhappy with that, so
    let's get the grand parent to get the proper name.

    Related-Bug: #1755078
    (cherry picked from commit 635f6a4374b35489084131d62b88e7272b987bb3)
    Change-Id: Icc64b32a2179cd10853a54a83bf82a1761297ebd

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-common (stable/queens)

Fix proposed to branch: stable/queens
Review: https://review.opendev.org/682067

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on tripleo-common (stable/queens)

Change abandoned by Emilien Macchi (<email address hidden>) on branch: stable/queens
Review: https://review.opendev.org/682067
Reason: We are facing gate issue: https://bugs.launchpad.net/tripleo/+bug/1844446

To clear the gate we need to abandon this patch and I will restore once the gate is ready again to land patches in TripleO. Please don't touch this patch, and ask on #tripleo Wes or Emilien for any question. Thanks for your patience.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-common (stable/queens)

Reviewed: https://review.opendev.org/682067
Committed: https://git.openstack.org/cgit/openstack/tripleo-common/commit/?id=3b0f8cf289fe433fc58a940ee97ac64cc9bd3c45
Submitter: Zuul
Branch: stable/queens

commit 3b0f8cf289fe433fc58a940ee97ac64cc9bd3c45
Author: Mike Fedosin <email address hidden>
Date: Tue Mar 20 16:59:39 2018 +0100

    Raise an error if deployment_name cannot be determined

    Parameter deployment_name should be set via the name property on
    the Deployment resources in the templates, however, if it's None,
    it will be defaulted to the name of the parent_resource.
    for resources such as ExtraConfigPost, PreConfig, PostConfig,
    there is no default parent resource name which means the
    generated ansible group_vars will be an empty string if custom
    templates don't contain a name property; this in turn will
    cause syntax error when executing ansible playbooks.

    This code prevents such situations and raises an error if
    the value cannpt be determined.

    Change-Id: Ibe884331b5fb9269b796a13beb489e91aeca71ed
    Closes-bug: #1755078
    (cherry picked from commit 3fd4f24e90a2686f20472a78d59b4ce1963cdb62)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tripleo-common queens-eol

This issue was fixed in the openstack/tripleo-common queens-eol release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.