Merge pull request #15230 from someword/15228

Only set distribution_release on CoreOS nodes that autoupdate.  Fixes…
This commit is contained in:
Brian Coca 2016-03-31 17:46:52 -04:00
commit 3b5d7400de

View file

@ -493,9 +493,10 @@ class Facts(object):
if self.facts['distribution'].lower() == 'coreos':
data = get_file_content('/etc/coreos/update.conf')
release = re.search("^GROUP=(.*)", data)
if release:
self.facts['distribution_release'] = release.group(1).strip('"')
if data:
release = re.search("^GROUP=(.*)", data)
if release:
self.facts['distribution_release'] = release.group(1).strip('"')
else:
self.facts['distribution'] = name
machine_id = get_file_content("/var/lib/dbus/machine-id") or get_file_content("/etc/machine-id")