mariadb use ini parser

This commit is contained in:
CroneKorkN 2025-06-27 15:02:11 +02:00
parent d755267dd9
commit 32ea52c8f4
Signed by: cronekorkn
SSH key fingerprint: SHA256:v0410ZKfuO1QHdgKBsdQNF64xmTxOF8osF1LIqwTcVw
3 changed files with 4 additions and 18 deletions

View file

@ -1,11 +0,0 @@
% for section, options in sorted(conf.items()):
[${section}]
% for key, value in sorted(options.items()):
% if value is None:
${key}
% else:
${key} = ${value}
% endif
% endfor
% endfor

View file

@ -20,10 +20,8 @@ directories = {
files = {
'/etc/mysql/conf.d/override.conf': {
'context': {
'conf': node.metadata.get('mariadb/conf'),
},
'content_type': 'mako',
'content': repo.libs.ini.dumps(node.metadata.get('mariadb/conf')),
'content_type': 'text',
},
}

View file

@ -14,7 +14,7 @@ class CaseSensitiveConfigParser(ConfigParser):
return value
def parse(text):
config = CaseSensitiveConfigParser()
config = CaseSensitiveConfigParser(allow_no_value=True)
config.read_string(text)
return {
@ -24,8 +24,7 @@ def parse(text):
def dumps(dict):
sorted_dict = json.loads(json.dumps(dict, sort_keys=True, cls=MetadataJSONEncoder))
parser = CaseSensitiveConfigParser()
parser = CaseSensitiveConfigParser(allow_no_value=True)
parser.read_dict(sorted_dict)
writable = Writable()