diff options
Diffstat (limited to 'cloudinit/reporting/handlers.py')
-rw-r--r-- | cloudinit/reporting/handlers.py | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/cloudinit/reporting/handlers.py b/cloudinit/reporting/handlers.py index eecd0a96..9cf8bd2b 100644 --- a/cloudinit/reporting/handlers.py +++ b/cloudinit/reporting/handlers.py @@ -1,13 +1,15 @@ # vi: ts=4 expandtab import abc -import logging import oauthlib.oauth1 as oauth1 - import six from ..registry import DictRegistry from .. import (url_helper, util) +from .. import log as logging + + +LOG = logging.getLogger(__name__) @six.add_metaclass(abc.ABCMeta) @@ -61,10 +63,13 @@ class WebHookHandler(ReportingHandler): readurl = self.oauth_helper.readurl else: readurl = url_helper.readurl - return readurl( - self.endpoint, data=event.as_dict(), - timeout=self.timeout, - retries=self.retries, ssl_details=self.ssl_details) + try: + return readurl( + self.endpoint, data=event.as_dict(), + timeout=self.timeout, + retries=self.retries, ssl_details=self.ssl_details) + except: + LOG.warn("failed posting event: %s" % event.as_string()) available_handlers = DictRegistry() |