Explorar o código

HUE-3999 [oozie] list_oozie_workflow page shouldn't break incase of bad json from oozie

krish %!s(int64=9) %!d(string=hai) anos
pai
achega
4f61fa1943
Modificáronse 1 ficheiros con 7 adicións e 1 borrados
  1. 7 1
      desktop/libs/liboozie/src/liboozie/types.py

+ 7 - 1
desktop/libs/liboozie/src/liboozie/types.py

@@ -22,6 +22,7 @@ This is mostly just codifying the datastructure of the Oozie REST API.
 http://incubator.apache.org/oozie/docs/3.2.0-incubating/docs/WebServicesAPI.html
 """
 
+import logging
 import re
 
 from cStringIO import StringIO
@@ -37,6 +38,7 @@ from liboozie.utils import parse_timestamp, format_time
 from django.utils.translation import ugettext as _
 from django.core.urlresolvers import reverse
 
+LOG = logging.getLogger(__name__)
 
 class Action(object):
 
@@ -148,7 +150,11 @@ class WorkflowAction(Action):
 
     if self.conf:
       xml = StringIO(i18n.smart_str(self.conf))
-      self.conf_dict = hadoop.confparse.ConfParse(xml)
+      try:
+        self.conf_dict = hadoop.confparse.ConfParse(xml)
+      except Exception, e:
+        LOG.error('Failed to parse XML configuration for Workflow action %s: %s' % (self.name, e))
+        self.conf_dict = {}
     else:
       self.conf_dict = {}