team: fix wrong assertion in device-team

The assertion that priv->teamd_pid is set does not hold.

For example, if no teamd binary can be found, "Stage 1 of 5 (Device
Prepare)" fails with "Activation (nm-team) to start teamd: not found".
This causes the device state to become "failed" and later
"disconnected", which in turn calls teamd_stop without a valid teamd_pid
set.

Signed-off-by: Thomas Haller <thaller@redhat.com>
This commit is contained in:
Thomas Haller
2013-09-30 19:50:50 +02:00
parent f767e05f4a
commit d11f41a8a0

View File

@@ -473,9 +473,13 @@ teamd_start (NMDevice *dev, NMSettingTeam *s_team, NMDeviceTeamPrivate *priv)
static void
teamd_stop (NMDevice *dev, NMDeviceTeamPrivate *priv)
{
g_return_if_fail (priv->teamd_pid > 0);
nm_log_info (LOGD_TEAM, "Deactivation (%s) stopping teamd...",
nm_device_get_ip_iface (dev));
if (priv->teamd_pid > 0) {
nm_log_info (LOGD_TEAM, "Deactivation (%s) stopping teamd...",
nm_device_get_ip_iface (dev));
} else {
nm_log_dbg (LOGD_TEAM, "Deactivation (%s) stopping teamd (not started)...",
nm_device_get_ip_iface (dev));
}
teamd_cleanup (dev);
}