mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
Merge pull request #26331 from mnalt/fix_sysrc_empty_variables
fix bug in sysrc to allow for empty rc variables
This commit is contained in:
commit
2184ac1f81
@ -60,9 +60,14 @@ def get(**kwargs):
|
||||
|
||||
ret = {}
|
||||
for sysrc in sysrcs.split("\n"):
|
||||
rcfile = sysrc.split(': ')[0]
|
||||
var = sysrc.split(': ')[1]
|
||||
val = sysrc.split(': ')[2]
|
||||
line_components = sysrc.split(': ')
|
||||
rcfile = line_components[0]
|
||||
if len(line_components) > 2:
|
||||
var = line_components[1]
|
||||
val = line_components[2]
|
||||
else:
|
||||
var = line_components[1].rstrip(':')
|
||||
val = ''
|
||||
if rcfile not in ret:
|
||||
ret[rcfile] = {}
|
||||
ret[rcfile][var] = val
|
||||
|
Loading…
Reference in New Issue
Block a user