Commit 34a9e7ae authored by Marco Mariani's avatar Marco Mariani

keep running if cp.error() or sr.error() have issues (fixes 20130119-744D94)

parent 47723afa
...@@ -26,6 +26,10 @@ ...@@ -26,6 +26,10 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# #
############################################################################## ##############################################################################
"""
Simple, easy to (un)marshall classes for slap client/server communication
"""
__all__ = ["slap", "ComputerPartition", "Computer", "SoftwareRelease", __all__ = ["slap", "ComputerPartition", "Computer", "SoftwareRelease",
"Supply", "OpenOrder", "NotFoundError", "Unauthorized", "Supply", "OpenOrder", "NotFoundError", "Unauthorized",
"ResourceNotReady", "ServerError"] "ResourceNotReady", "ServerError"]
...@@ -33,15 +37,15 @@ __all__ = ["slap", "ComputerPartition", "Computer", "SoftwareRelease", ...@@ -33,15 +37,15 @@ __all__ = ["slap", "ComputerPartition", "Computer", "SoftwareRelease",
from interface import slap as interface from interface import slap as interface
from xml_marshaller import xml_marshaller from xml_marshaller import xml_marshaller
import httplib import httplib
import logging
import socket import socket
import ssl import ssl
import traceback
import urllib import urllib
import urlparse import urlparse
import zope.interface import zope.interface
""" log = logging.getLogger(__name__)
Simple, easy to (un)marshall classes for slap client/server communication
"""
DEFAULT_SOFTWARE_TYPE = 'default' DEFAULT_SOFTWARE_TYPE = 'default'
...@@ -109,11 +113,15 @@ class SoftwareRelease(SlapDocument): ...@@ -109,11 +113,15 @@ class SoftwareRelease(SlapDocument):
return self._software_release return self._software_release
def error(self, error_log): def error(self, error_log):
# Does not follow interface try:
self._connection_helper.POST('/softwareReleaseError', { # Does not follow interface
'url': self.getURI(), self._connection_helper.POST('/softwareReleaseError', {
'computer_id' : self.getComputerId(), 'url': self.getURI(),
'error_log': error_log}) 'computer_id' : self.getComputerId(),
'error_log': error_log})
except Exception:
exception = traceback.format_exc()
log.error(exception)
def available(self): def available(self):
self._connection_helper.POST('/availableSoftwareRelease', { self._connection_helper.POST('/availableSoftwareRelease', {
...@@ -469,10 +477,14 @@ class ComputerPartition(SlapDocument): ...@@ -469,10 +477,14 @@ class ComputerPartition(SlapDocument):
}) })
def error(self, error_log): def error(self, error_log):
self._connection_helper.POST('/softwareInstanceError', { try:
'computer_id': self._computer_id, self._connection_helper.POST('/softwareInstanceError', {
'computer_partition_id': self.getId(), 'computer_id': self._computer_id,
'error_log': error_log}) 'computer_partition_id': self.getId(),
'error_log': error_log})
except Exception:
exception = traceback.format_exc()
log.error(exception)
def bang(self, message): def bang(self, message):
self._connection_helper.POST('/softwareInstanceBang', { self._connection_helper.POST('/softwareInstanceBang', {
......
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