slaplib: Raise human readable message when impossible to supply.

parent 3c4ebec6
...@@ -168,12 +168,14 @@ class Supply(SlapDocument): ...@@ -168,12 +168,14 @@ class Supply(SlapDocument):
zope.interface.implements(interface.ISupply) zope.interface.implements(interface.ISupply)
def supply(self, software_release, computer_guid=None, state='available'): def supply(self, software_release, computer_guid=None, state='available'):
# Note: Zope accepts additional arguments, so state in case of older try:
# servers will be just ignored. self._connection_helper.POST('/supplySupply', {
self._connection_helper.POST('/supplySupply', { 'url': software_release,
'url': software_release, 'computer_id': computer_guid,
'computer_id': computer_guid, 'state': state})
'state': state}) except NotFoundError:
raise NotFoundError("Computer %s has not been found by SlapOS Master."
% computer_guid)
class OpenOrder(SlapDocument): class OpenOrder(SlapDocument):
......
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