Commit 5c980caf authored by Julien Muchembled's avatar Julien Muchembled

Drop the 'parameters-extra' option and always forward extra parameters

There was an inconsistency between the 2 ways of creating executable wrappers:
- createWrapper: parameters-extra defaults to False
- slapos.recipe.librecipe.execute.generic_exec: no option, enabled

An option for that is not worth the effort.
Let's always enable even if it's meaningless.

/software/ and /stack/ will be cleaned up once a new version of this egg
is released.
parent fcd4e69f
......@@ -137,7 +137,7 @@ class GenericBaseRecipe(object):
path, arguments=', '.join(args))[0]
def createWrapper(self, name, command, parameters, comments=(),
parameters_extra=False, environment=None,
environment=None,
):
"""
Creates a basic shell script for process replacement.
......@@ -159,9 +159,7 @@ class GenericBaseRecipe(object):
lines.append('exec ' + shlex.quote(command))
parameters = map(shlex.quote, parameters)
if parameters_extra:
# pass-through further parameters
parameters.append('"$@"')
parameters.append('"$@"')
for param in parameters:
if len(lines[-1]) < 40:
lines[-1] += ' ' + param
......
......@@ -108,7 +108,6 @@ class Notify(GenericBaseRecipe):
return self.createWrapper(name=wrapper,
command=cmd[0],
parameters=cmd[1:],
parameters_extra=True,
comments=[
'',
'Call an executable and send notification(s).',
......
......@@ -37,14 +37,12 @@ class Recipe(GenericBaseRecipe):
:param lines wait-for-files: list of files to wait for
:param str pidfile: path to pidfile ensure exclusivity for the process
:param bool parameters-extra: whether wrapper parameters are passed onto command
:param bool reserve-cpu: command will ask for an exclusive CPU core
"""
def install(self):
command_line = shlex.split(self.options['command-line'])
wrapper_path = self.options['wrapper-path']
wait_files = self.options.get('wait-for-files')
parameters_extra = self.options.get('parameters-extra')
pidfile = self.options.get('pidfile')
environment = {}
......@@ -75,5 +73,4 @@ class Recipe(GenericBaseRecipe):
return self.createWrapper(wrapper_path,
command_line[0],
command_line[1:],
parameters_extra=self.isTrueValue(parameters_extra),
environment=environment)
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