Move to python3
This commit moves configure.ac and python scripts to
python3
Signed-off-by: Santosh Puranik <santosh.puranik@in.ibm.com>
Change-Id: Iaa03dffe15903fbd68c354442823903cc3bb3ad2
diff --git a/configure.ac b/configure.ac
index 5895956..05bf92e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -10,9 +10,9 @@
AM_PROG_AR
AC_PROG_INSTALL
AC_PROG_MAKE_SET
-AM_PATH_PYTHON([2.7],
+AM_PATH_PYTHON([3],
[AC_SUBST([PYTHON], [echo "$PYTHON"])],
- [AC_MSG_ERROR([Could not find python-2.7 installed...python-2.7 is required])])
+ [AC_MSG_ERROR([Could not find python-3 installed...python-3 is required])])
PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus])
PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging])
diff --git a/extra-properties.mako.hpp b/extra-properties.mako.hpp
index 6b006c2..a297b2c 100644
--- a/extra-properties.mako.hpp
+++ b/extra-properties.mako.hpp
@@ -18,14 +18,14 @@
{
const std::map<Path, InterfaceMap> objects = {
-% 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/extra-properties.py b/extra-properties.py
index 728fc14..f0f195c 100755
--- a/extra-properties.py
+++ b/extra-properties.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import os
import yaml
diff --git a/writefru.mako.hpp b/writefru.mako.hpp
index f7f06c5..b2890ea 100755
--- a/writefru.mako.hpp
+++ b/writefru.mako.hpp
@@ -32,7 +32,7 @@
throw std::runtime_error("Not implemented");
}
-% for key in fruDict.iterkeys():
+% for key in fruDict.keys():
<%
fru = fruDict[key]
%>\
@@ -48,14 +48,14 @@
// Inventory manager needs object path, list of interface names to be
// implemented, and property:value pairs contained in said interfaces
- % for interface, properties in fru.iteritems():
+ % for interface, properties in fru.items():
<%
names = interface.split(".")
intfName = names[0] + names[-1]
%>\
PropertyMap ${intfName}Props;
% if properties:
- % for name, value in properties.iteritems():
+ % for name, value in properties.items():
% if fru and interface and name and value:
<%
record, keyword = name.split(",")
diff --git a/writefru.py b/writefru.py
index eb5d5b8..b77f830 100755
--- a/writefru.py
+++ b/writefru.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import os
import yaml