[ovs-dev] [PATCH 18/30] ovn-nbctl: Don't die in nbctl_lb_del()

Jakub Sitnicki jkbs at redhat.com
Sat Jul 7 11:09:52 UTC 2018


Propagate the error via the context instead.

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

diff --git a/ovn/utilities/ovn-nbctl.c b/ovn/utilities/ovn-nbctl.c
index 894c88689..56e47c1f0 100644
--- a/ovn/utilities/ovn-nbctl.c
+++ b/ovn/utilities/ovn-nbctl.c
@@ -2183,7 +2183,8 @@ nbctl_lb_del(struct ctl_context *ctx)
 
     char *error = lb_by_name_or_uuid(ctx, id, false, &lb);
     if (error) {
-        ctl_fatal("%s", error);
+        ctx->error = error;
+        return;
     }
     if (!lb) {
         return;
@@ -2204,8 +2205,9 @@ nbctl_lb_del(struct ctl_context *ctx)
             return;
         }
         if (must_exist) {
-            ctl_fatal("vip %s is not part of the load balancer.",
-                    lb_vip);
+            ctl_error(ctx, "vip %s is not part of the load balancer.",
+                      lb_vip);
+            return;
         }
         return;
     }
-- 
2.14.4



More information about the dev mailing list