Commit 614ea542 authored by Madhur Garg's avatar Madhur Garg

Fixes coding style; Corrected indentation and use of static length when...

Fixes coding style; Corrected indentation and use of static length when displaying hidden value #3426
parent 0ed0bd3c
...@@ -448,7 +448,7 @@ class Config(RawConfigParser): ...@@ -448,7 +448,7 @@ class Config(RawConfigParser):
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 'password' in option and 'eval_password' not in option:
value = '*'*len(value) value = '********'
return ("%s=%s" % (option, value), 'Info') return ("%s=%s" % (option, value), 'Info')
def remove_and_save(self, option: str, def remove_and_save(self, option: str,
......
...@@ -527,7 +527,7 @@ class CommandCore: ...@@ -527,7 +527,7 @@ class CommandCore:
}) })
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 'password' in option_name and 'eval_password' not in option_name:
option_value = '*'*len(option_value) option_value = '********'
lines.append( lines.append(
'%s\x19%s}=\x19o%s' % '%s\x19%s}=\x19o%s' %
(option_name, dump_tuple( (option_name, dump_tuple(
...@@ -537,7 +537,7 @@ class CommandCore: ...@@ -537,7 +537,7 @@ class CommandCore:
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 'password' in option and 'eval_password' not in option and value is not None:
value = '*'*len(value) value = '********'
if value is None and '=' in option: if value is None and '=' in option:
args = option.split('=', 1) args = option.split('=', 1)
info = ('%s=%s' % (option, value), 'Info') info = ('%s=%s' % (option, value), 'Info')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment