From patchwork Wed Mar 7 18:26:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ben Pfaff X-Patchwork-Id: 882710 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=ovn.org 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 3zxMYN5K1lz9s23 for ; Thu, 8 Mar 2018 05:26:48 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 8BDB91301; Wed, 7 Mar 2018 18:26: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 940BE1300 for ; Wed, 7 Mar 2018 18:26:44 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 1725062B for ; Wed, 7 Mar 2018 18:26:41 +0000 (UTC) X-Originating-IP: 12.250.50.186 Received: from sigabrt.benpfaff.org (unknown [12.250.50.186]) (Authenticated sender: blp@ovn.org) by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id 88CBBC5A60; Wed, 7 Mar 2018 19:26:38 +0100 (CET) From: Ben Pfaff To: dev@openvswitch.org Date: Wed, 7 Mar 2018 10:26:35 -0800 Message-Id: <20180307182635.23290-1-blp@ovn.org> X-Mailer: git-send-email 2.16.1 MIME-Version: 1.0 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: Anil Jangam , Ben Pfaff Subject: [ovs-dev] [PATCH] ovsdb-idl: Use modern form of . 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: , Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org Long ago, a object in the OVSDB protocol mapped a table name to a single . Since then, it has mapped a table name to an *array of* objects, but the OVSDB IDL has never been updated to use the modern form. This commit makes that change. Reported-by: Anil Jangam Signed-off-by: Ben Pfaff Acked-by: Justin Pettit --- AUTHORS.rst | 1 + lib/ovsdb-idl.c | 3 ++- python/ovs/db/idl.py | 5 +++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/AUTHORS.rst b/AUTHORS.rst index f6bf68c91bc0..dc69ba3f3c1f 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -393,6 +393,7 @@ André Ruß andre.russ@hybris.com Andreas Beckmann debian@abeckmann.de Andrei Andone andrei.andone@softvision.ro Andrey Korolyov andrey@xdel.ru +Anil Jangam anilj.mailing@gmail.com Anshuman Manral anshuman.manral@outlook.com Anton Matsiuk anton.matsiuk@gmail.com Anup Khadka khadka.py@gmail.com diff --git a/lib/ovsdb-idl.c b/lib/ovsdb-idl.c index b027f8cad35d..642ce66f9e0f 100644 --- a/lib/ovsdb-idl.c +++ b/lib/ovsdb-idl.c @@ -1600,7 +1600,8 @@ ovsdb_idl_send_monitor_request__(struct ovsdb_idl *idl, json_object_put(monitor_request, "where", where); table->cond_changed = false; } - json_object_put(monitor_requests, tc->name, monitor_request); + json_object_put(monitor_requests, tc->name, + json_array_create_1(monitor_request)); } } free_schema(schema); diff --git a/python/ovs/db/idl.py b/python/ovs/db/idl.py index 5a4d129c0e13..ddc9cb517352 100644 --- a/python/ovs/db/idl.py +++ b/python/ovs/db/idl.py @@ -425,10 +425,11 @@ class Idl(object): (table.name in self.readonly) and (column not in self.readonly[table.name])): columns.append(column) - monitor_requests[table.name] = {"columns": columns} + monitor_request = {"columns": columns} if method == "monitor_cond" and table.condition != [True]: - monitor_requests[table.name]["where"] = table.condition + monitor_request["where"] = table.condition table.cond_change = False + monitor_requests[table.name] = [monitor_request] msg = ovs.jsonrpc.Message.create_request( method, [self._db.name, str(self.uuid), monitor_requests])