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)
Reviewed: https:/ /review. opendev. org/708450 /git.openstack. org/cgit/ openstack/ python- tripleoclient/ commit/ ?id=5e40c707931 948029d725df546 9ffff108509c19
Committed: https:/
Submitter: Zuul
Branch: stable/train
commit 5e40c7079319480 29d725df5469fff f108509c19
Author: Jose Luis Franco Arza <email address hidden>
Date: Mon Feb 17 14:50:00 2020 +0100
Remove extra whitespaces from getent.
The UndercloudHosts Entries heat parameter gets its value set from the short_hostname> .ctrlplane. However, 0.ctlplane 0.ctlplane. redhat. local undercloud- 0.ctlplane
execution of getent hosts <undercloud_
the execution of getent return extra 4 whitespaces between the IP and the
hostname:
(undercloud) [stack@undercloud-0 ~]$ getent hosts undercloud-
192.168.24.1 undercloud-
This four spaces enter in conflict with the entries at /etc/hosts if we 0.ctlplane (with a single space only) 0.ctlplane.
want to use lineinfile to update the content. As it /ect/hosts already
includes an entry for the undercloud-
the Ansible module will consider that the line isn't present and we will
end up with two entries for the undercloud-
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: Ibb51d5970f993b 13a9684173704f6 4b98d81aae2 94aa4843e57b513 ff1ab7012e)
Related-Bug: #1863598
(cherry picked from commit 70d9d309cec524f