Browse Source

HUE-5758 [oozie] Fix parsing nodes from XML definition

Earlier code didn't replace tabs with empty string, which might cause
failures later.
krish 8 years ago
parent
commit
26924908ee
1 changed files with 2 additions and 1 deletions
  1. 2 1
      apps/oozie/src/oozie/importlib/workflows.py

+ 2 - 1
apps/oozie/src/oozie/importlib/workflows.py

@@ -35,6 +35,7 @@ import json
 import logging
 from lxml import etree
 import os
+import re
 
 from django.core import serializers
 from django.utils.encoding import smart_str
@@ -711,7 +712,7 @@ def generate_v2_graph_nodes(workflow_definition):
 
   # Transform XML using XSLT
   transformed_root = transform(workflow_definition_root)
-  node_list = str(transformed_root).replace('\n', '').replace(' ', '')
+  node_list = re.sub('[\s]', '', str(transformed_root))
   node_list = json.loads(node_list)
 
   return [node for node in node_list if node]