Commit 807347f9 authored by Antoine Catton's avatar Antoine Catton

Add the ability to get the partition and computer id of request result.

parent 7e9d26d4
...@@ -88,9 +88,23 @@ class Recipe(object): ...@@ -88,9 +88,23 @@ class Recipe(object):
if self.failed is None: if self.failed is None:
self.failed = param self.failed = param
# XXX XXX XXX: Return the computer id et partition id in order to
# register it later.
self.partition_allocated = False
options['computer-id'] = ''
options['partition-id'] = ''
if instance._computer_id is not None:
self.partition_allocated = True
options['computer-id'] = instance._computer_id
if instance._partition_id is not None:
self.partition_allocated = self.partition_allocated and True
options['partition-id'] = instance._partition_id
def install(self): def install(self):
if self.failed is not None: if self.failed is not None:
raise KeyError("Connection parameter %r not found." % self.failed) raise KeyError("Connection parameter %r not found." % self.failed)
if not self.partition_allocated:
raise ValueError("The computer partition is not allocated yet.")
return [] return []
update = install update = install
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