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

Jakub Sitnicki jkbs at redhat.com
Sat Jul 7 11:10:04 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 1781bf1f8..1181cdfba 100644
--- a/ovn/utilities/ovn-nbctl.c
+++ b/ovn/utilities/ovn-nbctl.c
@@ -1360,13 +1360,15 @@ nbctl_lsp_set_type(struct ctl_context *ctx)
 
     char *error = lsp_by_name_or_uuid(ctx, id, true, &lsp);
     if (error) {
-        ctl_fatal("%s", error);
+        ctx->error = error;
+        return;
     }
     if (ovn_is_known_nb_lsp_type(type)) {
         nbrec_logical_switch_port_set_type(lsp, type);
     } else {
-        ctl_fatal("Logical switch port type '%s' is unrecognized. "
+        ctl_error(ctx, "Logical switch port type '%s' is unrecognized. "
                   "Not setting type.", type);
+        return;
     }
 }
 
-- 
2.14.4



More information about the dev mailing list