浏览代码

HUE-2754 [oozie] Sqoop action with variable adds an empty argument

Romain Rigaux 10 年之前
父节点
当前提交
f85e52d244

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

@@ -364,6 +364,10 @@ class Node():
     if 'sla' not in self.data['properties']:
       self.data['properties']['sla'] = Workflow.SLA_DEFAULT
 
+    # Backward compatibility
+    if self.data['type'] == 'sqoop' and 'arguments' not in self.data['properties']:
+      self.data['properties']['arguments'] = self.data['properties']['parameters']
+
   def get_template_name(self):
     return 'editor2/gen/workflow-%s.xml.mako' % self.data['type']
 
@@ -726,8 +730,8 @@ class SqoopAction(Action):
           'help_text': _('The full %(type)s command. Either put it here or split it by spaces and insert the parts as multiple parameters below.') % {'type': TYPE},
           'type': 'textarea'
      },
-     'parameters': {
-          'name': 'parameters',
+     'arguments': {
+          'name': 'arguments',
           'label': _('Arguments'),
           'value': [],
           'help_text': _('If no command is specified, split the command by spaces and insert the %(type)s parameters '

+ 1 - 1
apps/oozie/src/oozie/templates/editor2/common_workflow.mako

@@ -900,7 +900,7 @@
         <textarea data-bind="value: properties.command" class="input-xlarge" style="resize:both"></textarea>
 
         <div class="row-fluid">
-          <div class="span6" data-bind="template: { name: 'common-properties-parameters' }"></div>
+          <div class="span6" data-bind="template: { name: 'common-properties-arguments' }"></div>
           <div class="span6" data-bind="template: { name: 'common-properties-files' }"></div>
         </div>
       </div>

+ 1 - 1
apps/oozie/src/oozie/templates/editor2/gen/workflow-sqoop.xml.mako

@@ -32,7 +32,7 @@
             <command>${ node['properties']['command'] }</command>
             % endif
 
-            % for param in node['properties']['parameters']:
+            % for param in node['properties']['arguments']:
               <arg>${ param['value'] }</arg>
             % endfor