Sfoglia il codice sorgente

[oozie] XML configuration element of a coordinator shouldn't be generated if empty

abec 13 anni fa
parent
commit
86d6a4e53d

+ 9 - 7
apps/oozie/src/oozie/templates/editor/gen/coordinator.xml.mako

@@ -62,20 +62,22 @@
   <action>
     <workflow>
       <app-path>${'${'}wf_application_path}</app-path>
+      % if coord.datainput_set.exists() and coord.dataoutput_set.exists():
       <configuration>
-      % for input in coord.datainput_set.all():
-        <property>
-          <name>${ input.name }</name>
-          <value>${'${'}coord:dataIn('${ input.name }')}</value>
-        </property>
-      % endfor
+        % for input in coord.datainput_set.all():
+          <property>
+            <name>${ input.name }</name>
+            <value>${'${'}coord:dataIn('${ input.name }')}</value>
+          </property>
+        % endfor
         % for output in coord.dataoutput_set.all():
         <property>
           <name>${ output.name }</name>
           <value>${'${'}coord:dataOut('${ output.name }')}</value>
         </property>
         % endfor
-     </configuration>
+      </configuration>
+      % endif
    </workflow>
   </action>
 </coordinator-app>

+ 0 - 2
apps/oozie/src/oozie/tests.py

@@ -639,8 +639,6 @@ class TestEditor:
         '  <action>\n'
         '    <workflow>\n'
         '      <app-path>${wf_application_path}</app-path>\n'
-        '      <configuration>\n'
-        '     </configuration>\n'
         '   </workflow>\n'
         '  </action>\n'
         '</coordinator-app>\n'.split(), coord.to_xml().split())