ifcfg-rh: read/write zone name from/to ZONE key

This commit is contained in:
Jiri Popelka 2011-10-07 15:58:06 +02:00 committed by Dan Williams
parent 04c8ec7360
commit 3e11682ddc
2 changed files with 13 additions and 1 deletions

View file

@ -85,7 +85,7 @@ make_connection_setting (const char *file,
{
NMSettingConnection *s_con;
const char *ifcfg_name = NULL;
char *new_id = NULL, *uuid = NULL, *value;
char *new_id = NULL, *uuid = NULL, *zone = NULL, *value;
char *ifcfg_id;
ifcfg_name = utils_get_ifcfg_name (file, TRUE);
@ -127,6 +127,7 @@ make_connection_setting (const char *file,
g_free (uuid);
uuid = nm_utils_uuid_generate_from_string (ifcfg->fileName);
}
g_object_set (s_con,
NM_SETTING_CONNECTION_TYPE, type,
NM_SETTING_CONNECTION_UUID, uuid,
@ -153,6 +154,15 @@ make_connection_setting (const char *file,
g_strfreev (items);
}
zone = svGetValue(ifcfg, "ZONE", FALSE);
if (!zone || !strlen (zone)) {
g_free (zone);
zone = NULL;
}
g_object_set (s_con, NM_SETTING_CONNECTION_ZONE, zone, NULL);
g_free (zone);
return NM_SETTING (s_con);
}

View file

@ -1097,6 +1097,8 @@ write_connection_setting (NMSettingConnection *s_con, shvarFile *ifcfg)
svSetValue (ifcfg, "USERS", str->str, FALSE);
g_string_free (str, TRUE);
}
svSetValue (ifcfg, "ZONE", nm_setting_connection_get_zone(s_con), FALSE);
}
static gboolean