Grains return wrong OS version and other OS related values for Oracle Linux

OEL contains space characters at the end of some lines. The current regular expression doesn't expect that. This causes various issues especially for "service" module which doesn't work on OEL.
This commit is contained in:
Galet, Michal 2015-12-04 17:55:15 +01:00
parent ab890b632a
commit c494ddd5fc

View file

@ -1028,7 +1028,7 @@ def _parse_os_release():
data = dict()
with salt.utils.fopen(filename) as ifile:
regex = re.compile('^([\\w]+)=(?:\'|")?(.*?)(?:\'|")?$')
regex = re.compile('^([\\w]+)=(?:\'|")?(.*?)(?:\'|")?\\s*$')
for line in ifile:
match = regex.match(line.strip('\n'))
if match: