core/ovs: don't fail with "cancelled" reason for disconnected ovsdb

API should fail with a "cancelled" error if (and only if)
the user cancelled the operation. An error to communicate
with OVSDB or being disconnected should fail with a different
reason.
This commit is contained in:
Thomas Haller 2020-11-13 13:14:33 +01:00
parent 2983febf39
commit 8b4d77a453
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -2035,7 +2035,10 @@ ovsdb_disconnect(NMOvsdb *self, gboolean retry, gboolean is_disposing)
} else {
gs_free_error GError *error = NULL;
nm_utils_error_set_cancelled(&error, is_disposing, "NMOvsdb");
if (is_disposing)
nm_utils_error_set_cancelled(&error, is_disposing, "NMOvsdb");
else
nm_utils_error_set(&error, NM_UTILS_ERROR_NOT_READY, "disconnected from ovsdb");
while ((call = c_list_last_entry(&priv->calls_lst_head, OvsdbMethodCall, calls_lst)))
_call_complete(call, NULL, error);
}