mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
configpanel: add value
in options dict for config get --full
This commit is contained in:
parent
48f882ecd3
commit
d370cb0b24
1 changed files with 14 additions and 4 deletions
|
@ -363,7 +363,20 @@ class ConfigPanel:
|
|||
# Format result in 'classic' or 'export' mode
|
||||
self.config.translate()
|
||||
logger.debug(f"Formating result in '{mode}' mode")
|
||||
|
||||
if mode == "full":
|
||||
result = self.config.dict(exclude_none=True)
|
||||
|
||||
for panel in result["panels"]:
|
||||
for section in panel["sections"]:
|
||||
for opt in section["options"]:
|
||||
instance = self.config.get_option(opt["id"])
|
||||
if isinstance(instance, BaseInputOption):
|
||||
opt["value"] = instance.normalize(self.form[opt["id"]], instance)
|
||||
return result
|
||||
|
||||
result = OrderedDict()
|
||||
|
||||
for panel in self.config.panels:
|
||||
for section in panel.sections:
|
||||
if section.is_action_section and mode != "full":
|
||||
|
@ -388,10 +401,7 @@ class ConfigPanel:
|
|||
"value"
|
||||
] = "**************" # Prevent displaying password in `config get`
|
||||
|
||||
if mode == "full":
|
||||
return self.config.dict(exclude_none=True)
|
||||
else:
|
||||
return result
|
||||
return result
|
||||
|
||||
def set(
|
||||
self,
|
||||
|
|
Loading…
Add table
Reference in a new issue