This commit is contained in:
egarette@silique.fr 2024-10-01 19:18:34 +02:00
parent 9f31448134
commit c330de60e7
3 changed files with 2 additions and 11 deletions

View file

@ -1,6 +0,0 @@
ROUGAIL_VAR1="string1"
ROUGAIL_VAR2="string1"
ROUGAIL_VAR3="string1"
ROUGAIL_VAR4="string1"
ROUGAIL_VAR5="string1"
ROUGAIL_VAR6="string1"

View file

@ -1,3 +0,0 @@
ROUGAIL_VAR1="string1"
ROUGAIL_VAR2="string1"
ROUGAIL_VAR3="string1"

View file

@ -101,8 +101,6 @@ def populate(dest_dir, rougailconfig):
values = [] values = []
for variable in get_variables(root_config): for variable in get_variables(root_config):
var = get_value(variable) var = get_value(variable)
if var is None:
var = ""
values.append('ROUGAIL_' + variable.path().upper() + '="' + var + '"') values.append('ROUGAIL_' + variable.path().upper() + '="' + var + '"')
if not environment_file.is_file(): if not environment_file.is_file():
with environment_file.open('w') as envfh: with environment_file.open('w') as envfh:
@ -129,6 +127,8 @@ def get_value(variable):
tests = ['domain1.lan', 'domain2.lan'] tests = ['domain1.lan', 'domain2.lan']
elif variable.type() == 'choice': elif variable.type() == 'choice':
tests = variable.value.list() tests = variable.value.list()
if tests[0] == None:
tests[0] = ""
else: else:
tests = ['string1', 'string2', 'string3'] tests = ['string1', 'string2', 'string3']
if not variable.ismulti() or (variable.isfollower() and variable.ismulti() is True): if not variable.ismulti() or (variable.isfollower() and variable.ismulti() is True):