save_order, save: config option is not always a string
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
parent
bddca0c62c
commit
74abc59dca
2 changed files with 5 additions and 3 deletions
|
@ -447,7 +447,7 @@ class Config(RawConfigParser):
|
||||||
RawConfigParser.set(self, section, option, value)
|
RawConfigParser.set(self, section, option, value)
|
||||||
if not self.write_in_file(section, option, value):
|
if not self.write_in_file(section, option, value):
|
||||||
return ('Unable to write in the config file', 'Error')
|
return ('Unable to write in the config file', 'Error')
|
||||||
if 'password' in option and 'eval_password' not in option:
|
if isinstance(option, str) and 'password' in option and 'eval_password' not in option:
|
||||||
value = '********'
|
value = '********'
|
||||||
return ("%s=%s" % (option, value), 'Info')
|
return ("%s=%s" % (option, value), 'Info')
|
||||||
|
|
||||||
|
|
|
@ -614,7 +614,8 @@ class CommandCore:
|
||||||
theme.COLOR_INFORMATION_TEXT),
|
theme.COLOR_INFORMATION_TEXT),
|
||||||
})
|
})
|
||||||
for option_name, option_value in section.items():
|
for option_name, option_value in section.items():
|
||||||
if 'password' in option_name and 'eval_password' not in option_name:
|
if isinstance(option_name, str) and \
|
||||||
|
'password' in option_name and 'eval_password' not in option_name:
|
||||||
option_value = '********'
|
option_value = '********'
|
||||||
lines.append(
|
lines.append(
|
||||||
'%s\x19%s}=\x19o%s' %
|
'%s\x19%s}=\x19o%s' %
|
||||||
|
@ -624,7 +625,8 @@ class CommandCore:
|
||||||
elif len(args) == 1:
|
elif len(args) == 1:
|
||||||
option = args[0]
|
option = args[0]
|
||||||
value = config.get(option)
|
value = config.get(option)
|
||||||
if 'password' in option and 'eval_password' not in option and value is not None:
|
if isinstance(option, str) and \
|
||||||
|
'password' in option and 'eval_password' not in option and value is not None:
|
||||||
value = '********'
|
value = '********'
|
||||||
if value is None and '=' in option:
|
if value is None and '=' in option:
|
||||||
args = option.split('=', 1)
|
args = option.split('=', 1)
|
||||||
|
|
Loading…
Reference in a new issue