summaryrefslogtreecommitdiffstats
path: root/recipes-networking/openvswitch/openvswitch-git/0005-Python3-compatibility-fix-integer-problems.patch
diff options
context:
space:
mode:
authorMark Asselstine <mark.asselstine@windriver.com>2017-07-12 17:02:42 -0400
committerBruce Ashfield <bruce.ashfield@windriver.com>2017-07-13 10:54:49 -0400
commitf0f0453984192fd1b250785d2088a84733065c28 (patch)
treeaaffa0ce19816af43f5a1ced614bf9b6c255c5e8 /recipes-networking/openvswitch/openvswitch-git/0005-Python3-compatibility-fix-integer-problems.patch
parent165ffabe8933d2e44074d67921ea465eab4d90cb (diff)
downloadmeta-virtualization-f0f0453984192fd1b250785d2088a84733065c28.tar.gz
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>
Diffstat (limited to 'recipes-networking/openvswitch/openvswitch-git/0005-Python3-compatibility-fix-integer-problems.patch')
-rw-r--r--recipes-networking/openvswitch/openvswitch-git/0005-Python3-compatibility-fix-integer-problems.patch51
1 files changed, 51 insertions, 0 deletions
diff --git a/recipes-networking/openvswitch/openvswitch-git/0005-Python3-compatibility-fix-integer-problems.patch b/recipes-networking/openvswitch/openvswitch-git/0005-Python3-compatibility-fix-integer-problems.patch
new file mode 100644
index 00000000..717a97db
--- /dev/null
+++ b/recipes-networking/openvswitch/openvswitch-git/0005-Python3-compatibility-fix-integer-problems.patch
@@ -0,0 +1,51 @@
1From bc29f98f0137fa1083a4cacf832d52f740d150a8 Mon Sep 17 00:00:00 2001
2From: Jason Wessel <jason.wessel@windriver.com>
3Date: Thu, 29 Jun 2017 20:33:23 -0700
4Subject: [PATCH 5/8] Python3 compatibility: fix integer problems
5
6Commit fa145f1a53943243f94a32ce98525db8494b0052 from
7https://github.com/openvswitch/ovs.git
8
9In python3 maxint is not defined, but maxsize is defined in both
10python2 and python3.
11
12The put_text() will not automatically use a value which came in as
13float due to a pior math function and python3 will throw an exception.
14The simple answer is to convert it with int() and move on.
15
16Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
17Signed-off-by: Ben Pfaff <blp@ovn.org>
18---
19 ovsdb/ovsdb-idlc.in | 2 +-
20 python/build/nroff.py | 2 ++
21 2 files changed, 3 insertions(+), 1 deletion(-)
22
23diff --git a/ovsdb/ovsdb-idlc.in b/ovsdb/ovsdb-idlc.in
24index 615548f..7cbcbf5 100755
25--- a/ovsdb/ovsdb-idlc.in
26+++ b/ovsdb/ovsdb-idlc.in
27@@ -358,7 +358,7 @@ static void
28 print(" %s" % type.value.initCDefault(valueVar, type.n_min == 0))
29 print(" }")
30 else:
31- if type.n_max != sys.maxint:
32+ if type.n_max != sys.maxsize:
33 print(" size_t n = MIN(%d, datum->n);" % type.n_max)
34 nMax = "n"
35 else:
36diff --git a/python/build/nroff.py b/python/build/nroff.py
37index c23837f..401f699 100644
38--- a/python/build/nroff.py
39+++ b/python/build/nroff.py
40@@ -148,6 +148,8 @@ def fatal(msg):
41
42
43 def put_text(text, x, y, s):
44+ x = int(x)
45+ y = int(y)
46 extend = x + len(s) - len(text[y])
47 if extend > 0:
48 text[y] += ' ' * extend
49--
502.5.0
51