Commit e452be63 authored by Łukasz Nowak's avatar Łukasz Nowak

Support state of software while requesting.

Note: Backward compatible change -- state defaults to 'available'.
parent b6aab359
...@@ -220,11 +220,11 @@ class SlapTool(BaseTool): ...@@ -220,11 +220,11 @@ class SlapTool(BaseTool):
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
'supplySupply') 'supplySupply')
def supplySupply(self, url, computer_id): def supplySupply(self, url, computer_id, state='available'):
""" """
Request Software Release installation Request Software Release installation
""" """
return self._supplySupply(url, computer_id) return self._supplySupply(url, computer_id, state)
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
'buildingSoftwareRelease') 'buildingSoftwareRelease')
...@@ -610,13 +610,19 @@ class SlapTool(BaseTool): ...@@ -610,13 +610,19 @@ class SlapTool(BaseTool):
return len(catalog_result) return len(catalog_result)
@convertToREST @convertToREST
def _supplySupply(self, url, computer_id): def _supplySupply(self, url, computer_id, state):
""" """
Request Software Release installation Request Software Release installation
""" """
computer_document = self._getComputerDocument(computer_id) computer_document = self._getComputerDocument(computer_id)
computer_document.requestSoftwareReleaseInstallation( if state == 'available':
software_release_url=url) computer_document.requestSoftwareReleaseInstallation(
software_release_url=url)
elif state == 'destroyed':
computer_document.requestSoftwareReleaseCleanup(
software_release_url=url)
else:
raise ValueError('State %s is not supported' % state)
@convertToREST @convertToREST
def _buildingSoftwareRelease(self, url, computer_id): def _buildingSoftwareRelease(self, url, computer_id):
......
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