team: don't log failures to connect to teamd on error level

ensure_teamd_connection() is called from multiple spots. Sometimes
we call opportunistically without having started teamd (e.g. when on
update_connection() when generating a connection for teaming device that
was created) and handle the failure to connect gracefully.

Let's not pollute the logs with things on ERROR level that are not
actually serious. Demote the logging statement to DEBUG and log an ERROR
only when we expect ensure_teamd_connection() to actually succeed.
This commit is contained in:
Lubomir Rintel 2022-10-11 13:44:31 +02:00
parent 93ec6abf16
commit ad497301d0

View file

@ -168,7 +168,7 @@ ensure_teamd_connection(NMDevice *device)
priv->tdc = _tdc_connect_new(self, nm_device_get_iface(device), &error);
if (!priv->tdc) {
_LOGE(LOGD_TEAM, "failed to connect to teamd: %s", error->message);
_LOGD(LOGD_TEAM, "failed to connect to teamd: %s", error->message);
return FALSE;
}
@ -412,6 +412,8 @@ teamd_ready(NMDeviceTeam *self)
* device activation.
*/
success = ensure_teamd_connection(device);
if (!success)
_LOGE(LOGD_TEAM, "Could not connect to teamd");
if (nm_device_get_state(device) != NM_DEVICE_STATE_PREPARE
|| priv->stage1_state != NM_DEVICE_STAGE_STATE_PENDING)