Commit b63c95ec authored by Yusei Tahara's avatar Yusei Tahara Committed by Arnaud Fontaine

Allow any environment variables.

parent ef5a681b
......@@ -38,16 +38,20 @@ class Recipe(GenericBaseRecipe):
port=int(self.options['port']),
openoffice_port=int(self.options['openoffice-port']),
)
environment_variable_list = []
for env_line in self.options['environment'].splitlines():
env_line = env_line.strip()
if not env_line:
continue
if '=' in env_line:
env_key, env_value = env_line.split('=')
conversion_server_dict[env_key.strip()] = env_value.strip()
environment_variable_list.append((env_key.strip(), env_value.strip()))
else:
raise zc.buildout.UserError('Line %r in environment parameter is '
'incorrect' % env_line)
conversion_server_dict['ENVIRONMENT_VARIABLE_LIST'] = '\n'.join(
['env-%s = %s' % (key, value) for key, value in environment_variable_list]
)
config_file = self.createFile(self.options['configuration-file'],
self.substituteTemplate(self.getTemplateFilename('cloudooo.cfg.in'),
conversion_server_dict))
......
......@@ -33,9 +33,9 @@ application_hostname = %(ip)s
# OpenOffice Port
openoffice_port = %(openoffice_port)s
# LD_LIBRARY_PATH passed to OpenOffice
env-LD_LIBRARY_PATH = %(LD_LIBRARY_PATH)s
env-FONTCONFIG_FILE = %(FONTCONFIG_FILE)s
# LD_LIBRARY_PATH and other environment variables
# passed to OpenOffice
%(ENVIRONMENT_VARIABLE_LIST)s
#
# Mimetype Registry
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment