mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 00:55:19 +00:00
Fix systctl parsing on no space separator
This commit is contained in:
parent
593f86df51
commit
e6af7cde9d
@ -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')
|
||||
|
Loading…
Reference in New Issue
Block a user