mirror of
https://github.com/valitydev/salt.git
synced 2024-11-09 01:36:48 +00:00
Merge pull request #20368 from kaithar/feature/smarter-value-extraction
Make the value extraction a little smarter.
This commit is contained in:
commit
aee80341b7
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user