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): ...@@ -38,16 +38,20 @@ class Recipe(GenericBaseRecipe):
port=int(self.options['port']), port=int(self.options['port']),
openoffice_port=int(self.options['openoffice-port']), openoffice_port=int(self.options['openoffice-port']),
) )
environment_variable_list = []
for env_line in self.options['environment'].splitlines(): for env_line in self.options['environment'].splitlines():
env_line = env_line.strip() env_line = env_line.strip()
if not env_line: if not env_line:
continue continue
if '=' in env_line: if '=' in env_line:
env_key, env_value = env_line.split('=') 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: else:
raise zc.buildout.UserError('Line %r in environment parameter is ' raise zc.buildout.UserError('Line %r in environment parameter is '
'incorrect' % env_line) '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'], config_file = self.createFile(self.options['configuration-file'],
self.substituteTemplate(self.getTemplateFilename('cloudooo.cfg.in'), self.substituteTemplate(self.getTemplateFilename('cloudooo.cfg.in'),
conversion_server_dict)) conversion_server_dict))
......
...@@ -33,9 +33,9 @@ application_hostname = %(ip)s ...@@ -33,9 +33,9 @@ application_hostname = %(ip)s
# OpenOffice Port # OpenOffice Port
openoffice_port = %(openoffice_port)s openoffice_port = %(openoffice_port)s
# LD_LIBRARY_PATH passed to OpenOffice # LD_LIBRARY_PATH and other environment variables
env-LD_LIBRARY_PATH = %(LD_LIBRARY_PATH)s # passed to OpenOffice
env-FONTCONFIG_FILE = %(FONTCONFIG_FILE)s %(ENVIRONMENT_VARIABLE_LIST)s
# #
# Mimetype Registry # 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