Explorar el Código

[oozie] Fix usage of iterkeys() and zip() in list_oozie_info template (#1270) (#1271)

The function iterkeys() is not available in Python 3, but there seems
to be no real need for an iterator anyway. The zip() call returns an
interator in Python 3, not a list, so the compromise of wrapping
list(zip()) should suffice for this use case.

Co-authored-by: Romain Rigaux <romain.rigaux@gmail.com>
Luca Toscano hace 5 años
padre
commit
d6c57a4d40

+ 4 - 4
apps/oozie/src/oozie/templates/dashboard/list_oozie_info.mako

@@ -70,7 +70,7 @@ ${ layout.menubar(section='oozie', dashboard=True) }
       </form>
       </form>
       <div class="tabbable">
       <div class="tabbable">
         <ul class="nav nav-tabs nav-tabs-border">
         <ul class="nav nav-tabs nav-tabs-border">
-            % for category in instrumentation.iterkeys():
+            % for category in instrumentation.keys():
             <li
             <li
             % if loop.first:
             % if loop.first:
               class="active"
               class="active"
@@ -82,7 +82,7 @@ ${ layout.menubar(section='oozie', dashboard=True) }
         </ul>
         </ul>
 
 
         <div class="tab-content">
         <div class="tab-content">
-            % for category in instrumentation.iterkeys():
+            % for category in instrumentation.keys():
             <div class="tab-pane
             <div class="tab-pane
               % if loop.first:
               % if loop.first:
               active
               active
@@ -99,7 +99,7 @@ ${ layout.menubar(section='oozie', dashboard=True) }
                   <td>${ name }</td>
                   <td>${ name }</td>
                 % if category == 'timers':
                 % if category == 'timers':
                   <td>
                   <td>
-                    % for label, timer in zip(['ownMinTime', 'ownTimeStdVar', 'totalTimeStdVar', 'ownTimeAvg', 'ticks', 'name', 'ownMaxTime', 'totalMinTime', 'totalMaxTime', 'totalTimeAvg'], item.values()):
+                    % for label, timer in list(zip(['ownMinTime', 'ownTimeStdVar', 'totalTimeStdVar', 'ownTimeAvg', 'ticks', 'name', 'ownMaxTime', 'totalMinTime', 'totalMaxTime', 'totalTimeAvg'], item.values())):
                     ${ label } :
                     ${ label } :
                     % if label == 'name':
                     % if label == 'name':
                       ${ name } -
                       ${ name } -
@@ -274,7 +274,7 @@ ${ layout.menubar(section='oozie', dashboard=True) }
 
 
    var instrumentationTables = [];
    var instrumentationTables = [];
 
 
-   % for category in instrumentation.iterkeys():
+   % for category in instrumentation.keys():
       % for index in range(len(instrumentation[category])):
       % for index in range(len(instrumentation[category])):
         var table = $("#intrumentationTable-${ category }-${ index }").dataTable({
         var table = $("#intrumentationTable-${ category }-${ index }").dataTable({
             "bPaginate": false,
             "bPaginate": false,