From patchwork Fri Jun 26 19:48:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Pfaff X-Patchwork-Id: 1318006 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.133; helo=hemlock.osuosl.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 hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49tnWZ0M94z9sQx for ; Sat, 27 Jun 2020 05:48:57 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 398218885A; Fri, 26 Jun 2020 19:48:55 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yN3Kxoz2KsUW; Fri, 26 Jun 2020 19:48:54 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by hemlock.osuosl.org (Postfix) with ESMTP id B227C886EF; Fri, 26 Jun 2020 19:48:54 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 8B63BC088C; Fri, 26 Jun 2020 19:48:54 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 5B47EC016F for ; Fri, 26 Jun 2020 19:48:53 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 5762088808 for ; Fri, 26 Jun 2020 19:48:53 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id D3zG-yVXRktW for ; Fri, 26 Jun 2020 19:48:51 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by hemlock.osuosl.org (Postfix) with ESMTPS id 23C29886EF for ; Fri, 26 Jun 2020 19:48:50 +0000 (UTC) X-Originating-IP: 75.54.222.30 Received: from sigfpe.attlocal.net (75-54-222-30.lightspeed.rdcyca.sbcglobal.net [75.54.222.30]) (Authenticated sender: blp@ovn.org) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 9C3DE60003; Fri, 26 Jun 2020 19:48:48 +0000 (UTC) From: Ben Pfaff To: dev@openvswitch.org Date: Fri, 26 Jun 2020 12:48:37 -0700 Message-Id: <20200626194837.1375024-1-blp@ovn.org> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Cc: Ben Pfaff Subject: [ovs-dev] [PATCH ovn] ovn-northd: Make it harder to specify a bad database remote. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" Without this change, --ovnnb-db='' produces bad results, such as an assertion failure. With it, ovn-northd uses the default database. The latter seems preferable. Similarly for --ovnsb-db=''. Signed-off-by: Ben Pfaff Acked-by: Numan Siddique --- northd/ovn-northd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/northd/ovn-northd.c b/northd/ovn-northd.c index 784f33b6861c..d586c12eabb0 100644 --- a/northd/ovn-northd.c +++ b/northd/ovn-northd.c @@ -11697,11 +11697,11 @@ parse_options(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) } } - if (!ovnsb_db) { + if (!ovnsb_db || !ovnsb_db[0]) { ovnsb_db = default_sb_db(); } - if (!ovnnb_db) { + if (!ovnnb_db || !ovnnb_db[0]) { ovnnb_db = default_nb_db(); }