Merge pull request #12909 from photoninger/sles11.4-fix_2nd_try

Fix for SLES 11.4, which has now also an /etc/os-release file.
This commit is contained in:
Toshio Kuratomi 2016-01-29 09:11:51 -08:00
commit 315fd15f69

View file

@ -438,9 +438,9 @@ class Facts(object):
release = re.search("^PRETTY_NAME=[^(]+ \(?([^)]+?)\)", line)
if release:
self.facts['distribution_release'] = release.groups()[0]
elif 'enterprise' in data.lower():
elif 'enterprise' in data.lower() and 'VERSION_ID' in line:
release = re.search('^VERSION_ID="?[0-9]+\.?([0-9]*)"?', line) # SLES doesn't got funny release names
if release:
if release.group(1):
release = release.group(1)
else:
release = "0" # no minor number, so it is the first release