diff mbox series

[ovs-dev,26/30] ovn-nbctl: Don't die in nbctl_lrp_del_gateway_chassis().

Message ID 20180707111004.8320-27-jkbs@redhat.com
State Accepted
Headers show
Series Get rid of ctl_fatal() calls in ovn-nbctl (part 1) | expand

Commit Message

Jakub Sitnicki July 7, 2018, 11:10 a.m. UTC
Propagate the error via the context instead.

Signed-off-by: Jakub Sitnicki <jkbs@redhat.com>
---
 ovn/utilities/ovn-nbctl.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/ovn/utilities/ovn-nbctl.c b/ovn/utilities/ovn-nbctl.c
index aeb401962..1591ce47d 100644
--- a/ovn/utilities/ovn-nbctl.c
+++ b/ovn/utilities/ovn-nbctl.c
@@ -3387,7 +3387,8 @@  nbctl_lrp_del_gateway_chassis(struct ctl_context *ctx)
     const struct nbrec_logical_router_port *lrp;
     char *error = lrp_by_name_or_uuid(ctx, ctx->argv[1], true, &lrp);
     if (error) {
-        ctl_fatal("%s", error);
+        ctx->error = error;
+        return;
     }
     if (!lrp) {
         return;
@@ -3404,7 +3405,7 @@  nbctl_lrp_del_gateway_chassis(struct ctl_context *ctx)
     }
 
     /* Can't happen because of the database schema. */
-    ctl_fatal("chassis %s is not added to logical port %s",
+    ctl_error(ctx, "chassis %s is not added to logical port %s",
               chassis_name, ctx->argv[1]);
 }