Enable facts module on older SuSE systems
Modified logic of distribution_release for SuSE to retain the last discovered key/value pair's value in /etc/SuSE-release that contains a '=' character.
This commit is contained in:
parent
1576e8d611
commit
424ee36e05
1 changed files with 3 additions and 1 deletions
|
@ -303,7 +303,9 @@ class Facts(object):
|
||||||
self.facts['distribution_release'] = ora_prefix + data
|
self.facts['distribution_release'] = ora_prefix + data
|
||||||
elif name == 'SuSE':
|
elif name == 'SuSE':
|
||||||
data = get_file_content(path).splitlines()
|
data = get_file_content(path).splitlines()
|
||||||
self.facts['distribution_release'] = data[2].split('=')[1].strip()
|
for line in data:
|
||||||
|
if '=' in line:
|
||||||
|
self.facts['distribution_release'] = line.split('=')[1].strip()
|
||||||
elif name == 'Debian':
|
elif name == 'Debian':
|
||||||
data = get_file_content(path).split('\n')[0]
|
data = get_file_content(path).split('\n')[0]
|
||||||
release = re.search("PRETTY_NAME.+ \(?([^ ]+?)\)?\"", data)
|
release = re.search("PRETTY_NAME.+ \(?([^ ]+?)\)?\"", data)
|
||||||
|
|
Loading…
Reference in a new issue