소스 검색

HUE-8509 [oozie] Properly set the capture output flag of shell document action

Romain Rigaux 7 년 전
부모
커밋
4cbed79ecd

+ 4 - 0
apps/oozie/src/oozie/models2.py

@@ -4111,6 +4111,9 @@ class WorkflowBuilder():
 
     node['properties']['uuid'] = document.uuid
 
+    notebook = Notebook(document=document)
+    node['properties']['capture_output'] = notebook.get_data()['snippets'][0]['properties']['capture_output']
+
     return node
 
   def get_shell_snippet_node(self, snippet):
@@ -4121,6 +4124,7 @@ class WorkflowBuilder():
     node['properties']['archives'] = snippet['properties'].get('archives')
     node['properties']['files'] = snippet['properties'].get('files')
     node['properties']['env_var'] = snippet['properties'].get('env_var')
+    node['properties']['capture_output'] = snippet['properties'].get('capture_output')
 
     return node
 

+ 1 - 1
desktop/libs/indexer/src/indexer/api3.py

@@ -485,7 +485,7 @@ def _envelope_job(request, file_format, destination, start_time=None, lib_path=N
   collection_name = destination['name']
   indexer = EnvelopeIndexer(request.user, request.fs)
 
-  lib_path = '/tmp/envelope-0.6.0-SNAPSHOT.jar'
+  lib_path = '/tmp/envelope.jar'
   input_path = None
 
   if file_format['inputFormat'] == 'table':

+ 1 - 1
desktop/libs/indexer/src/indexer/indexers/envelope.py

@@ -65,7 +65,7 @@ class EnvelopeIndexer(object):
       last_executed=start_time
     )
 
-    if not DISABLE_HUE_3.config.default_value: # CDH5
+    if not DISABLE_HUE_3.config.default_value or True: # CDH5
       shell_command_name = "pipeline.sh"
       shell_command = """#!/bin/bash
 

+ 5 - 3
desktop/libs/notebook/src/notebook/connectors/base.py

@@ -197,7 +197,7 @@ class Notebook(object):
 
     self.data = json.dumps(_data)
 
-  def add_shell_snippet(self, shell_command, arguments=None, archives=None, files=None, env_var=None, last_executed=None):
+  def add_shell_snippet(self, shell_command, arguments=None, archives=None, files=None, env_var=None, last_executed=None, capture_output=True):
     _data = json.loads(self.data)
 
     if arguments is None:
@@ -218,7 +218,8 @@ class Notebook(object):
           u'arguments': arguments,
           u'archives': archives,
           u'env_var': env_var,
-          u'command_path': shell_command
+          u'command_path': shell_command,
+          u'capture_output': capture_output
         },
         u'lastExecuted': last_executed
     }))
@@ -238,7 +239,8 @@ class Notebook(object):
          'database': _snippet.get('database'),
          'result': {},
          'variables': [],
-         'lastExecuted': _snippet.get('lastExecuted')
+         'lastExecuted': _snippet.get('lastExecuted'),
+         'capture_output': _snippet.get('capture_output', True)
     }
 
   def _add_session(self, data, snippet_type):