Commit d210025b authored by Alain Takoudjou's avatar Alain Takoudjou Committed by Rafael Monnerat

Add getSoftwareInstallationStatus to check software installation status

parent a938e8f3
...@@ -353,6 +353,26 @@ class SlapTool(BaseTool): ...@@ -353,6 +353,26 @@ class SlapTool(BaseTool):
computer = _assertACI(computer) computer = _assertACI(computer)
return self._getAccessStatus(computer_id) return self._getAccessStatus(computer_id)
security.declareProtected(Permissions.AccessContentsInformation,
'getSoftwareInstallationStatus')
def getSoftwareInstallationStatus(self, url, computer_id):
"""
Get the connection status of the software installation
"""
computer = self.getPortalObject().portal_catalog.unrestrictedSearchResults(
portal_type='Computer', reference=computer_id,
validation_state="validated")[0].getObject()
# Be sure to prevent accessing information to disallowed users
computer = _assertACI(computer)
try:
software_installation = self._getSoftwareInstallationForComputer(
url,
computer)
except NotFound:
return self._getAccessStatus(None)
else:
return self._getAccessStatus(software_installation.getReference())
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
'getSoftwareReleaseListFromSoftwareProduct') 'getSoftwareReleaseListFromSoftwareProduct')
def getSoftwareReleaseListFromSoftwareProduct(self, def getSoftwareReleaseListFromSoftwareProduct(self,
......
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