@@ -46,14 +46,14 @@ def schemaToDot(schemaFile, arrows):
print "\tnode [shape=box];"
if not arrows:
print "\tedge [dir=none, arrowhead=none, arrowtail=none];"
- for tableName, table in schema.tables.iteritems():
+ for tableName, table in schema.tables.items():
options = {}
if table.is_root:
options['style'] = 'bold'
print "\t%s [%s];" % (
tableName,
', '.join(['%s=%s' % (k,v) for k,v in options.items()]))
- for columnName, column in table.columns.iteritems():
+ for columnName, column in table.columns.items():
if column.type.value:
printEdge(tableName, column.type, column.type.key, "%s key" % columnName)
printEdge(tableName, column.type, column.type.value, "%s value" % columnName)
@@ -281,7 +281,7 @@ bool %(s)s_is_updated(const struct %(s)s *, enum %(s)s_column_id);
# Table indexes.
print("struct %(s)s * %(s)s_index_init_row(struct ovsdb_idl *, const struct ovsdb_idl_table_class *);" % {'s': structName})
print
- for columnName, column in sorted(table.columns.iteritems()):
+ for columnName, column in sorted(table.columns.items()):
print('void %(s)s_index_set_%(c)s(const struct %(s)s *,' % {'s': structName, 'c': columnName})
if column.type.is_smap():
args = ['const struct smap *']
@@ -1030,7 +1030,7 @@ void
struct %(s)s *
%(s)s_index_init_row(struct ovsdb_idl *idl, const struct ovsdb_idl_table_class *class)
{""" % {'s': structName, 't': tableName})
- #for columnName, column in sorted(table.columns.iteritems()):
+ #for columnName, column in sorted(table.columns.items()):
# if column.type.is_smap():
# print " smap_init(&row->%s);" % columnName
print(" return (struct %(s)s *) ovsdb_idl_index_init_row(idl, class);" % {'s': structName, 't': tableName})
@@ -1097,7 +1097,7 @@ struct %(s)s *
return %(s)s_cast(ovsdb_idl_index_data(CONST_CAST(struct ovsdb_idl_index_cursor *, cursor)));
}""" % { 's' : structName })
# Indexes Set functions
- for columnName, column in sorted(table.columns.iteritems()):
+ for columnName, column in sorted(table.columns.items()):
type = column.type
comment, members = cMembers(prefix, tableName, columnName,
Python3 removed the iteritems() iterator and replaced it with items() which should also work in Python2. This fixes the following build problem on Python3: Traceback (most recent call last): File "./ovsdb/ovsdb-idlc.in", line 1436, in <module> func(*args[1:]) File "./ovsdb/ovsdb-idlc.in", line 314, in printCIDLHeader for columnName, column in sorted(table.columns.iteritems()): AttributeError: 'dict' object has no attribute 'iteritems' Signed-off-by: Markos Chandras <mchandras@suse.de> --- ovsdb/ovsdb-dot.in | 4 ++-- ovsdb/ovsdb-idlc.in | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-)