From f0f0453984192fd1b250785d2088a84733065c28 Mon Sep 17 00:00:00 2001 From: Mark Asselstine Date: Wed, 12 Jul 2017 17:02:42 -0400 Subject: 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 Signed-off-by: Bruce Ashfield --- ...03-Python3-compatibility-execfile-to-exec.patch | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 recipes-networking/openvswitch/openvswitch-git/0003-Python3-compatibility-execfile-to-exec.patch (limited to 'recipes-networking/openvswitch/openvswitch-git/0003-Python3-compatibility-execfile-to-exec.patch') diff --git a/recipes-networking/openvswitch/openvswitch-git/0003-Python3-compatibility-execfile-to-exec.patch b/recipes-networking/openvswitch/openvswitch-git/0003-Python3-compatibility-execfile-to-exec.patch new file mode 100644 index 00000000..a85980ed --- /dev/null +++ b/recipes-networking/openvswitch/openvswitch-git/0003-Python3-compatibility-execfile-to-exec.patch @@ -0,0 +1,33 @@ +From 9cbae86be03756df76560c15720756f9ac088144 Mon Sep 17 00:00:00 2001 +From: Jason Wessel +Date: Thu, 29 Jun 2017 20:33:23 -0700 +Subject: [PATCH 3/8] Python3 compatibility: execfile to exec + +Commit a4d10a7ca937d73873f6f98619d88682e69f5dbe from +https://github.com/openvswitch/ovs.git + +Allow compability with python3 and python2 by changing execfile() to +exec(). + +Signed-off-by: Jason Wessel +Signed-off-by: Ben Pfaff +--- + ovsdb/ovsdb-idlc.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/ovsdb/ovsdb-idlc.in b/ovsdb/ovsdb-idlc.in +index 8b85f0d..3fa1a0f 100755 +--- a/ovsdb/ovsdb-idlc.in ++++ b/ovsdb/ovsdb-idlc.in +@@ -17,7 +17,7 @@ def parseSchema(filename): + + def annotateSchema(schemaFile, annotationFile): + schemaJson = ovs.json.from_file(schemaFile) +- execfile(annotationFile, globals(), {"s": schemaJson}) ++ exec(compile(open(annotationFile, "rb").read(), annotationFile, 'exec'), globals(), {"s": schemaJson}) + ovs.json.to_stream(schemaJson, sys.stdout) + sys.stdout.write('\n') + +-- +2.5.0 + -- cgit v1.2.3-54-g00ecf