mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
lemonrule bugfix
This commit is contained in:
parent
e06fc6554f
commit
0a5eafc16d
1 changed files with 11 additions and 9 deletions
|
@ -339,15 +339,17 @@ def tools_lemonrule(id=None, url=None, key=None, value=None, priority=None, dele
|
||||||
for level in key:
|
for level in key:
|
||||||
line = line +"->{'"+ level +"'}"
|
line = line +"->{'"+ level +"'}"
|
||||||
|
|
||||||
# Append value
|
if line != '$tmp':
|
||||||
if value is None: conf_lines.append(line +';')
|
if value is None:
|
||||||
elif isinstance(value, int): conf_lines.append(line +' = '+ str(value) +';')
|
line = line +';'
|
||||||
else: conf_lines.append(line +' = \''+ value +'\';')
|
elif isinstance(value, int):
|
||||||
|
line = line +' = '+ str(value) +';'
|
||||||
|
else:
|
||||||
|
line = line +' = \''+ value +'\';'
|
||||||
|
|
||||||
# Write configuration
|
# Write configuration
|
||||||
with open(lemon_tmp_conf,'a+') as lemon_conf:
|
with open(lemon_tmp_conf,'a+') as lemon_conf:
|
||||||
for conf_line in conf_lines:
|
lemon_conf.write(line + '\n')
|
||||||
lemon_conf.write(conf_line + '\n')
|
|
||||||
|
|
||||||
# Apply & reload configuration
|
# Apply & reload configuration
|
||||||
if apply:
|
if apply:
|
||||||
|
@ -358,6 +360,6 @@ def tools_lemonrule(id=None, url=None, key=None, value=None, priority=None, dele
|
||||||
else:
|
else:
|
||||||
raise YunoHostError(1, _("An error occured during LemonLDAP configuration"))
|
raise YunoHostError(1, _("An error occured during LemonLDAP configuration"))
|
||||||
|
|
||||||
os.system("echo '' > lemon_tmp_conf")
|
os.system("echo '' > "+ lemon_tmp_conf)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue