summaryrefslogtreecommitdiff
path: root/vtep
diff options
context:
space:
mode:
authorJakub Sitnicki <jkbs@redhat.com>2018-07-02 12:50:10 +0200
committerBen Pfaff <blp@ovn.org>2018-07-03 13:19:46 -0700
commit675b152e999f5c22a2949c330feb04f8e7b6b991 (patch)
treeb11420082e28a7f5fe977561ebd02e1437206b13 /vtep
parentfd26f9a2bd3d119facc45d54f24484b7a3db9221 (diff)
downloadopenvswitch-675b152e999f5c22a2949c330feb04f8e7b6b991.tar.gz
db-ctl-base: Extend ctl_context with an error message.
Prepare for the command handlers (pre_cmd_*() cmd_*() functions) to report errors by storing them in the context. Signed-off-by: Jakub Sitnicki <jkbs@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'vtep')
-rw-r--r--vtep/vtep-ctl.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/vtep/vtep-ctl.c b/vtep/vtep-ctl.c
index c89ec5034..3c5ffa745 100644
--- a/vtep/vtep-ctl.c
+++ b/vtep/vtep-ctl.c
@@ -2261,6 +2261,9 @@ run_prerequisites(struct ctl_command *commands, size_t n_commands,
vtep_ctl_context_init(&vtepctl_ctx, c, idl, NULL, NULL, NULL);
(c->syntax->prerequisites)(&vtepctl_ctx.base);
+ if (vtepctl_ctx.base.error) {
+ ctl_fatal("%s", vtepctl_ctx.base.error);
+ }
vtep_ctl_context_done(&vtepctl_ctx, c);
ovs_assert(!c->output.string);
@@ -2306,6 +2309,9 @@ do_vtep_ctl(const char *args, struct ctl_command *commands,
if (c->syntax->run) {
(c->syntax->run)(&vtepctl_ctx.base);
}
+ if (vtepctl_ctx.base.error) {
+ ctl_fatal("%s", vtepctl_ctx.base.error);
+ }
vtep_ctl_context_done_command(&vtepctl_ctx, c);
if (vtepctl_ctx.base.try_again) {
@@ -2341,6 +2347,9 @@ do_vtep_ctl(const char *args, struct ctl_command *commands,
if (c->syntax->postprocess) {
vtep_ctl_context_init(&vtepctl_ctx, c, idl, txn, vtep_global, symtab);
(c->syntax->postprocess)(&vtepctl_ctx.base);
+ if (vtepctl_ctx.base.error) {
+ ctl_fatal("%s", vtepctl_ctx.base.error);
+ }
vtep_ctl_context_done(&vtepctl_ctx, c);
}
}