Skip to content

Commit

Permalink
ovs-bugtool: Fix crash when enable --ovs.
Browse files Browse the repository at this point in the history
When enabling '--ovs' or when not using '-y', ovs-bugtool crashes due to
Traceback (most recent call last):
  File "/usr/local/sbin/ovs-bugtool", line 1410, in <module>
    sys.exit(main())
  File "/usr/local/sbin/ovs-bugtool", line 690, in main
    for (k, v) in data.items():
RuntimeError: dictionary changed size during iteration

The patch fixes it by making a copy of the key and value.

VMware-BZ: #2663359
Signed-off-by: William Tu <u9012063@gmail.com>
Acked-by: Greg Rose <gvrose8192@gmail.com>
Signed-off-by: 0-day Robot <robot@bytheb.org>
  • Loading branch information
williamtu authored and ovsrobot committed Nov 4, 2020
1 parent 83fbd2e commit f02d7ef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions utilities/bugtool/ovs-bugtool.in
Expand Up @@ -687,7 +687,7 @@ exclude those logs from the archive.
CAP_OPENVSWITCH_LOGS, CAP_NETWORK_CONFIG]
ovs_info_list = ['process-tree']
# We cannot use iteritems, since we modify 'data' as we pass through
for (k, v) in data.items():
for (k, v) in list(data.items()):
cap = v['cap']
if 'filename' in v:
info = k[0]
Expand All @@ -708,7 +708,7 @@ exclude those logs from the archive.

# permit the user to filter out data
# We cannot use iteritems, since we modify 'data' as we pass through
for (k, v) in data.items():
for (k, v) in list(data.items()):
cap = v['cap']
if 'filename' in v:
key = k[0]
Expand Down

0 comments on commit f02d7ef

Please sign in to comment.