Comment 6 for bug 1863598

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to python-tripleoclient (stable/train)

Reviewed: https://review.opendev.org/708450
Committed: https://git.openstack.org/cgit/openstack/python-tripleoclient/commit/?id=5e40c707931948029d725df5469ffff108509c19
Submitter: Zuul
Branch: stable/train

commit 5e40c707931948029d725df5469ffff108509c19
Author: Jose Luis Franco Arza <email address hidden>
Date: Mon Feb 17 14:50:00 2020 +0100

    Remove extra whitespaces from getent.

    The UndercloudHostsEntries heat parameter gets its value set from the
    execution of getent hosts <undercloud_short_hostname>.ctrlplane. However,
    the execution of getent return extra 4 whitespaces between the IP and the
    hostname:
    (undercloud) [stack@undercloud-0 ~]$ getent hosts undercloud-0.ctlplane
    192.168.24.1 undercloud-0.ctlplane.redhat.local undercloud-0.ctlplane

    This four spaces enter in conflict with the entries at /etc/hosts if we
    want to use lineinfile to update the content. As it /ect/hosts already
    includes an entry for the undercloud-0.ctlplane (with a single space only)
    the Ansible module will consider that the line isn't present and we will
    end up with two entries for the undercloud-0.ctlplane.

    Also, the process.communicate() output return is in bytes, so in order
    to handle a string for the replacement this patch casts the output into
    string.

    Change-Id: Ibb51d5970f993b13a9684173704f64b98d81aae2
    Related-Bug: #1863598
    (cherry picked from commit 70d9d309cec524f94aa4843e57b513ff1ab7012e)