Message ID | 20180702105019.10345-24-jkbs@redhat.com |
---|---|
State | Accepted |
Headers | show
Return-Path: <ovs-dev-bounces@openvswitch.org> 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=<UNKNOWN>) 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 41K47c5Sjfz9s2R for <incoming@patchwork.ozlabs.org>; Mon, 2 Jul 2018 21:01:32 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 9AC41D39; Mon, 2 Jul 2018 10:51:17 +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 C8312D23 for <dev@openvswitch.org>; Mon, 2 Jul 2018 10:51:16 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 4B575674 for <dev@openvswitch.org>; Mon, 2 Jul 2018 10:51:16 +0000 (UTC) Received: by mail-wm0-f66.google.com with SMTP id v16-v6so8535671wmv.5 for <dev@openvswitch.org>; Mon, 02 Jul 2018 03:51:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=SydivZa2X1bAQF4NFD6/ldPGpJNpY3BmuoPEsLpB10k=; b=id/UXyLGDwxCwaomSALsYZSorFc6ccfR50wdXomRZsTUuYJYbSYzyjupvx8RH6qyn0 t0vGYI1PjtBpO/mhVrU4+ZK97mMm3NaZDmp/nS7rV85rheiQ2AgaO26nqgUiKmL//z8f qeLjvV1AoTVW6gjQasVWkXcRv58gFEpJExM4ZUdVaRm+4HVg3bmwNqmaRnjeIenObbeQ wQjMnh67sJjRhj7DLRScB/e/j/GTnBC+x+wiENr0sl6ohsZ359J+1ExoQ53gPWwEb2XT hAfdpCmJDqaK2PxXcODGW/0EfwxWRjZGDvGuFXnqt3V7Lh9mH2R5j/pFEf//dzvfp3sF yG1A== X-Gm-Message-State: APt69E3O5X0r2Zmk3lAj1/GL+fV0fhKThzUPscBW/LriKtks7rqMUe8j jDMVbiOrPbqAQ1KKM6/U4peNnquF4C8= X-Google-Smtp-Source: AAOMgpee5bhXjyOmvmmw6etmwT+nplFYYa6O0XXCTWgCCGS1g8bt3LHX9AgnlGyu5jUqxIYQcMj8Pw== X-Received: by 2002:a1c:f46:: with SMTP id 67-v6mr5234134wmp.122.1530528674752; Mon, 02 Jul 2018 03:51:14 -0700 (PDT) Received: from redhat.com (218.red-2-136-166.dynamicip.rima-tde.net. [2.136.166.218]) by smtp.gmail.com with ESMTPSA id r10-v6sm17564281wrm.66.2018.07.02.03.51.14 for <dev@openvswitch.org> (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 02 Jul 2018 03:51:14 -0700 (PDT) From: Jakub Sitnicki <jkbs@redhat.com> To: dev@openvswitch.org Date: Mon, 2 Jul 2018 12:50:19 +0200 Message-Id: <20180702105019.10345-24-jkbs@redhat.com> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180702105019.10345-1-jkbs@redhat.com> References: <20180702105019.10345-1-jkbs@redhat.com> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE 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 23/23] db-ctl-base: Don't die in cmd_destroy() on error. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: <ovs-dev.openvswitch.org> List-Unsubscribe: <https://mail.openvswitch.org/mailman/options/ovs-dev>, <mailto:ovs-dev-request@openvswitch.org?subject=unsubscribe> List-Archive: <http://mail.openvswitch.org/pipermail/ovs-dev/> List-Post: <mailto:ovs-dev@openvswitch.org> List-Help: <mailto:ovs-dev-request@openvswitch.org?subject=help> List-Subscribe: <https://mail.openvswitch.org/mailman/listinfo/ovs-dev>, <mailto:ovs-dev-request@openvswitch.org?subject=subscribe> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org |
Series |
Don't use ctl_fatal() in command handlers from db-ctl-base
|
expand
|
diff --git a/lib/db-ctl-base.c b/lib/db-ctl-base.c index f5492aadb..bfec8257a 100644 --- a/lib/db-ctl-base.c +++ b/lib/db-ctl-base.c @@ -1785,11 +1785,15 @@ cmd_destroy(struct ctl_context *ctx) } if (delete_all && ctx->argc > 2) { - ctl_fatal("--all and records argument should not be specified together"); + ctl_error(ctx, "--all and records argument should not be specified " + "together"); + return; } if (delete_all && !must_exist) { - ctl_fatal("--all and --if-exists should not be specified together"); + ctl_error(ctx, "--all and --if-exists should not be specified " + "together"); + return; } if (delete_all) {
Return the error via the context instead of calling ctl_fatal() so that the caller can decide how to handle it. Signed-off-by: Jakub Sitnicki <jkbs@redhat.com> --- lib/db-ctl-base.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)