Fix systctl parsing on no space separator

This commit is contained in:
Mathieu Le Marec - Pasquet 2014-06-11 20:36:52 +02:00
parent 593f86df51
commit e6af7cde9d

View File

@ -85,7 +85,13 @@ def show(config_file=False):
try:
for line in salt.utils.fopen(config_file_path):
if not line.startswith('#') and '=' in line:
key, value = line.split(' = ', 1)
# search if we have some '=' instead of ' = ' separators
SPLIT = ' = '
if SPLIT not in line:
SPLIT = SPLIT.strip()
key, value = line.split(SPLIT, 1)
key = key.strip()
value = value.lstrip()
ret[key] = value
except OSError:
log.error('Could not open sysctl file')