[ovs-dev] [PATCH 27/30] ovn-nbctl: Don't die in nbctl_lrp_set_enabled().

Jakub Sitnicki jkbs at redhat.com
Sat Jul 7 11:10:01 UTC 2018


Propagate the error via the context instead.

Signed-off-by: Jakub Sitnicki <jkbs at redhat.com>
---
 ovn/utilities/ovn-nbctl.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/ovn/utilities/ovn-nbctl.c b/ovn/utilities/ovn-nbctl.c
index 1591ce47d..a64df51a0 100644
--- a/ovn/utilities/ovn-nbctl.c
+++ b/ovn/utilities/ovn-nbctl.c
@@ -3672,7 +3672,8 @@ nbctl_lrp_set_enabled(struct ctl_context *ctx)
 
     char *error = lrp_by_name_or_uuid(ctx, id, true, &lrp);
     if (error) {
-        ctl_fatal("%s", error);
+        ctx->error = error;
+        return;
     }
     if (!lrp) {
         return;
@@ -3681,7 +3682,8 @@ nbctl_lrp_set_enabled(struct ctl_context *ctx)
     bool enabled;
     error = parse_enabled(state, &enabled);
     if (error) {
-        ctl_fatal("%s", error);
+        ctx->error = error;
+        return;
     }
     nbrec_logical_router_port_set_enabled(lrp, &enabled, 1);
 }
-- 
2.14.4



More information about the dev mailing list