Comment 14 for bug 1790447

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

Reviewed: https://review.openstack.org/629178
Committed: https://git.openstack.org/cgit/openstack/tripleo-heat-templates/commit/?id=9d4dce3cea557c149dca98a2e1608ce73f42c1c8
Submitter: Zuul
Branch: stable/rocky

commit 9d4dce3cea557c149dca98a2e1608ce73f42c1c8
Author: Tony Breeds <email address hidden>
Date: Tue Jan 8 20:58:21 2019 +1100

    Do not dereference .stdout if dmidecode is missing

    In 459b2664d99befa452e1946a4e4cf400183dd9e3 (Handle missing or bad
    dmidecode) we accept return values of 0, 1 or 2 from command modules
    that call 'dmidecode'. However we then unconditionally look at the
    stdout key in the result object. When the dmidecode binary is missing
    the result dictionary from the command module doesn't contain a stdout
    key (resulting in something like):

    ---
    fatal: [overcloud-novacomputeppc64le-1]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'dict object' has no attribute 'stdout'\n\nThe error appears to have been in '/var/lib/mistral/overcloud/ceph-ansible/nodes_uuid_playbook.yml': line 14, column 7, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n failed_when: machine_uuid.rc not in [0, 1, 2]\n - name: generate host vars from nodes data\n ^ here\n"}
    ---

    This change just adds a default('') filter to the lookup so a missing
    key will fallback to an empty dictionary

    Closes-Bug: 1790447
    Change-Id: I7db180674c3696508a7f449e2e825e7083a00f6e
    (cherry picked from commit f9b5401c1f478084031543d8c9f016068935596b)