]> git.proxmox.com Git - mirror_ovs.git/commitdiff
db-ctl-base: Don't die in cmd_add() on error.
authorJakub Sitnicki <jkbs@redhat.com>
Sat, 7 Jul 2018 11:09:35 +0000 (13:09 +0200)
committerBen Pfaff <blp@ovn.org>
Mon, 9 Jul 2018 22:45:32 +0000 (15:45 -0700)
Return the error via the context instead of calling ctl_fatal() so that
the caller can decide how to handle it.

Signed-off-by: Jakub Sitnicki <jkbs@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
lib/db-ctl-base.c

index 4af84892059bc4f610589bd4cc5fde8fea73f827..ab35d63330d181e0f09e622dc0507ed7ac2bb650 100644 (file)
@@ -1494,11 +1494,12 @@ cmd_add(struct ctl_context *ctx)
         ovsdb_datum_destroy(&add, type);
     }
     if (old.n > type->n_max) {
-        ctl_fatal("\"add\" operation would put %u %s in column %s of "
+        ctl_error(ctx, "\"add\" operation would put %u %s in column %s of "
                   "table %s but the maximum number is %u",
                   old.n,
                   type->value.type == OVSDB_TYPE_VOID ? "values" : "pairs",
                   column->name, table->name, type->n_max);
+        return;
     }
     ovsdb_idl_txn_verify(row, column);
     ovsdb_idl_txn_write(row, column, &old);