summaryrefslogtreecommitdiffstats
path: root/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch-git/0007-Python3-compatibility-unicode-to-str.patch
diff options
context:
space:
mode:
authorBrad Bishop <bradleyb@fuzziesquirrel.com>2018-02-25 22:55:05 -0500
committerBrad Bishop <bradleyb@fuzziesquirrel.com>2018-03-15 14:22:49 +0000
commitd7bf8c17eca8f8c89898a7794462c773c449e983 (patch)
treed18618fca85ca5f0c077032cc7b009344b60f663 /import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch-git/0007-Python3-compatibility-unicode-to-str.patch
parente2b5abdc9f28cdf8578e5b9be803c8e697443c20 (diff)
downloadtalos-openbmc-d7bf8c17eca8f8c89898a7794462c773c449e983.tar.gz
talos-openbmc-d7bf8c17eca8f8c89898a7794462c773c449e983.zip
Yocto 2.4
Move OpenBMC to Yocto 2.4(rocko) Tested: Built and verified Witherspoon and Palmetto images Change-Id: I12057b18610d6fb0e6903c60213690301e9b0c67 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch-git/0007-Python3-compatibility-unicode-to-str.patch')
-rw-r--r--import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch-git/0007-Python3-compatibility-unicode-to-str.patch51
1 files changed, 51 insertions, 0 deletions
diff --git a/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch-git/0007-Python3-compatibility-unicode-to-str.patch b/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch-git/0007-Python3-compatibility-unicode-to-str.patch
new file mode 100644
index 000000000..faa32b73b
--- /dev/null
+++ b/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch-git/0007-Python3-compatibility-unicode-to-str.patch
@@ -0,0 +1,51 @@
+From 2fe58f87b00d0ec24d6997930d0bcdb130c84396 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 7/8] Python3 compatibility: unicode to str
+
+Commit 7430959d4ad17db89b8387c3aef58c8b230cad10 from
+https://github.com/openvswitch/ovs.git
+
+When transitioning from python2 to python3 the following type class
+changes occured:
+
+python2 -> python3
+unicode -> str
+str -> bytes
+
+That means we have to check the python version and do the right type
+check python3 will throw an error when it tries to use the unicode
+type because it doesn't exist.
+
+Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
+Signed-off-by: Ben Pfaff <blp@ovn.org>
+---
+ ovsdb/ovsdb-doc | 12 +++++++++---
+ 1 file changed, 9 insertions(+), 3 deletions(-)
+
+diff --git a/ovsdb/ovsdb-doc b/ovsdb/ovsdb-doc
+index 918e88a..406c293 100755
+--- a/ovsdb/ovsdb-doc
++++ b/ovsdb/ovsdb-doc
+@@ -65,9 +65,15 @@ def columnGroupToNroff(table, groupXml, documented_columns):
+ if node.hasAttribute('type'):
+ type_string = node.attributes['type'].nodeValue
+ type_json = ovs.json.from_string(str(type_string))
+- if type(type_json) in (str, unicode):
+- raise error.Error("%s %s:%s has invalid 'type': %s"
+- % (table.name, name, key, type_json))
++ # py2 -> py3 means str -> bytes and unicode -> str
++ try:
++ if type(type_json) in (str, unicode):
++ raise error.Error("%s %s:%s has invalid 'type': %s"
++ % (table.name, name, key, type_json))
++ except:
++ if type(type_json) in (bytes, str):
++ raise error.Error("%s %s:%s has invalid 'type': %s"
++ % (table.name, name, key, type_json))
+ type_ = ovs.db.types.BaseType.from_json(type_json)
+ else:
+ type_ = column.type.value
+--
+2.5.0
+
OpenPOWER on IntegriCloud