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:
Justin Findlay 2015-08-14 15:21:13 -06:00
commit 2184ac1f81

View File

@ -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