Commit f49bfad8 authored by Rafael Monnerat's avatar Rafael Monnerat

wrapper: Don't create python script wrapper at same folder

  When create a wrapper for etc/service/my-wrapper placing the 2 files
  at the same folder, cause one duplication at the files added to supervisord, so
  always place the python script wrapper at the bin folder of the buildout.
parent 31445f9a
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
############################################################################## ##############################################################################
import shlex import shlex
import os
from slapos.recipe.librecipe import GenericBaseRecipe from slapos.recipe.librecipe import GenericBaseRecipe
...@@ -57,8 +58,14 @@ class Recipe(GenericBaseRecipe): ...@@ -57,8 +58,14 @@ class Recipe(GenericBaseRecipe):
# We create a python script and a wrapper around the python # We create a python script and a wrapper around the python
# script because the python script might have a too long #! line # script because the python script might have a too long #! line
if os.path.exists(os.path.join(self.buildout['buildout']['directory'], "bin")):
base_script_path = os.path.join(
self.buildout['buildout']['directory'], "bin/" + wrapper_path.split("/")[-1])
else:
base_script_path = os.path.join(
self.buildout['buildout']['directory'], wrapper_path.split("/")[-1])
python_script = self.createPythonScript( python_script = self.createPythonScript(
wrapper_path+'.py', base_script_path +'.py',
'slapos.recipe.librecipe.execute.generic_exec', 'slapos.recipe.librecipe.execute.generic_exec',
(command_line, wait_files, environment,), ) (command_line, wait_files, environment,), )
return [python_script, self.createWrapper( return [python_script, self.createWrapper(
......
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