Don't warn about failure to apply changes on inactive device

If the NMDevice is not active (i.e. if we are editing a connection that
is not active) then don't warn when failing to reapply changes to the
device. That's expected and not something we should warn about.

We could perhaps not even try, but the device could become inactive
between the time of our check and this error, so better ignore the error
regardless.
This commit is contained in:
Michael Catanzaro 2023-08-25 10:41:16 -05:00 committed by Felipe Borges
parent 60b4956c05
commit be535df39b

View file

@ -213,6 +213,7 @@ device_reapply_cb (GObject *source_object,
gboolean success = TRUE;
if (!nm_device_reapply_finish (NM_DEVICE (source_object), res, &error)) {
if (!g_error_matches (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_NOT_ACTIVE))
g_warning ("Failed to reapply changes on device: %s", error->message);
success = FALSE;
}