Merge pull request #20368 from kaithar/feature/smarter-value-extraction

Make the value extraction a little smarter.
This commit is contained in:
Joseph Hall 2015-02-05 12:41:24 -07:00
commit aee80341b7

View File

@ -185,7 +185,12 @@ def get_var(var):
conf_file = fn_.readlines()
for line in conf_file:
if line.startswith(var):
ret = line.split('=', 1)[1].replace('"', '')
ret = line.split('=', 1)[1]
if '"' in ret:
ret = ret.split('"')[1]
elif '#' in ret:
ret = ret.split('#')[0]
ret = ret.strip()
return ret
return None