diff options
author | Mark Asselstine <mark.asselstine@windriver.com> | 2017-07-12 17:02:42 -0400 |
---|---|---|
committer | Bruce Ashfield <bruce.ashfield@windriver.com> | 2017-07-13 10:54:49 -0400 |
commit | f0f0453984192fd1b250785d2088a84733065c28 (patch) | |
tree | aaffa0ce19816af43f5a1ced614bf9b6c255c5e8 /recipes-networking/openvswitch/openvswitch-git/0006-Python3-compatibility-math-error-compatibility.patch | |
parent | 165ffabe8933d2e44074d67921ea465eab4d90cb (diff) | |
download | meta-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/0006-Python3-compatibility-math-error-compatibility.patch')
-rw-r--r-- | recipes-networking/openvswitch/openvswitch-git/0006-Python3-compatibility-math-error-compatibility.patch | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/recipes-networking/openvswitch/openvswitch-git/0006-Python3-compatibility-math-error-compatibility.patch b/recipes-networking/openvswitch/openvswitch-git/0006-Python3-compatibility-math-error-compatibility.patch new file mode 100644 index 00000000..54905cd0 --- /dev/null +++ b/recipes-networking/openvswitch/openvswitch-git/0006-Python3-compatibility-math-error-compatibility.patch | |||
@@ -0,0 +1,56 @@ | |||
1 | From 3a9fcf1c8f60c160c282c9755ee1c7f9f7e113c3 Mon Sep 17 00:00:00 2001 | ||
2 | From: Jason Wessel <jason.wessel@windriver.com> | ||
3 | Date: Thu, 29 Jun 2017 20:33:23 -0700 | ||
4 | Subject: [PATCH 6/8] Python3 compatibility: math error compatibility | ||
5 | |||
6 | Commit 3fa5aa4294377e0f35267936d0c5caea3e61db48 from | ||
7 | https://github.com/openvswitch/ovs.git | ||
8 | |||
9 | The way math is handled with typing is completely different in python3. | ||
10 | |||
11 | % python2<<EOF | ||
12 | x=10 | ||
13 | y=8 | ||
14 | print((x + (y - 1)) / y * y) | ||
15 | EOF | ||
16 | 16 | ||
17 | |||
18 | python3<<EOF | ||
19 | x=10 | ||
20 | y=8 | ||
21 | print((x + (y - 1)) / y * y) | ||
22 | EOF | ||
23 | 17.0 | ||
24 | |||
25 | So we need to force an integer for the round function as follows and | ||
26 | maintain compatibility with python2. | ||
27 | |||
28 | python3<<EOF | ||
29 | x=10 | ||
30 | y=8 | ||
31 | print(int((x + (y - 1)) / y) * y) | ||
32 | EOF | ||
33 | 16 | ||
34 | |||
35 | Signed-off-by: Jason Wessel <jason.wessel@windriver.com> | ||
36 | Signed-off-by: Ben Pfaff <blp@ovn.org> | ||
37 | --- | ||
38 | build-aux/extract-ofp-actions | 2 +- | ||
39 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
40 | |||
41 | diff --git a/build-aux/extract-ofp-actions b/build-aux/extract-ofp-actions | ||
42 | index c11297c..bd7131f 100755 | ||
43 | --- a/build-aux/extract-ofp-actions | ||
44 | +++ b/build-aux/extract-ofp-actions | ||
45 | @@ -35,7 +35,7 @@ line = "" | ||
46 | arg_structs = set() | ||
47 | |||
48 | def round_up(x, y): | ||
49 | - return (x + (y - 1)) / y * y | ||
50 | + return int((x + (y - 1)) / y) * y | ||
51 | |||
52 | def open_file(fn): | ||
53 | global file_name | ||
54 | -- | ||
55 | 2.5.0 | ||
56 | |||