mirror of
https://github.com/openvswitch/ovs
synced 2025-08-31 06:15:47 +00:00
db-ctl-base: Don't die in cmd_remove() 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:
committed by
Ben Pfaff
parent
0268e922e2
commit
1c4f051bee
@@ -1582,18 +1582,19 @@ cmd_remove(struct ctl_context *ctx)
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
ctl_fatal("%s", error);
|
||||
ctx->error = error;
|
||||
return;
|
||||
}
|
||||
}
|
||||
ovsdb_datum_subtract(&old, type, &rm, &rm_type);
|
||||
ovsdb_datum_destroy(&rm, &rm_type);
|
||||
}
|
||||
if (old.n < type->n_min) {
|
||||
ctl_fatal("\"remove\" operation would put %u %s in column %s of "
|
||||
"table %s but the minimum number is %u",
|
||||
old.n,
|
||||
ctl_error(ctx, "\"remove\" operation would put %u %s in column %s of "
|
||||
"table %s but the minimum number is %u", old.n,
|
||||
type->value.type == OVSDB_TYPE_VOID ? "values" : "pairs",
|
||||
column->name, table->name, type->n_min);
|
||||
return;
|
||||
}
|
||||
ovsdb_idl_txn_verify(row, column);
|
||||
ovsdb_idl_txn_write(row, column, &old);
|
||||
|
Reference in New Issue
Block a user