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):
try:
# Does not follow interface # Does not follow interface
self._connection_helper.POST('/softwareReleaseError', { self._connection_helper.POST('/softwareReleaseError', {
'url': self.getURI(), 'url': self.getURI(),
'computer_id' : self.getComputerId(), 'computer_id' : self.getComputerId(),
'error_log': error_log}) '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):
try:
self._connection_helper.POST('/softwareInstanceError', { self._connection_helper.POST('/softwareInstanceError', {
'computer_id': self._computer_id, 'computer_id': self._computer_id,
'computer_partition_id': self.getId(), 'computer_partition_id': self.getId(),
'error_log': error_log}) '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