From b85d8d69a0fc652f2b7916efa3fb9f042a0f6d56 Mon Sep 17 00:00:00 2001 From: Jiri Stransky Date: Fri, 24 Apr 2015 13:15:58 +0200 Subject: [PATCH] Downcase /etc/hosts entries The entries received from Heat are based on Heat names of OS::Nova::Server resources, which can contain uppercase letters. However the hostnames set by Nova are lowercase. This can make the actual hostname differ from entries in /etc/hosts, which can make the output of `hostname -f` differ from `facter fqdn`, which can cause failed Puppet runs. This patch makes sure that the /etc/hosts entries that Heat adds are lowercase. Change-Id: Iec5b6450c5730c081c8f2ca4d6c9786b956c87d5 Partial-Bug: #1447497 --- elements/hosts/os-refresh-config/configure.d/51-hosts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/elements/hosts/os-refresh-config/configure.d/51-hosts b/elements/hosts/os-refresh-config/configure.d/51-hosts index c463de671..9e6b72544 100755 --- a/elements/hosts/os-refresh-config/configure.d/51-hosts +++ b/elements/hosts/os-refresh-config/configure.d/51-hosts @@ -30,7 +30,7 @@ write_entries() { } -ENTRIES=$(os-apply-config --key hosts --type raw --key-default '') +ENTRIES=$(os-apply-config --key hosts --type raw --key-default '' | tr '[A-Z]' '[a-z]') if [ ! -z "$ENTRIES" ]; then # cloud-init files are /etc/cloud/templates/hosts.OSNAME.tmpl DIST=$(lsb_release -is | tr -s [A-Z] [a-z])