Reuse TRUE_VALUES already defined

parent 53f43215
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
import logging import logging
from slapos import slap as slapmodule from slapos import slap as slapmodule
import slapos.recipe.librecipe.generic as librecipe
DEFAULT_SOFTWARE_TYPE = 'RootSoftwareInstance' DEFAULT_SOFTWARE_TYPE = 'RootSoftwareInstance'
...@@ -99,8 +100,6 @@ class Recipe(object): ...@@ -99,8 +100,6 @@ class Recipe(object):
request = slap.registerComputerPartition( request = slap.registerComputerPartition(
options['computer-id'], options['partition-id']).request options['computer-id'], options['partition-id']).request
isSlave = options.get('slave', '').lower() in ['y', 'yes', 'true', '1']
print '\n Slave : %s \n' % self.isSlave
return_parameters = [] return_parameters = []
self.return_parameters = [] self.return_parameters = []
if 'return' in options: if 'return' in options:
...@@ -126,6 +125,9 @@ class Recipe(object): ...@@ -126,6 +125,9 @@ class Recipe(object):
print 'requested %s (%s), parameters : %s \n\n' % (options['name'], print 'requested %s (%s), parameters : %s \n\n' % (options['name'],
software_type, software_type,
partition_parameter_kw) partition_parameter_kw)
isSlave = options.get('slave', '').lower() in \
librecipe.GenericBaseRecipe.TRUE_VALUES
self.instance = instance = request(software_url, software_type, self.instance = instance = request(software_url, software_type,
name, partition_parameter_kw=partition_parameter_kw, name, partition_parameter_kw=partition_parameter_kw,
filter_kw=filter_kw, shared=isSlave) filter_kw=filter_kw, shared=isSlave)
......
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