container-puppet.py errors if the step config is empty

Bug #1828295 reported by Alex Schultz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
Fix Released
Medium
Alex Schultz

Bug Description

If the step json for container-puppet.py is empty (or null), the deployment execution fails with:

        "Traceback (most recent call last):",
        " File \"/var/lib/container-puppet/container-puppet.py\", line 555, in <module>",
        " for k, v in iter(infile_data.items()):",
        "AttributeError: 'NoneType' object has no attribute 'items'"

We should check the contents of the json parse to ensure it's not None prior to trying to consume it.

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

Fix proposed to branch: master
Review: https://review.opendev.org/657885

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

Reviewed: https://review.opendev.org/657885
Committed: https://git.openstack.org/cgit/openstack/tripleo-heat-templates/commit/?id=055d15f9288f7c49670c47e847ead564d8b2d5de
Submitter: Zuul
Branch: master

commit 055d15f9288f7c49670c47e847ead564d8b2d5de
Author: Alex Schultz <email address hidden>
Date: Wed May 8 14:33:06 2019 -0600

    Gracefully handle empty config json data

    If the json config data is set to Null, the current code throws an error
    because we attempt to use .items() on the parsed result. We should just
    treat and empty file as an empty dict so the code properly continues.

    Change-Id: I02bb2ce5359aeec1e600b0c0f04fb72c7a335407
    Closes-Bug: #1828295

Changed in tripleo:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-heat-templates (stable/stein)

Fix proposed to branch: stable/stein
Review: https://review.opendev.org/658291

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

Reviewed: https://review.opendev.org/658291
Committed: https://git.openstack.org/cgit/openstack/tripleo-heat-templates/commit/?id=039ce1c3caf4ee7ff0160c6fceb60e0ed8d444d1
Submitter: Zuul
Branch: stable/stein

commit 039ce1c3caf4ee7ff0160c6fceb60e0ed8d444d1
Author: Alex Schultz <email address hidden>
Date: Wed May 8 14:33:06 2019 -0600

    Gracefully handle empty config json data

    If the json config data is set to Null, the current code throws an error
    because we attempt to use .items() on the parsed result. We should just
    treat and empty file as an empty dict so the code properly continues.

    Change-Id: I02bb2ce5359aeec1e600b0c0f04fb72c7a335407
    Closes-Bug: #1828295
    (cherry picked from commit 055d15f9288f7c49670c47e847ead564d8b2d5de)

tags: added: in-stable-stein
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tripleo-heat-templates 11.0.0

This issue was fixed in the openstack/tripleo-heat-templates 11.0.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tripleo-heat-templates 10.6.0

This issue was fixed in the openstack/tripleo-heat-templates 10.6.0 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.