From 5875e17769bb237d81193643c95f4fc85ad446aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Tue, 28 May 2013 16:26:00 +0200 Subject: [PATCH] ifcfg-rh: ignore team connections until we support team devices (rh #968268) https://fedorahosted.org/libteam/ team connections are marked by DEVICETYPE="Team" or DEVICETYPE="TeamPort" --- src/settings/plugins/ifcfg-rh/common.h | 2 ++ src/settings/plugins/ifcfg-rh/reader.c | 22 +++++++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/settings/plugins/ifcfg-rh/common.h b/src/settings/plugins/ifcfg-rh/common.h index fc8ce22a54..9f288631e7 100644 --- a/src/settings/plugins/ifcfg-rh/common.h +++ b/src/settings/plugins/ifcfg-rh/common.h @@ -47,6 +47,8 @@ #define TYPE_BRIDGE "Bridge" #define TYPE_BOND "Bond" #define TYPE_VLAN "Vlan" +#define TYPE_TEAM "Team" +#define TYPE_TEAM_PORT "TeamPort" #define SECRET_FLAG_AGENT "user" #define SECRET_FLAG_NOT_SAVED "ask" diff --git a/src/settings/plugins/ifcfg-rh/reader.c b/src/settings/plugins/ifcfg-rh/reader.c index 961bd938cb..d2ac1b6888 100644 --- a/src/settings/plugins/ifcfg-rh/reader.c +++ b/src/settings/plugins/ifcfg-rh/reader.c @@ -4184,7 +4184,7 @@ connection_from_file (const char *filename, { NMConnection *connection = NULL; shvarFile *parsed; - char *type, *nmc = NULL, *bootproto; + char *type, *devtype, *nmc = NULL, *bootproto; NMSetting *s_ip4, *s_ip6, *s_port; const char *ifcfg_name = NULL; gboolean nm_controlled = TRUE; @@ -4222,6 +4222,26 @@ connection_from_file (const char *filename, return NULL; } + /* + * Ignore Team connections for now; we don't support team yet. + * https://fedorahosted.org/libteam/ + */ + devtype = svGetValue (parsed, "DEVICETYPE", FALSE); + if (devtype) { + if ( !strcasecmp (devtype, TYPE_TEAM) + || !strcasecmp (devtype, TYPE_TEAM_PORT)) { + char *base_name = g_path_get_basename (filename); + g_set_error (&error, IFCFG_PLUGIN_ERROR, 0, + "Ignoring team (DEVICETYPE=\"%s\") connection '%s'; teaming is not supported yet", + devtype, + base_name); + g_free (base_name); + g_free (devtype); + goto done; + } + g_free (devtype); + } + type = svGetValue (parsed, "TYPE", FALSE); if (!type) { char *device;