summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Sitnicki <jkbs@redhat.com>2018-07-02 12:50:19 +0200
committerBen Pfaff <blp@ovn.org>2018-07-03 13:20:00 -0700
commite7cd8cfc5af02397149ef0872c172bffcdcb4e98 (patch)
treed953971dbad629dc7be02eff6714b114998927e4
parentd0adfd7756ddc627c569957febe0fdf529dc7414 (diff)
downloadopenvswitch-e7cd8cfc5af02397149ef0872c172bffcdcb4e98.tar.gz
db-ctl-base: Don't die in cmd_destroy() on error.
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> Signed-off-by: Ben Pfaff <blp@ovn.org>
-rw-r--r--lib/db-ctl-base.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/db-ctl-base.c b/lib/db-ctl-base.c
index ef35ee98c..a59ac30c4 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) {