2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-30 22:05:19 +00:00

db-ctl-base: Don't die in cmd_add() on error.

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>
This commit is contained in:
Jakub Sitnicki
2018-07-07 13:09:35 +02:00
committed by Ben Pfaff
parent 98af55fce8
commit 192ab8d8dc

View 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);