[network-manager-openvpn/th/export-bgo764132: 23/27] properties: refactor do_export() (refactor writing "keysize")



commit c573cb77ffe25e77be5d72d96ecd00abfc204a51
Author: Thomas Haller <thaller redhat com>
Date:   Thu Mar 24 11:45:39 2016 +0100

    properties: refactor do_export() (refactor writing "keysize")

 properties/import-export.c |   14 +-------------
 1 files changed, 1 insertions(+), 13 deletions(-)
---
diff --git a/properties/import-export.c b/properties/import-export.c
index 0ad7f25..82ec495 100644
--- a/properties/import-export.c
+++ b/properties/import-export.c
@@ -1650,8 +1650,6 @@ do_export_create (NMConnection *connection, const char *path, GError **error)
        const char *connection_type;
        const char *local_ip = NULL;
        const char *remote_ip = NULL;
-       gboolean keysize_exists = FALSE;
-       guint32 keysize = 0;
        const char *proxy_type = NULL;
        const char *proxy_server = NULL;
        const char *proxy_port = NULL;
@@ -1692,15 +1690,6 @@ do_export_create (NMConnection *connection, const char *path, GError **error)
 
        connection_type = _arg_is_set (nm_setting_vpn_get_data_item (s_vpn, NM_OPENVPN_KEY_CONNECTION_TYPE));
 
-       /* Advanced values start */
-       value = nm_setting_vpn_get_data_item (s_vpn, NM_OPENVPN_KEY_KEYSIZE);
-       if (_arg_is_set (value)) {
-               keysize_exists = TRUE;
-               keysize = strtol (value, NULL, 10);
-       }
-
-       /* Advanced values end */
-
        f = g_string_sized_new (512);
 
        args_write_line (f, "client");
@@ -1800,8 +1789,7 @@ do_export_create (NMConnection *connection, const char *path, GError **error)
 
        args_write_line_setting_value (f, "cipher", s_vpn, NM_OPENVPN_KEY_CIPHER);
 
-       if (keysize_exists)
-               args_write_line_int64 (f, "keysize", keysize);
+       args_write_line_int64_str (f, "keysize", nm_setting_vpn_get_data_item (s_vpn, 
NM_OPENVPN_KEY_KEYSIZE));
 
        if (nm_streq0 (nm_setting_vpn_get_data_item (s_vpn, NM_OPENVPN_KEY_COMP_LZO), "yes"))
                args_write_line (f, "comp-lzo", "yes");


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]