Forráskód Böngészése

[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 5 éve
szülő
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>
       <div class="tabbable">
         <ul class="nav nav-tabs nav-tabs-border">
-            % for category in instrumentation.iterkeys():
+            % for category in instrumentation.keys():
             <li
             % if loop.first:
               class="active"
@@ -82,7 +82,7 @@ ${ layout.menubar(section='oozie', dashboard=True) }
         </ul>
 
         <div class="tab-content">
-            % for category in instrumentation.iterkeys():
+            % for category in instrumentation.keys():
             <div class="tab-pane
               % if loop.first:
               active
@@ -99,7 +99,7 @@ ${ layout.menubar(section='oozie', dashboard=True) }
                   <td>${ name }</td>
                 % if category == 'timers':
                   <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 } :
                     % if label == 'name':
                       ${ name } -
@@ -274,7 +274,7 @@ ${ layout.menubar(section='oozie', dashboard=True) }
 
    var instrumentationTables = [];
 
-   % for category in instrumentation.iterkeys():
+   % for category in instrumentation.keys():
       % for index in range(len(instrumentation[category])):
         var table = $("#intrumentationTable-${ category }-${ index }").dataTable({
             "bPaginate": false,