Skip to contentSkip to conversation

ovs: fix python 3.8 dict keys error

PATCH In review Scott Branden 2 participants 3 messages Feb 13, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ovs: fix python 3.8 dict keys error

From: Rick Liu <[email protected]>

Backport patch to python 3.8 issue with ovs do_compile runtime error:
RuntimeError: dictionary keys changed during iteration

https://patchwork.ozlabs.org/patch/1162374/

---
 ...on3-dict-key-change-during-iteration.patch | 38 +++++++++++++++++++
 .../openvswitch/openvswitch_git.bb            |  1 +
 2 files changed, 39 insertions(+)
 create mode 100644 recipes-networking/openvswitch/openvswitch-git/fix-python3-dict-key-change-during-iteration.patch
recipes-networking/openvswitch/openvswitch-git/fix-python3-dict-key-change-during-iteration.patch new file +38 -0
new file mode 100644
index 0000000..f9cadd2
@@ -0,0 +1,38 @@
+From d84109f0b60096ce71cd0537b31b69a7f5ea8756 Mon Sep 17 00:00:00 2001
+From: Flavio Leitner <[email protected]>
+Date: Sat, 14 Sep 2019 20:17:28 -0300
+Subject: [PATCH] ovsdb-idlc.in: fix dict change during iteration.
+
+Python3 complains if a dict key is changed during the
+iteration.
+
+Use list() to create a copy of it.
+
+Traceback (most recent call last):
+  File "./ovsdb/ovsdb-idlc.in", line 1581, in <module>
+    func(*args[1:])
+  File "./ovsdb/ovsdb-idlc.in", line 185, in printCIDLHeader
+    replace_cplusplus_keyword(schema)
+  File "./ovsdb/ovsdb-idlc.in", line 179, in replace_cplusplus_keyword
+    for columnName in table.columns:
+RuntimeError: dictionary keys changed during iteration
+
+Signed-off-by: Flavio Leitner <[email protected]>
+Signed-off-by: Ben Pfaff <[email protected]>
+---
+ 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 40fef39edf..22d0a4e22e 100755
+--- a/ovsdb/ovsdb-idlc.in
++++ b/ovsdb/ovsdb-idlc.in
+@@ -176,7 +176,7 @@ def replace_cplusplus_keyword(schema):
+                 'wchar_t', 'while', 'xor', 'xor_eq'}
+ 
+     for tableName, table in schema.tables.items():
+-        for columnName in table.columns:
++        for columnName in list(table.columns):
+             if columnName in keywords:
+                 table.columns[columnName + '_'] = table.columns.pop(columnName)
+ 
recipes-networking/openvswitch/openvswitch_git.bb +1 -0
index 072d7f1..5947759 100644
@@ -33,6 +33,7 @@ SRC_URI = "file://openvswitch-switch \
            file://python-switch-remaining-scripts-to-use-python3.patch \
            file://systemd-update-tool-paths.patch \
            file://systemd-create-runtime-dirs.patch \
+           file://fix-python3-dict-key-change-during-iteration.patch \
            "
 
 LIC_FILES_CHKSUM = "file://LICENSE;md5=1ce5d23a6429dff345518758f13aaeab"
Signature · 1 line
2.17.1
#1 lore raw
Quoted 6 lines · Scott Branden via Lists.Yoctoproject.Org

From: Rick Liu <[email protected]>

Backport patch to python 3.8 issue with ovs do_compile runtime error:
RuntimeError: dictionary keys changed during iteration

We already have an uprev to OVS posted to the list yesterday.

So I'm assuming this doesn't happen with the new version, and if it does, we need a rebased patch.

Bruce

Quoted 70 lines

https://patchwork.ozlabs.org/patch/1162374/

---
 ...on3-dict-key-change-during-iteration.patch | 38 +++++++++++++++++++
 .../openvswitch/openvswitch_git.bb            |  1 +
 2 files changed, 39 insertions(+)
 create mode 100644 recipes-networking/openvswitch/openvswitch-git/fix-python3-dict-key-change-during-iteration.patch
