meta-virtualization/recipes-networking/openvswitch/openvswitch-git/0004-Python3-compatibility-iteritems-to-items.patch
Mark Asselstine f0f0453984 openvswitch: backport py3 fixups
While attempting to get ovs to be built and run with py3 (completely
free of py2) host contamination was found (builds on hosts without
python-six installed would fail). It was also determined that pyc
files were still being generated with py2 and not py3. This resulted
in more work being done to achieve the desired results. This work was
sent upstream and subsequently merged. Unfortunately this didn't make
v2.7.1 and may not be available until the next major release, so here
we backport these commits and adjust the recipe to get a clean py3
only build.

Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2017-07-13 10:54:49 -04:00

103 lines
3.7 KiB
Diff
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

From 0f318e472d9897d99395adcfb17cbeaff05677ba Mon Sep 17 00:00:00 2001
From: Jason Wessel <jason.wessel@windriver.com>
Date: Thu, 29 Jun 2017 20:33:23 -0700
Subject: [PATCH 4/8] Python3 compatibility: iteritems to items
Commit 4ab665623cbb4c6506e48b82e0c9fe8585f42e13 from
https://github.com/openvswitch/ovs.git
Allow compability with python3 and python2 by changing iteritems() to
items().
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
---
build-aux/extract-ofp-actions | 2 +-
build-aux/extract-ofp-errors | 2 +-
build-aux/extract-ofp-fields | 2 +-
ovsdb/ovsdb-idlc.in | 8 ++++----
4 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/build-aux/extract-ofp-actions b/build-aux/extract-ofp-actions
index 874e6b4..c11297c 100755
--- a/build-aux/extract-ofp-actions
+++ b/build-aux/extract-ofp-actions
@@ -13,7 +13,7 @@ version_map = {"1.0": 0x01,
"1.3": 0x04,
"1.4": 0x05,
"1.5": 0x06}
-version_reverse_map = dict((v, k) for (k, v) in version_map.iteritems())
+version_reverse_map = dict((v, k) for (k, v) in version_map.items())
# Map from vendor name to the length of the action header.
vendor_map = {"OF": (0x00000000, 4),
diff --git a/build-aux/extract-ofp-errors b/build-aux/extract-ofp-errors
index 336a240..71ae0bd 100755
--- a/build-aux/extract-ofp-errors
+++ b/build-aux/extract-ofp-errors
@@ -14,7 +14,7 @@ version_map = {"1.0": 0x01,
"1.4": 0x05,
"1.5": 0x06,
"1.6": 0x07}
-version_reverse_map = dict((v, k) for (k, v) in version_map.iteritems())
+version_reverse_map = dict((v, k) for (k, v) in version_map.items())
token = None
line = ""
diff --git a/build-aux/extract-ofp-fields b/build-aux/extract-ofp-fields
index 61e752b..ef997dd 100755
--- a/build-aux/extract-ofp-fields
+++ b/build-aux/extract-ofp-fields
@@ -16,7 +16,7 @@ VERSION = {"1.0": 0x01,
"1.3": 0x04,
"1.4": 0x05,
"1.5": 0x06}
-VERSION_REVERSE = dict((v,k) for k, v in VERSION.iteritems())
+VERSION_REVERSE = dict((v,k) for k, v in VERSION.items())
TYPES = {"u8": (1, False),
"be16": (2, False),
diff --git a/ovsdb/ovsdb-idlc.in b/ovsdb/ovsdb-idlc.in
index 3fa1a0f..615548f 100755
--- a/ovsdb/ovsdb-idlc.in
+++ b/ovsdb/ovsdb-idlc.in
@@ -138,7 +138,7 @@ def printCIDLHeader(schemaFile):
#include "smap.h"
#include "uuid.h"''' % {'prefix': prefix.upper()})
- for tableName, table in sorted(schema.tables.iteritems()):
+ for tableName, table in sorted(schema.tables.items()):
structName = "%s%s" % (prefix, tableName.lower())
print(" ")
@@ -300,7 +300,7 @@ def printCIDLSource(schemaFile):
''' % schema.idlHeader)
# Cast functions.
- for tableName, table in sorted(schema.tables.iteritems()):
+ for tableName, table in sorted(schema.tables.items()):
structName = "%s%s" % (prefix, tableName.lower())
print('''
static struct %(s)s *
@@ -311,7 +311,7 @@ static struct %(s)s *
''' % {'s': structName})
- for tableName, table in sorted(schema.tables.iteritems()):
+ for tableName, table in sorted(schema.tables.items()):
structName = "%s%s" % (prefix, tableName.lower())
print(" ")
print("/* %s table. */" % (tableName))
@@ -1025,7 +1025,7 @@ void
# Table classes.
print(" ")
print("struct ovsdb_idl_table_class %stable_classes[%sN_TABLES] = {" % (prefix, prefix.upper()))
- for tableName, table in sorted(schema.tables.iteritems()):
+ for tableName, table in sorted(schema.tables.items()):
structName = "%s%s" % (prefix, tableName.lower())
if table.is_root:
is_root = "true"
--
2.5.0