From 5098b03916fd7a90605b6e3774ee536ef9108a94 Mon Sep 17 00:00:00 2001 From: Patrick Williams Date: Thu, 1 Jun 2017 15:40:10 -0500 Subject: fru_gen: fixes for python3 The iter{keys,items} functions have become just 'keys' and 'items' in python3. Python2 also has keys and items, which is slightly less efficient for iteration but none of these maps are large enough to be of concern. Change-Id: If6e8f36ad39074e0a6c022fb09e3a43b0928af19 Signed-off-by: Patrick Williams --- scripts/extra-properties.mako.cpp | 6 +++--- scripts/writefru.mako.cpp | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/extra-properties.mako.cpp b/scripts/extra-properties.mako.cpp index 03c730a..e566cec 100644 --- a/scripts/extra-properties.mako.cpp +++ b/scripts/extra-properties.mako.cpp @@ -7,14 +7,14 @@ using namespace ipmi::vpd; extern const std::map extras = { -% for path in dict.iterkeys(): +% for path in dict.keys(): <% interfaces = dict[path] %>\ {"${path}",{ - % for interface,properties in interfaces.iteritems(): + % for interface,properties in interfaces.items(): {"${interface}",{ - % for property,value in properties.iteritems(): + % for property,value in properties.items(): {"${property}", ${value}}, % endfor }}, diff --git a/scripts/writefru.mako.cpp b/scripts/writefru.mako.cpp index 7573862..6180e13 100644 --- a/scripts/writefru.mako.cpp +++ b/scripts/writefru.mako.cpp @@ -3,18 +3,18 @@ #include "frup.hpp" extern const FruMap frus = { -% for key in fruDict.iterkeys(): +% for key in fruDict.keys(): {${key},{ <% fru = fruDict[key] %> - % for object,interfaces in fru.iteritems(): + % for object,interfaces in fru.items(): {"${object}",{ - % for interface,properties in interfaces.iteritems(): + % for interface,properties in interfaces.items(): {"${interface}",{ - % for dbus_property,property_value in properties.iteritems(): + % for dbus_property,property_value in properties.items(): {"${dbus_property}",{ - % for name,value in property_value.iteritems(): + % for name,value in property_value.items(): {"${name}","${value}"}, % endfor }}, -- cgit v1.2.1