1
0
mirror of https://github.com/dkmstr/openuds.git synced 2025-01-21 18:03:54 +03:00

Merge remote-tracking branch 'origin/v4.0'

This commit is contained in:
Adolfo Gómez García 2024-12-16 19:25:42 +01:00
commit c9201c91a3
No known key found for this signature in database
GPG Key ID: DD1ABF20724CDA23

View File

@ -74,14 +74,15 @@ class Command(BaseCommand):
writer = {} # Create a dict to store data, and write at the end writer = {} # Create a dict to store data, and write at the end
# Get sections, key, value as a list of tuples # Get sections, key, value as a list of tuples
for section, data in config.Config.get_config_values().items(): for section, data in config.Config.get_config_values().items():
str_section = str(section)
for key, value in data.items(): for key, value in data.items():
# value is a dict, get 'value' key # value is a dict, get 'value' key
if options['csv']: if options['csv']:
writer.writerow([section, key, value['value']]) writer.writerow([str_section, key, value['value']])
elif options['yaml']: elif options['yaml']:
if section not in writer: if str_section not in writer:
writer[section] = {} writer[str_section] = {}
writer[section][key] = value['value'] writer[str_section][key] = value['value']
else: else:
v = value['value'].replace('\n', '\\n') v = value['value'].replace('\n', '\\n')
self.stdout.write(f'{section}.{key}="{v}"') self.stdout.write(f'{section}.{key}="{v}"')