recipes-networking/openvswitch/openvswitch-git/fix-python3-dict-key-change-during-iteration.patch new file +38 -0
new file mode 100644
index 0000000..f9cadd2
@@ -0,0 +1,38 @@
+From d84109f0b60096ce71cd0537b31b69a7f5ea8756 Mon Sep 17 00:00:00 2001
+From: Flavio Leitner <[email protected]>
+Date: Sat, 14 Sep 2019 20:17:28 -0300
+Subject: [PATCH] ovsdb-idlc.in: fix dict change during iteration.
+
+Python3 complains if a dict key is changed during the
+iteration.
+
+Use list() to create a copy of it.
+
+Traceback (most recent call last):
+  File "./ovsdb/ovsdb-idlc.in", line 1581, in <module>
+    func(*args[1:])
+  File "./ovsdb/ovsdb-idlc.in", line 185, in printCIDLHeader
+    replace_cplusplus_keyword(schema)
+  File "./ovsdb/ovsdb-idlc.in", line 179, in replace_cplusplus_keyword
+    for columnName in table.columns:
+RuntimeError: dictionary keys changed during iteration
+
+Signed-off-by: Flavio Leitner <[email protected]>
+Signed-off-by: Ben Pfaff <[email protected]>
+---
+ 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 40fef39edf..22d0a4e22e 100755
+--- a/ovsdb/ovsdb-idlc.in
++++ b/ovsdb/ovsdb-idlc.in
+@@ -176,7 +176,7 @@ def replace_cplusplus_keyword(schema):
+                 'wchar_t', 'while', 'xor', 'xor_eq'}
+
+     for tableName, table in schema.tables.items():
+-        for columnName in table.columns:
++        for columnName in list(table.columns):
+             if columnName in keywords:
+                 table.columns[columnName + '_'] = table.columns.pop(columnName)
+
recipes-networking/openvswitch/openvswitch_git.bb +1 -1
index 072d7f1..5947759 100644
@@ -33,6 +33,7 @@ SRC_URI = "file://openvswitch-switch \
            file://python-switch-remaining-scripts-to-use-python3.patch \
            file://systemd-update-tool-paths.patch \
            file://systemd-create-runtime-dirs.patch \
+           file://fix-python3-dict-key-change-during-iteration.patch \
            "
 
 LIC_FILES_CHKSUM = "file://LICENSE;md5=1ce5d23a6429dff345518758f13aaeab"
--

2.17.1

Signature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II
#2 lore raw
Quoted 7 lines · Bruce Ashfield
Quoted 3 lines · Scott Branden via Lists.Yoctoproject.Org

From: Rick Liu <[email protected]>

Quoted 8 lines
Quoted 3 lines

Backport patch to python 3.8 issue with ovs do_compile runtime error:
RuntimeError: dictionary keys changed during iteration

We already have an uprev to OVS posted to the list yesterday.

So I'm assuming this doesn't happen with the new version, and if it does, we need a rebased patch.

Actually, now that I look at it, the patch is part of the rebase, so we are covered.

Bruce

Quoted 80 lines

Bruce

Quoted 67 lines

https://patchwork.ozlabs.org/patch/1162374/

---
 ...on3-dict-key-change-during-iteration.patch | 38 +++++++++++++++++++
 .../openvswitch/openvswitch_git.bb            |  1 +
 2 files changed, 39 insertions(+)
 create mode 100644 recipes-networking/openvswitch/openvswitch-git/fix-python3-dict-key-change-during-iteration.patch
recipes-networking/openvswitch/openvswitch-git/fix-python3-dict-key-change-during-iteration.patch new file +38 -0
new file mode 100644
index 0000000..f9cadd2
@@ -0,0 +1,38 @@
+From d84109f0b60096ce71cd0537b31b69a7f5ea8756 Mon Sep 17 00:00:00 2001
+From: Flavio Leitner <[email protected]>
+Date: Sat, 14 Sep 2019 20:17:28 -0300
+Subject: [PATCH] ovsdb-idlc.in: fix dict change during iteration.
+
+Python3 complains if a dict key is changed during the
+iteration.
+
+Use list() to create a copy of it.
+
+Traceback (most recent call last):
+  File "./ovsdb/ovsdb-idlc.in", line 1581, in <module>
+    func(*args[1:])
+  File "./ovsdb/ovsdb-idlc.in", line 185, in printCIDLHeader
+    replace_cplusplus_keyword(schema)
+  File "./ovsdb/ovsdb-idlc.in", line 179, in replace_cplusplus_keyword
+    for columnName in table.columns:
+RuntimeError: dictionary keys changed during iteration
+
+Signed-off-by: Flavio Leitner <[email protected]>
+Signed-off-by: Ben Pfaff <[email protected]>
+---
+ 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 40fef39edf..22d0a4e22e 100755
+--- a/ovsdb/ovsdb-idlc.in
++++ b/ovsdb/ovsdb-idlc.in
+@@ -176,7 +176,7 @@ def replace_cplusplus_keyword(schema):
+                 'wchar_t', 'while', 'xor', 'xor_eq'}
+
+     for tableName, table in schema.tables.items():
+-        for columnName in table.columns:
++        for columnName in list(table.columns):
+             if columnName in keywords:
+                 table.columns[columnName + '_'] = table.columns.pop(columnName)
+
recipes-networking/openvswitch/openvswitch_git.bb +1 -1
index 072d7f1..5947759 100644
@@ -33,6 +33,7 @@ SRC_URI = "file://openvswitch-switch \
            file://python-switch-remaining-scripts-to-use-python3.patch \
            file://systemd-update-tool-paths.patch \
            file://systemd-create-runtime-dirs.patch \
+           file://fix-python3-dict-key-change-during-iteration.patch \
            "
 
 LIC_FILES_CHKSUM = "file://LICENSE;md5=1ce5d23a6429dff345518758f13aaeab"
--
Quoted 3 lines

2.17.1

--
- Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end
- "Use the force Harry" - Gandalf, Star Trek II

Signature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II