ifcfg-rh: add support for NM_SETTING_CONNECTION_AUTOCONNECT_PRIORITY
Signed-off-by: Thomas Haller <thaller@redhat.com>
This commit is contained in:
@@ -169,8 +169,14 @@ make_connection_setting (const char *file,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Missing ONBOOT is treated as "ONBOOT=true" by the old network service */
|
/* Missing ONBOOT is treated as "ONBOOT=true" by the old network service */
|
||||||
g_object_set (s_con, NM_SETTING_CONNECTION_AUTOCONNECT,
|
g_object_set (s_con,
|
||||||
|
NM_SETTING_CONNECTION_AUTOCONNECT,
|
||||||
svTrueValue (ifcfg, "ONBOOT", TRUE),
|
svTrueValue (ifcfg, "ONBOOT", TRUE),
|
||||||
|
NM_SETTING_CONNECTION_AUTOCONNECT_PRIORITY,
|
||||||
|
(gint) svGetValueInt64 (ifcfg, "AUTOCONNECT_PRIORITY", 10,
|
||||||
|
NM_SETTING_CONNECTION_AUTOCONNECT_PRIORITY_MIN,
|
||||||
|
NM_SETTING_CONNECTION_AUTOCONNECT_PRIORITY_MAX,
|
||||||
|
NM_SETTING_CONNECTION_AUTOCONNECT_PRIORITY_DEFAULT),
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
value = svGetValue (ifcfg, "USERS", FALSE);
|
value = svGetValue (ifcfg, "USERS", FALSE);
|
||||||
|
@@ -3,6 +3,7 @@ DEVICE=eth2
|
|||||||
HWADDR=00:16:41:11:22:33
|
HWADDR=00:16:41:11:22:33
|
||||||
NM_CONTROLLED=yes
|
NM_CONTROLLED=yes
|
||||||
BOOTPROTO=dhcp
|
BOOTPROTO=dhcp
|
||||||
|
AUTOCONNECT_PRIORITY=-1
|
||||||
ESSID=blahblah
|
ESSID=blahblah
|
||||||
CHANNEL=1
|
CHANNEL=1
|
||||||
MODE=Managed
|
MODE=Managed
|
||||||
|
@@ -2910,6 +2910,8 @@ test_read_wifi_open (void)
|
|||||||
NM_SETTING_CONNECTION_SETTING_NAME,
|
NM_SETTING_CONNECTION_SETTING_NAME,
|
||||||
NM_SETTING_CONNECTION_AUTOCONNECT);
|
NM_SETTING_CONNECTION_AUTOCONNECT);
|
||||||
|
|
||||||
|
g_assert_cmpint (nm_setting_connection_get_autoconnect_priority (s_con), ==, -1);
|
||||||
|
|
||||||
/* ===== WIRELESS SETTING ===== */
|
/* ===== WIRELESS SETTING ===== */
|
||||||
|
|
||||||
s_wireless = nm_connection_get_setting_wireless (connection);
|
s_wireless = nm_connection_get_setting_wireless (connection);
|
||||||
|
@@ -1664,6 +1664,7 @@ write_connection_setting (NMSettingConnection *s_con, shvarFile *ifcfg)
|
|||||||
GString *str;
|
GString *str;
|
||||||
const char *master;
|
const char *master;
|
||||||
char *tmp;
|
char *tmp;
|
||||||
|
gint i_int;
|
||||||
|
|
||||||
svSetValue (ifcfg, "NAME", nm_setting_connection_get_id (s_con), FALSE);
|
svSetValue (ifcfg, "NAME", nm_setting_connection_get_id (s_con), FALSE);
|
||||||
svSetValue (ifcfg, "UUID", nm_setting_connection_get_uuid (s_con), FALSE);
|
svSetValue (ifcfg, "UUID", nm_setting_connection_get_uuid (s_con), FALSE);
|
||||||
@@ -1672,6 +1673,12 @@ write_connection_setting (NMSettingConnection *s_con, shvarFile *ifcfg)
|
|||||||
nm_setting_connection_get_autoconnect (s_con) ? "yes" : "no",
|
nm_setting_connection_get_autoconnect (s_con) ? "yes" : "no",
|
||||||
FALSE);
|
FALSE);
|
||||||
|
|
||||||
|
i_int = nm_setting_connection_get_autoconnect_priority (s_con);
|
||||||
|
tmp = i_int != NM_SETTING_CONNECTION_AUTOCONNECT_PRIORITY_DEFAULT
|
||||||
|
? g_strdup_printf ("%d", i_int) : NULL;
|
||||||
|
svSetValue (ifcfg, "AUTOCONNECT_PRIORITY", tmp, FALSE);
|
||||||
|
g_free (tmp);
|
||||||
|
|
||||||
/* Permissions */
|
/* Permissions */
|
||||||
svSetValue (ifcfg, "USERS", NULL, FALSE);
|
svSetValue (ifcfg, "USERS", NULL, FALSE);
|
||||||
n = nm_setting_connection_get_num_permissions (s_con);
|
n = nm_setting_connection_get_num_permissions (s_con);
|
||||||
|
Reference in New Issue
Block a user