From patchwork Tue Feb 26 14:26:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Michelson X-Patchwork-Id: 1048396 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=fail (p=none dis=none) header.from=redhat.com 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 4481bS4h7Qz9sBL for ; Wed, 27 Feb 2019 01:36:36 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id DA919793A; Tue, 26 Feb 2019 14:35:43 +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 EFA90791F for ; Tue, 26 Feb 2019 14:26:02 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 9F0EF828 for ; Tue, 26 Feb 2019 14:26:02 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4E2BB68557 for ; Tue, 26 Feb 2019 14:26:02 +0000 (UTC) Received: from monae.redhat.com (ovpn-121-115.rdu2.redhat.com [10.10.121.115]) by smtp.corp.redhat.com (Postfix) with ESMTP id EEF62289A9 for ; Tue, 26 Feb 2019 14:26:01 +0000 (UTC) From: Mark Michelson To: dev@openvswitch.org Date: Tue, 26 Feb 2019 09:26:00 -0500 Message-Id: <20190226142600.3542-3-mmichels@redhat.com> In-Reply-To: <20190226142600.3542-1-mmichels@redhat.com> References: <20190226142600.3542-1-mmichels@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 26 Feb 2019 14:26:02 +0000 (UTC) X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [PATCH 2.10 v2 2/2] ovn-nbctl: Don't parse table-formatting options in nbctl_client 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: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org When ovn-nbctl is running in daemon mode, nbctl_client attempts to parse table formatting options. The problem is that this then removes the table formatting options from the array of options passed to the server loop. The server loop resets the table formatting options to the defaults and then attempts again to parse table formatting options. Unfortunately, they aren't present any longer. The result is that tables are always formatted with the default style. This patch solves the issue by not parsing the table formatting options in nbctl_client. Instead, the table formatting options are passed to the server loop and parsed there instead. Signed-off-by: Mark Michelson Signed-off-by: Ben Pfaff Acked-by: Numan Siddique --- ovn/utilities/ovn-nbctl.c | 1 - tests/ovn-nbctl.at | 9 +++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ovn/utilities/ovn-nbctl.c b/ovn/utilities/ovn-nbctl.c index b5ee0a6e1..206f3b3eb 100644 --- a/ovn/utilities/ovn-nbctl.c +++ b/ovn/utilities/ovn-nbctl.c @@ -5365,7 +5365,6 @@ nbctl_client(const char *socket_name, break; VLOG_OPTION_HANDLERS - TABLE_OPTION_HANDLERS(&table_style) case OPT_LOCAL: default: diff --git a/tests/ovn-nbctl.at b/tests/ovn-nbctl.at index 7d627cdc0..3f89874ba 100644 --- a/tests/ovn-nbctl.at +++ b/tests/ovn-nbctl.at @@ -1530,3 +1530,12 @@ name : "sw1" AT_CHECK([ovn-nbctl --columns=name list logical_switch sw1], [0], [dnl name : "sw1" ])]) + +OVN_NBCTL_TEST([ovn_nbctl_table_formatting], [table formatting], [ +dnl This test addresses a specific issue seen when running ovn-nbctl in +dnl daemon mode. We need to ensure that table formatting options are honored +dnl when listing database information. +AT_CHECK([ovn-nbctl ls-add sw1], [0], [ignore]) +AT_CHECK([ovn-nbctl --bare --columns=name list logical_switch sw1], [0], [dnl +sw1 +])])