mariadb use ini parser
This commit is contained in:
parent
d755267dd9
commit
32ea52c8f4
3 changed files with 4 additions and 18 deletions
|
@ -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
|
|
@ -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',
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue