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

Updating based on feedback - strip all whitespace characters instead of updating the regex
This commit is contained in:
Galet, Michal 2015-12-04 21:17:05 +01:00
parent c494ddd5fc
commit fdaa81ccf8

View file

@ -1028,9 +1028,9 @@ def _parse_os_release():
data = dict()
with salt.utils.fopen(filename) as ifile:
regex = re.compile('^([\\w]+)=(?:\'|")?(.*?)(?:\'|")?\\s*$')
regex = re.compile('^([\\w]+)=(?:\'|")?(.*?)(?:\'|")?$')
for line in ifile:
match = regex.match(line.strip('\n'))
match = regex.match(line.strip())
if match:
# Shell special characters ("$", quotes, backslash, backtick)
# are escaped with backslashes