Commit df70acb4 authored by Vincent Pelletier's avatar Vincent Pelletier

Postpone network interactions.

Detect missing options earlier, without bothering master.
parent dc0c1406
...@@ -89,19 +89,8 @@ class Recipe(object): ...@@ -89,19 +89,8 @@ class Recipe(object):
def __init__(self, buildout, name, options): def __init__(self, buildout, name, options):
self.logger = logging.getLogger(name) self.logger = logging.getLogger(name)
slap = slapmodule.slap()
software_url = options['software-url'] software_url = options['software-url']
name = options['name'] name = options['name']
slap.initializeConnection(options['server-url'],
options.get('key-file'),
options.get('cert-file'),
)
request = slap.registerComputerPartition(
options['computer-id'], options['partition-id']).request
return_parameters = options.get('return', '').split() return_parameters = options.get('return', '').split()
if not return_parameters: if not return_parameters:
self.logger.debug("No parameter to return to main instance." self.logger.debug("No parameter to return to main instance."
...@@ -116,6 +105,16 @@ class Recipe(object): ...@@ -116,6 +105,16 @@ class Recipe(object):
)) ))
slave = options.get('slave', 'false').lower() in \ slave = options.get('slave', 'false').lower() in \
librecipe.GenericBaseRecipe.TRUE_VALUES librecipe.GenericBaseRecipe.TRUE_VALUES
slap = slapmodule.slap()
slap.initializeConnection(
options['server-url'],
options.get('key-file'),
options.get('cert-file'),
)
request = slap.registerComputerPartition(
options['computer-id'],
options['partition-id'],
).request
self._raise_request_exception = None self._raise_request_exception = None
self._raise_request_exception_formatted = None self._raise_request_exception_formatted = None
self.instance = None self.instance = None
......
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