Переглянути джерело

HUE-6586 [sqoop] Strip sqoop if present in beginning of command

Romain Rigaux 8 роки тому
батько
коміт
9ea0e19
1 змінених файлів з 6 додано та 1 видалено
  1. 6 1
      apps/oozie/src/oozie/models2.py

+ 6 - 1
apps/oozie/src/oozie/models2.py

@@ -813,7 +813,12 @@ class Node():
       action = notebook.get_data()['snippets'][0]
       action = notebook.get_data()['snippets'][0]
 
 
       name = '%s-%s' % (self.data['type'].split('-')[0], self.data['id'][:4])
       name = '%s-%s' % (self.data['type'].split('-')[0], self.data['id'][:4])
-      self.data['properties']['command'] = action['statement']
+
+      command = action['statement']
+      if command.startswith('sqoop '):
+        _ignore, command = command.split('sqoop ', 1)
+      self.data['properties']['command'] = command
+
       self.data['properties']['arguments'] = []
       self.data['properties']['arguments'] = []
 
 
     elif self.data['type'] == DistCpDocumentAction.TYPE:
     elif self.data['type'] == DistCpDocumentAction.TYPE: