Add quick support for PATH in non-standard location

parent 0d3f1c4e
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# #
############################################################################## ##############################################################################
import os
import shutil import shutil
from slapos.recipe.librecipe import GenericSlapRecipe from slapos.recipe.librecipe import GenericSlapRecipe
from subprocess import Popen from subprocess import Popen
...@@ -44,7 +45,7 @@ class Recipe(GenericSlapRecipe): ...@@ -44,7 +45,7 @@ class Recipe(GenericSlapRecipe):
self.substituteTemplate(self.getTemplateFilename('os_config.xml.in'), self.substituteTemplate(self.getTemplateFilename('os_config.xml.in'),
os_configuration_parameter_dict)) os_configuration_parameter_dict))
path_list.append(os_config_file) path_list.append(os_config_file)
# Put modified accords configuration file # Put modified accords configuration file
accords_configuration_parameter_dict = dict( accords_configuration_parameter_dict = dict(
listen_ip = self.options['listen-ip'] listen_ip = self.options['listen-ip']
...@@ -63,7 +64,7 @@ class Recipe(GenericSlapRecipe): ...@@ -63,7 +64,7 @@ class Recipe(GenericSlapRecipe):
# Generate manifest # Generate manifest
manifest_origin_location = self.options['manifest-source'] manifest_origin_location = self.options['manifest-source']
manifest_location = self.options['manifest-destination'] manifest_location = self.options['manifest-destination']
shutil.copy(manifest_origin_location, manifest_location) shutil.copy(manifest_origin_location, manifest_location)
path_list.append(manifest_location) path_list.append(manifest_location)
...@@ -79,7 +80,10 @@ class Recipe(GenericSlapRecipe): ...@@ -79,7 +80,10 @@ class Recipe(GenericSlapRecipe):
server_url = self.server_url, server_url = self.server_url,
software_release_url = self.software_release_url, software_release_url = self.software_release_url,
key_file = self.key_file, key_file = self.key_file,
cert_file = self.cert_file,) cert_file = self.cert_file,
path = '%s:%s' % (self.options['accords_bin_directory'],
os.environ.get('PATH', '')),
)
wrapper_location = self.createPythonScript(self.options['accords-wrapper'], wrapper_location = self.createPythonScript(self.options['accords-wrapper'],
'%s.accords.runAccords' % __name__, '%s.accords.runAccords' % __name__,
wrapper_config_dict) wrapper_config_dict)
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# #
############################################################################## ##############################################################################
import os
from slapos import slap from slapos import slap
import signal import signal
from subprocess import Popen from subprocess import Popen
...@@ -48,8 +49,9 @@ def runAccords(accords_conf): ...@@ -48,8 +49,9 @@ def runAccords(accords_conf):
environment = dict( environment = dict(
LD_LIBRARY_PATH=accords_lib_directory, LD_LIBRARY_PATH=accords_lib_directory,
PATH= accords_conf['path'],
) )
# Set handler to stop ACCORDS when end of world comes # Set handler to stop ACCORDS when end of world comes
def sigtermHandler(signum, frame): def sigtermHandler(signum, frame):
Popen(['./co-command', 'stop', '/service/*'], Popen(['./co-command', 'stop', '/service/*'],
...@@ -73,7 +75,7 @@ def runAccords(accords_conf): ...@@ -73,7 +75,7 @@ def runAccords(accords_conf):
# Parse answer # Parse answer
# XXX # XXX
connection_dict = dict(connection='hardcoded') connection_dict = dict(connection='hardcoded')
# Send information about published service to SlapOS Master # Send information about published service to SlapOS Master
slap_connection = slap.slap() slap_connection = slap.slap()
slap_connection.initializeConnection(server_url, key_file, cert_file) slap_connection.initializeConnection(server_url, key_file, cert_file)
......
...@@ -5,8 +5,6 @@ extends = ...@@ -5,8 +5,6 @@ extends =
../../component/lxml-python/buildout.cfg ../../component/lxml-python/buildout.cfg
../slapos.cfg ../slapos.cfg
versions = versions
parts = parts =
instance instance
instance-accords instance-accords
...@@ -35,10 +33,6 @@ url = ${:_profile_base_location_}/instance-accords.cfg ...@@ -35,10 +33,6 @@ url = ${:_profile_base_location_}/instance-accords.cfg
output = ${buildout:directory}/template-accords.cfg output = ${buildout:directory}/template-accords.cfg
mode = 0644 mode = 0644
[versions]
# Use SlapOS patched zc.buildout
zc.buildout = 1.6.0-dev-SlapOS-004
[networkcache] [networkcache]
# Cedric de Saint Martin signature certificate # Cedric de Saint Martin signature certificate
signature-certificate-list = signature-certificate-list =
......
...@@ -32,6 +32,7 @@ manifest-name = manifest ...@@ -32,6 +32,7 @@ manifest-name = manifest
accords-wrapper = $${basedirectory:services}/accords accords-wrapper = $${basedirectory:services}/accords
# Workaround # Workaround
accords_lib_directory : ${accords:location}/lib accords_lib_directory : ${accords:location}/lib
accords_bin_directory : ${accords:location}/bin
[rootdirectory] [rootdirectory]
recipe = slapos.cookbook:mkdirectory recipe = slapos.cookbook:mkdirectory
......
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