diff options
author | Mark Asselstine <mark.asselstine@windriver.com> | 2017-06-20 16:25:54 -0400 |
---|---|---|
committer | Bruce Ashfield <bruce.ashfield@windriver.com> | 2017-06-21 14:25:14 -0400 |
commit | e86ae39489f1c17405d557f9204747594af29e6a (patch) | |
tree | 19896072691430242d237adbb7cf64bdeff5cbd1 /recipes-networking/openvswitch | |
parent | b263370eebd1df8befb9533da53c5ff8439607cc (diff) | |
download | meta-virtualization-e86ae39489f1c17405d557f9204747594af29e6a.tar.gz |
openvswitch: switch to depending on python3
As far as I can tell openvswitch has been updated to work with python3
as well as with python(2). Switch to depend on python3 and use python3
for associated scripts. For the most part openvswitch will bind at
runtime to either py2 or py3 regardless of these changes, with these
changes we just do a better job of setting up the dependencies to
facilitate py3 bindings. The openvswitch autotests results are mostly
identical before and after this switch (failures move from python3 to
python(2) test cases as expected, with some exceptions see below).
When running the autotests/ptest with python(2) vs python3 we see a
slightly higher failure rate (334 failures vs. 284 failures). I do not
believe this higher fail rate reflects actual errors in the runtime,
rather the tests are not adapted to python3. At any rate like the rest
of openvswitch it is fairly straightforward to hack the logic for
autotests to be run using py2 as long as it is available in the image,
so these changes don't prevent falling back to py2 for autotests. This
should facilitate any debugging we need to do based on us switching to
favor py3.
Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Diffstat (limited to 'recipes-networking/openvswitch')
4 files changed, 132 insertions, 18 deletions
diff --git a/recipes-networking/openvswitch/files/python-make-remaining-scripts-use-usr-bin-env.patch b/recipes-networking/openvswitch/files/python-make-remaining-scripts-use-usr-bin-env.patch index 68f46ff5..4441c1ea 100644 --- a/recipes-networking/openvswitch/files/python-make-remaining-scripts-use-usr-bin-env.patch +++ b/recipes-networking/openvswitch/files/python-make-remaining-scripts-use-usr-bin-env.patch | |||
@@ -33,7 +33,7 @@ index f79f235..c7b8730 100755 | |||
33 | +++ b/build-aux/check-structs | 33 | +++ b/build-aux/check-structs |
34 | @@ -1,4 +1,4 @@ | 34 | @@ -1,4 +1,4 @@ |
35 | -#! /usr/bin/python | 35 | -#! /usr/bin/python |
36 | +#! /usr/bin/env python | 36 | +#! /usr/bin/env python3 |
37 | 37 | ||
38 | import os.path | 38 | import os.path |
39 | import sys | 39 | import sys |
@@ -43,7 +43,7 @@ index 184447b..92ea18d 100755 | |||
43 | +++ b/build-aux/extract-ofp-actions | 43 | +++ b/build-aux/extract-ofp-actions |
44 | @@ -1,4 +1,4 @@ | 44 | @@ -1,4 +1,4 @@ |
45 | -#! /usr/bin/python | 45 | -#! /usr/bin/python |
46 | +#! /usr/bin/env python | 46 | +#! /usr/bin/env python3 |
47 | 47 | ||
48 | import sys | 48 | import sys |
49 | import os.path | 49 | import os.path |
@@ -53,7 +53,7 @@ index 9642593..11e6de7 100755 | |||
53 | +++ b/build-aux/extract-ofp-errors | 53 | +++ b/build-aux/extract-ofp-errors |
54 | @@ -1,4 +1,4 @@ | 54 | @@ -1,4 +1,4 @@ |
55 | -#! /usr/bin/python | 55 | -#! /usr/bin/python |
56 | +#! /usr/bin/env python | 56 | +#! /usr/bin/env python3 |
57 | 57 | ||
58 | import sys | 58 | import sys |
59 | import os.path | 59 | import os.path |
@@ -63,7 +63,7 @@ index 498b887..5d6bcec 100755 | |||
63 | +++ b/build-aux/extract-ofp-fields | 63 | +++ b/build-aux/extract-ofp-fields |
64 | @@ -1,4 +1,4 @@ | 64 | @@ -1,4 +1,4 @@ |
65 | -#! /usr/bin/python | 65 | -#! /usr/bin/python |
66 | +#! /usr/bin/env python | 66 | +#! /usr/bin/env python3 |
67 | 67 | ||
68 | import getopt | 68 | import getopt |
69 | import sys | 69 | import sys |
@@ -73,7 +73,7 @@ index 1813638..e9e3c25 100755 | |||
73 | +++ b/build-aux/extract-ofp-msgs | 73 | +++ b/build-aux/extract-ofp-msgs |
74 | @@ -1,4 +1,4 @@ | 74 | @@ -1,4 +1,4 @@ |
75 | -#! /usr/bin/python | 75 | -#! /usr/bin/python |
76 | +#! /usr/bin/env python | 76 | +#! /usr/bin/env python3 |
77 | 77 | ||
78 | import sys | 78 | import sys |
79 | import os.path | 79 | import os.path |
@@ -83,7 +83,7 @@ index bd4e879..9d81503 100755 | |||
83 | +++ b/build-aux/xml2nroff | 83 | +++ b/build-aux/xml2nroff |
84 | @@ -1,4 +1,4 @@ | 84 | @@ -1,4 +1,4 @@ |
85 | -#! /usr/bin/python | 85 | -#! /usr/bin/python |
86 | +#! /usr/bin/env python | 86 | +#! /usr/bin/env python3 |
87 | 87 | ||
88 | # Copyright (c) 2010, 2011, 2012, 2013, 2014, 2015, 2016 Nicira, Inc. | 88 | # Copyright (c) 2010, 2011, 2012, 2013, 2014, 2015, 2016 Nicira, Inc. |
89 | # | 89 | # |
@@ -93,7 +93,7 @@ index 52de3db..c90f02b 100755 | |||
93 | +++ b/ovn/utilities/ovn-docker-overlay-driver | 93 | +++ b/ovn/utilities/ovn-docker-overlay-driver |
94 | @@ -1,4 +1,4 @@ | 94 | @@ -1,4 +1,4 @@ |
95 | -#! /usr/bin/python | 95 | -#! /usr/bin/python |
96 | +#! /usr/bin/env python | 96 | +#! /usr/bin/env python3 |
97 | # Copyright (C) 2015 Nicira, Inc. | 97 | # Copyright (C) 2015 Nicira, Inc. |
98 | # | 98 | # |
99 | # Licensed under the Apache License, Version 2.0 (the "License"); | 99 | # Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -103,7 +103,7 @@ index 2c9c4b6..89b804c 100755 | |||
103 | +++ b/ovn/utilities/ovn-docker-underlay-driver | 103 | +++ b/ovn/utilities/ovn-docker-underlay-driver |
104 | @@ -1,4 +1,4 @@ | 104 | @@ -1,4 +1,4 @@ |
105 | -#! /usr/bin/python | 105 | -#! /usr/bin/python |
106 | +#! /usr/bin/env python | 106 | +#! /usr/bin/env python3 |
107 | # Copyright (C) 2015 Nicira, Inc. | 107 | # Copyright (C) 2015 Nicira, Inc. |
108 | # | 108 | # |
109 | # Licensed under the Apache License, Version 2.0 (the "License"); | 109 | # Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -113,7 +113,7 @@ index 5cf26ee..f76f4bd 100755 | |||
113 | +++ b/ovsdb/ovsdb-doc | 113 | +++ b/ovsdb/ovsdb-doc |
114 | @@ -1,4 +1,4 @@ | 114 | @@ -1,4 +1,4 @@ |
115 | -#! /usr/bin/python | 115 | -#! /usr/bin/python |
116 | +#! /usr/bin/env python | 116 | +#! /usr/bin/env python3 |
117 | 117 | ||
118 | # Copyright (c) 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc. | 118 | # Copyright (c) 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc. |
119 | # | 119 | # |
diff --git a/recipes-networking/openvswitch/files/python-switch-remaining-scripts-to-use-python3.patch b/recipes-networking/openvswitch/files/python-switch-remaining-scripts-to-use-python3.patch new file mode 100644 index 00000000..a02b2a40 --- /dev/null +++ b/recipes-networking/openvswitch/files/python-switch-remaining-scripts-to-use-python3.patch | |||
@@ -0,0 +1,113 @@ | |||
1 | From 176528ca3a8b76c9d0bb71b1e56eeebccc655c71 Mon Sep 17 00:00:00 2001 | ||
2 | From: Mark Asselstine <mark.asselstine@windriver.com> | ||
3 | Date: Wed, 3 May 2017 10:39:12 -0400 | ||
4 | Subject: [PATCH] python: switch remaining scripts to use python3 | ||
5 | |||
6 | Work to remove the main openvswitch package's dependency on python 2. | ||
7 | |||
8 | Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com> | ||
9 | --- | ||
10 | ofproto/ipfix-gen-entities | 2 +- | ||
11 | tests/test-l7.py | 2 +- | ||
12 | utilities/checkpatch.py | 2 +- | ||
13 | utilities/ovs-dev.py | 2 +- | ||
14 | utilities/ovs-pipegen.py | 2 +- | ||
15 | vtep/ovs-vtep | 2 +- | ||
16 | xenserver/etc_xapi.d_plugins_openvswitch-cfg-update | 2 +- | ||
17 | xenserver/opt_xensource_libexec_interface-reconfigure | 2 +- | ||
18 | xenserver/usr_share_openvswitch_scripts_ovs-xapi-sync | 2 +- | ||
19 | 9 files changed, 9 insertions(+), 9 deletions(-) | ||
20 | |||
21 | diff --git a/ofproto/ipfix-gen-entities b/ofproto/ipfix-gen-entities | ||
22 | index 0be7199..d2cce42 100755 | ||
23 | --- a/ofproto/ipfix-gen-entities | ||
24 | +++ b/ofproto/ipfix-gen-entities | ||
25 | @@ -1,4 +1,4 @@ | ||
26 | -#! /usr/bin/env python | ||
27 | +#! /usr/bin/env python3 | ||
28 | # | ||
29 | # Copyright (C) 2012 Nicira, Inc. | ||
30 | # | ||
31 | diff --git a/tests/test-l7.py b/tests/test-l7.py | ||
32 | index d7854a1..f09defb 100755 | ||
33 | --- a/tests/test-l7.py | ||
34 | +++ b/tests/test-l7.py | ||
35 | @@ -1,4 +1,4 @@ | ||
36 | -#!/usr/bin/env python | ||
37 | +#!/usr/bin/env python3 | ||
38 | # Copyright (c) 2015, 2016 Nicira, Inc. | ||
39 | # | ||
40 | # Licensed under the Apache License, Version 2.0 (the "License"); | ||
41 | diff --git a/utilities/checkpatch.py b/utilities/checkpatch.py | ||
42 | index 26eb5c3..2e1932b 100755 | ||
43 | --- a/utilities/checkpatch.py | ||
44 | +++ b/utilities/checkpatch.py | ||
45 | @@ -1,4 +1,4 @@ | ||
46 | -#!/usr/bin/env python | ||
47 | +#!/usr/bin/env python3 | ||
48 | # Copyright (c) 2016 Red Hat, Inc. | ||
49 | # | ||
50 | # Licensed under the Apache License, Version 2.0 (the "License"); | ||
51 | diff --git a/utilities/ovs-dev.py b/utilities/ovs-dev.py | ||
52 | index 9ce0f04..839e13e 100755 | ||
53 | --- a/utilities/ovs-dev.py | ||
54 | +++ b/utilities/ovs-dev.py | ||
55 | @@ -1,4 +1,4 @@ | ||
56 | -#!/usr/bin/env python | ||
57 | +#!/usr/bin/env python3 | ||
58 | # Copyright (c) 2013, 2014, 2015, 2016 Nicira, Inc. | ||
59 | # | ||
60 | # Licensed under the Apache License, Version 2.0 (the "License"); | ||
61 | diff --git a/utilities/ovs-pipegen.py b/utilities/ovs-pipegen.py | ||
62 | index 4bf240f..2a8f13e 100755 | ||
63 | --- a/utilities/ovs-pipegen.py | ||
64 | +++ b/utilities/ovs-pipegen.py | ||
65 | @@ -1,4 +1,4 @@ | ||
66 | -#! /usr/bin/env python | ||
67 | +#! /usr/bin/env python3 | ||
68 | # Copyright (c) 2013, 2014, 2015 Nicira, Inc. | ||
69 | # | ||
70 | # Licensed under the Apache License, Version 2.0 (the "License"); | ||
71 | diff --git a/vtep/ovs-vtep b/vtep/ovs-vtep | ||
72 | index fd652d4..19d63f9 100755 | ||
73 | --- a/vtep/ovs-vtep | ||
74 | +++ b/vtep/ovs-vtep | ||
75 | @@ -1,4 +1,4 @@ | ||
76 | -#! /usr/bin/env python | ||
77 | +#! /usr/bin/env python3 | ||
78 | # Copyright (C) 2013 Nicira, Inc. All Rights Reserved. | ||
79 | # | ||
80 | # Licensed under the Apache License, Version 2.0 (the "License"); | ||
81 | diff --git a/xenserver/etc_xapi.d_plugins_openvswitch-cfg-update b/xenserver/etc_xapi.d_plugins_openvswitch-cfg-update | ||
82 | index e7404e3..5edad76 100755 | ||
83 | --- a/xenserver/etc_xapi.d_plugins_openvswitch-cfg-update | ||
84 | +++ b/xenserver/etc_xapi.d_plugins_openvswitch-cfg-update | ||
85 | @@ -1,4 +1,4 @@ | ||
86 | -#!/usr/bin/env python | ||
87 | +#!/usr/bin/env python3 | ||
88 | # | ||
89 | # xapi plugin script to update the cache of configuration items in the | ||
90 | # ovs-vswitchd configuration that are managed in the xapi database when | ||
91 | diff --git a/xenserver/opt_xensource_libexec_interface-reconfigure b/xenserver/opt_xensource_libexec_interface-reconfigure | ||
92 | index ea4a742..c6745ee 100755 | ||
93 | --- a/xenserver/opt_xensource_libexec_interface-reconfigure | ||
94 | +++ b/xenserver/opt_xensource_libexec_interface-reconfigure | ||
95 | @@ -1,4 +1,4 @@ | ||
96 | -#!/usr/bin/env python | ||
97 | +#!/usr/bin/env python3 | ||
98 | # | ||
99 | # Copyright (c) 2008,2009 Citrix Systems, Inc. | ||
100 | # | ||
101 | diff --git a/xenserver/usr_share_openvswitch_scripts_ovs-xapi-sync b/xenserver/usr_share_openvswitch_scripts_ovs-xapi-sync | ||
102 | index a776c00..d5ff8af 100755 | ||
103 | --- a/xenserver/usr_share_openvswitch_scripts_ovs-xapi-sync | ||
104 | +++ b/xenserver/usr_share_openvswitch_scripts_ovs-xapi-sync | ||
105 | @@ -1,4 +1,4 @@ | ||
106 | -#! /usr/bin/env python | ||
107 | +#! /usr/bin/env python3 | ||
108 | # Copyright (c) 2009, 2010, 2011, 2012, 2013 Nicira, Inc. | ||
109 | # | ||
110 | # Licensed under the Apache License, Version 2.0 (the "License"); | ||
111 | -- | ||
112 | 2.7.4 | ||
113 | |||
diff --git a/recipes-networking/openvswitch/openvswitch.inc b/recipes-networking/openvswitch/openvswitch.inc index 1f0b52b3..0e2e67f6 100644 --- a/recipes-networking/openvswitch/openvswitch.inc +++ b/recipes-networking/openvswitch/openvswitch.inc | |||
@@ -11,11 +11,11 @@ HOMEPAGE = "http://openvswitch.org/" | |||
11 | SECTION = "networking" | 11 | SECTION = "networking" |
12 | LICENSE = "Apache-2" | 12 | LICENSE = "Apache-2" |
13 | 13 | ||
14 | DEPENDS += "bridge-utils openssl python perl python-six-native coreutils-native" | 14 | DEPENDS += "bridge-utils openssl python3 perl python3-six-native coreutils-native" |
15 | 15 | ||
16 | RDEPENDS_${PN} += "util-linux-uuidgen util-linux-libuuid coreutils \ | 16 | RDEPENDS_${PN} += "util-linux-uuidgen util-linux-libuuid coreutils \ |
17 | python perl perl-module-strict ${PN}-switch \ | 17 | python3 perl perl-module-strict ${PN}-switch \ |
18 | bash python-twisted python-six" | 18 | bash python3-twisted python3-six" |
19 | RDEPENDS_${PN}-testcontroller = "${PN} lsb ${PN}-pki" | 19 | RDEPENDS_${PN}-testcontroller = "${PN} lsb ${PN}-pki" |
20 | RDEPENDS_${PN}-switch = "${PN} openssl procps util-linux-uuidgen" | 20 | RDEPENDS_${PN}-switch = "${PN} openssl procps util-linux-uuidgen" |
21 | RDEPENDS_${PN}-pki = "${PN}" | 21 | RDEPENDS_${PN}-pki = "${PN}" |
@@ -70,7 +70,7 @@ FILES_${PN} += "${datadir}/ovsdbmonitor" | |||
70 | FILES_${PN} += "/run" | 70 | FILES_${PN} += "/run" |
71 | 71 | ||
72 | FILES_${PN} += "${libdir}/python${PYTHON_BASEVERSION}/" | 72 | FILES_${PN} += "${libdir}/python${PYTHON_BASEVERSION}/" |
73 | inherit autotools update-rc.d systemd pythonnative | 73 | inherit autotools update-rc.d systemd python3native |
74 | 74 | ||
75 | SYSTEMD_PACKAGES = "${PN}-switch" | 75 | SYSTEMD_PACKAGES = "${PN}-switch" |
76 | SYSTEMD_SERVICE_${PN}-switch = " \ | 76 | SYSTEMD_SERVICE_${PN}-switch = " \ |
diff --git a/recipes-networking/openvswitch/openvswitch_git.bb b/recipes-networking/openvswitch/openvswitch_git.bb index a17c273c..a2893e9d 100644 --- a/recipes-networking/openvswitch/openvswitch_git.bb +++ b/recipes-networking/openvswitch/openvswitch_git.bb | |||
@@ -3,12 +3,12 @@ require openvswitch.inc | |||
3 | DEPENDS += "virtual/kernel" | 3 | DEPENDS += "virtual/kernel" |
4 | 4 | ||
5 | RDEPENDS_${PN}-ptest += "\ | 5 | RDEPENDS_${PN}-ptest += "\ |
6 | python-logging python-syslog python-argparse python-io \ | 6 | python3-logging python3-syslog python3-argparse python3-io \ |
7 | python-fcntl python-shell python-lang python-xml python-math \ | 7 | python3-fcntl python3-shell python3-lang python3-xml python3-math \ |
8 | python-datetime python-netclient python sed \ | 8 | python3-datetime python3-netclient python3 sed \ |
9 | ldd perl-module-socket perl-module-carp perl-module-exporter \ | 9 | ldd perl-module-socket perl-module-carp perl-module-exporter \ |
10 | perl-module-xsloader python-netserver python-threading \ | 10 | perl-module-xsloader python3-netserver python3-threading \ |
11 | python-resource python-subprocess findutils which \ | 11 | python3-resource python3-subprocess findutils which \ |
12 | " | 12 | " |
13 | 13 | ||
14 | S = "${WORKDIR}/git" | 14 | S = "${WORKDIR}/git" |
@@ -30,6 +30,7 @@ SRC_URI = "file://openvswitch-switch \ | |||
30 | file://0001-use-the-linux-if_packet.h-Interface-directly.patch \ | 30 | file://0001-use-the-linux-if_packet.h-Interface-directly.patch \ |
31 | file://0002-Define-WAIT_ANY-if-not-provided-by-system.patch \ | 31 | file://0002-Define-WAIT_ANY-if-not-provided-by-system.patch \ |
32 | file://CVE-2017-9263.patch \ | 32 | file://CVE-2017-9263.patch \ |
33 | file://python-switch-remaining-scripts-to-use-python3.patch \ | ||
33 | " | 34 | " |
34 | 35 | ||
35 | LIC_FILES_CHKSUM = "file://COPYING;md5=17b2c9d4c70853a09c0e143137754b35" | 36 | LIC_FILES_CHKSUM = "file://COPYING;md5=17b2c9d4c70853a09c0e143137754b35" |