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
This commit is contained in:
Jiri Stransky 2015-04-24 13:15:58 +02:00
parent 1714eea73a
commit b85d8d69a0
1 changed files with 1 additions and 1 deletions

View File

@ -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])