[PATCH 2/5] plugins/ifcfg-rh: read/write zone name from/to ZONE key
- From: Jiri Popelka <jpopelka redhat com>
- To: networkmanager-list gnome org
- Subject: [PATCH 2/5] plugins/ifcfg-rh: read/write zone name from/to ZONE key
- Date: Fri, 7 Oct 2011 15:58:06 +0200
---
src/settings/plugins/ifcfg-rh/reader.c | 12 +++++++++++-
src/settings/plugins/ifcfg-rh/writer.c | 2 ++
2 files changed, 13 insertions(+), 1 deletions(-)
diff --git a/src/settings/plugins/ifcfg-rh/reader.c b/src/settings/plugins/ifcfg-rh/reader.c
index 910cca3..0a5f5e5 100644
--- a/src/settings/plugins/ifcfg-rh/reader.c
+++ b/src/settings/plugins/ifcfg-rh/reader.c
@@ -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 = g_strdup(NM_SETTING_CONNECTION_ZONE_DEFAULT);
+ }
+ g_object_set (s_con, NM_SETTING_CONNECTION_ZONE, zone, NULL);
+ g_free (zone);
+
return NM_SETTING (s_con);
}
diff --git a/src/settings/plugins/ifcfg-rh/writer.c b/src/settings/plugins/ifcfg-rh/writer.c
index e40462e..3b23db0 100644
--- a/src/settings/plugins/ifcfg-rh/writer.c
+++ b/src/settings/plugins/ifcfg-rh/writer.c
@@ -1096,6 +1096,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
--
1.7.6.4
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]