From patchwork Sat Sep 14 23:17:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Li,Rongqing via dev" X-Patchwork-Id: 1162374 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=openvswitch.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=sysclose.org header.i=@sysclose.org header.b="dZ10AtGN"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=sysclose.org header.i=@sysclose.org header.b="dZ10AtGN"; dkim-atps=neutral Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46W7hb0j3dz9sN1 for ; Sun, 15 Sep 2019 09:17:50 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 99A45499; Sat, 14 Sep 2019 23:17:46 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 36CBD265 for ; Sat, 14 Sep 2019 23:17:45 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sysclose.org (smtp.sysclose.org [69.164.214.230]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id B8BC52C6 for ; Sat, 14 Sep 2019 23:17:44 +0000 (UTC) Received: by sysclose.org (Postfix, from userid 5001) id A3467679A; Sat, 14 Sep 2019 23:17:57 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 sysclose.org A3467679A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sysclose.org; s=201903; t=1568503077; bh=7axSDbuMW5eNB0n5S4NrmR4svj6l3E5DZRDj48I/udU=; h=From:To:Cc:Subject:Date:From; b=dZ10AtGN8YqiQ+FqPMmVVddsEDVfZWkk/85u7BnJZNm59yB/4zCaLyCmKiHyPO4SM hu+u6GSkWdZQ47aANZtB8KwW8wItsNi6d3lxXqKX36GMDELXn3GeC30BY6/BIfyopn Wpz04io7KzAQkwudvwRGcLHw+k8FlWb1X/WXnjUBwwuw72LkuZo/QaJNioUTMEWxo+ Tf8FDI6DbPn3ZET/WZmSwERQIfhpyxEyeOMELogF8uk+xmIGi3YlI01tr9iaai/saS 6Hc4xL54A5S2gOZgD6BopE8QTX5ncMAw2XcVbVdxy3YpRKbQRmryoQsq/xpFKgSk9m 94XtmKRP8yotA== X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU autolearn=ham version=3.3.1 Received: from localhost (unknown [177.183.215.210]) by sysclose.org (Postfix) with ESMTPSA id AD9776506; Sat, 14 Sep 2019 23:17:56 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 sysclose.org AD9776506 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sysclose.org; s=201903; t=1568503077; bh=7axSDbuMW5eNB0n5S4NrmR4svj6l3E5DZRDj48I/udU=; h=From:To:Cc:Subject:Date:From; b=dZ10AtGN8YqiQ+FqPMmVVddsEDVfZWkk/85u7BnJZNm59yB/4zCaLyCmKiHyPO4SM hu+u6GSkWdZQ47aANZtB8KwW8wItsNi6d3lxXqKX36GMDELXn3GeC30BY6/BIfyopn Wpz04io7KzAQkwudvwRGcLHw+k8FlWb1X/WXnjUBwwuw72LkuZo/QaJNioUTMEWxo+ Tf8FDI6DbPn3ZET/WZmSwERQIfhpyxEyeOMELogF8uk+xmIGi3YlI01tr9iaai/saS 6Hc4xL54A5S2gOZgD6BopE8QTX5ncMAw2XcVbVdxy3YpRKbQRmryoQsq/xpFKgSk9m 94XtmKRP8yotA== To: dev@openvswitch.org Date: Sat, 14 Sep 2019 20:17:28 -0300 Message-Id: <20190914231728.6871-1-fbl@sysclose.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Cc: Flavio Leitner Subject: [ovs-dev] [PATCH] ovsdb-idlc.in: fix dict change during iteration. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Flavio Leitner via dev From: "Li,Rongqing via dev" Reply-To: Flavio Leitner Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org 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 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 --- 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 40fef39ed..22d0a4e22 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)