Commit 914d7964 authored by Romain Courteaud's avatar Romain Courteaud

Do use data retrieval to report the status.

parent 7a1ec4c5
......@@ -420,7 +420,8 @@ class TestSlapOSSlapToolComputerAccess(TestSlapOSSlapToolMixin):
def test_accessed_getComputerStatus(self):
self.login(self.computer_id)
self.portal_slap.getComputerInformation(self.computer_id)
self.portal_slap.softwareReleaseError(
'http://example.org', self.computer_id, 'error log')
created_at = rfc1123_date(DateTime())
response = self.portal_slap.getComputerStatus(self.computer_id)
self.assertEqual(200, response.status)
......@@ -447,7 +448,7 @@ class TestSlapOSSlapToolComputerAccess(TestSlapOSSlapToolMixin):
<unicode>created_at</unicode>
<unicode>%(created_at)s</unicode>
<unicode>text</unicode>
<unicode>#access %(computer_id)s</unicode>
<unicode>#error while installing http://example.org</unicode>
<unicode>user</unicode>
<unicode>%(computer_id)s</unicode>
</dictionary>
......@@ -1624,7 +1625,8 @@ class TestSlapOSSlapToolPersonAccess(TestSlapOSSlapToolMixin):
def test_accessed_getComputerStatus(self):
self.login(self.computer_id)
self.portal_slap.getComputerInformation(self.computer_id)
self.portal_slap.softwareReleaseError(
'http://example.org', self.computer_id, 'error log')
self.login(self.person_reference)
created_at = rfc1123_date(DateTime())
response = self.portal_slap.getComputerStatus(self.computer_id)
......@@ -1652,7 +1654,7 @@ class TestSlapOSSlapToolPersonAccess(TestSlapOSSlapToolMixin):
<unicode>created_at</unicode>
<unicode>%(created_at)s</unicode>
<unicode>text</unicode>
<unicode>#access %(computer_id)s</unicode>
<unicode>#error while installing http://example.org</unicode>
<unicode>user</unicode>
<unicode>%(computer_id)s</unicode>
</dictionary>
......
21
\ No newline at end of file
22
\ No newline at end of file
......@@ -282,7 +282,6 @@ class SlapTool(BaseTool):
Reuses slap library for easy marshalling.
"""
user = self.getPortalObject().portal_membership.getAuthenticatedMember().getUserName()
self._logAccess(user, user, '#access %s' % computer_id)
result = self._getComputerInformation(computer_id, user)
if self.REQUEST.response.getStatus() == 200:
......@@ -686,11 +685,6 @@ class SlapTool(BaseTool):
slap_partition._parameter_dict.update(parameter_dict)
result = xml_marshaller.xml_marshaller.dumps(slap_partition)
user = self.getPortalObject().portal_membership.\
getAuthenticatedMember().getUserName()
self._logAccess(user, user, '#access %s %s' % (computer_reference,
computer_partition_reference))
# Keep in cache server for 7 days
self.REQUEST.response.setStatus(200)
self.REQUEST.response.setHeader('Cache-Control',
......
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