ifcfg-rh writer: do not set TYPE for team ports (rh #1074160)

Notes and changes by jklimes:
- fix reading TeamPort without TYPE=Ethernet
- fix tests
Ideally this should be solved on initscripts side. But teamd doesn't want to do
any changes to initscripts, so we make a workaround here.

https://bugzilla.redhat.com/show_bug.cgi?id=1074160
This commit is contained in:
Jiri Pirko 2014-03-10 10:45:14 +01:00 committed by Jiří Klimeš
parent 4112bda940
commit 8bed556019
3 changed files with 5 additions and 0 deletions

View file

@ -4999,6 +4999,8 @@ connection_from_file (const char *filename,
if (devtype) {
if (!strcasecmp (devtype, TYPE_TEAM))
type = g_strdup (TYPE_TEAM);
else if (!strcasecmp (devtype, TYPE_TEAM_PORT))
type = g_strdup (TYPE_ETHERNET);
g_free (devtype);
}

View file

@ -13517,6 +13517,8 @@ test_write_team_port (void)
g_assert (success);
/* re-read the file to check that what key was written. */
val = svGetValue (f, "TYPE", FALSE);
g_assert (!val);
val = svGetValue (f, "DEVICETYPE", FALSE);
g_assert (val);
g_assert_cmpstr (val, ==, "TeamPort");

View file

@ -1742,6 +1742,7 @@ write_connection_setting (NMSettingConnection *s_con, shvarFile *ifcfg)
else if (nm_setting_connection_is_slave_type (s_con, NM_SETTING_TEAM_SETTING_NAME)) {
svSetValue (ifcfg, "TEAM_MASTER", master, FALSE);
svSetValue (ifcfg, "DEVICETYPE", TYPE_TEAM_PORT, FALSE);
svSetValue (ifcfg, "TYPE", NULL, FALSE);
}
}