Fix for SLES 11.4, which has now also an /etc/os-release file.

This commit is contained in:
Bernhard Lichtinger 2015-10-26 14:22:21 +01:00
parent 92dd563a75
commit 00ccd2ee6e

View file

@ -418,9 +418,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