diff options
author | Jiří Klimeš <jklimes@redhat.com> | 2014-02-06 10:31:24 +0100 |
---|---|---|
committer | Jiří Klimeš <jklimes@redhat.com> | 2014-02-28 10:31:40 +0100 |
commit | a8e6094e403ebc4bb5de976a152cfcc57ac1a49b (patch) | |
tree | 8e12bf83ff8facee59d1e9f55c8ab8dac094aadd /cli/src | |
parent | cb680c5b54fdb5453d04e3dcdb3d33f445f00a95 (diff) | |
download | NetworkManager-a8e6094e403ebc4bb5de976a152cfcc57ac1a49b.tar.gz |
cli: allow temporary connection modification by 'nmcli con modify'
nmcli connection modify [--temporary] ...
Diffstat (limited to 'cli/src')
-rw-r--r-- | cli/src/connections.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/cli/src/connections.c b/cli/src/connections.c index 30ac2671ff..49c5dc85c0 100644 --- a/cli/src/connections.c +++ b/cli/src/connections.c @@ -268,7 +268,7 @@ usage (void) #endif " down [id | uuid | path | apath] <ID>\n\n" " add COMMON_OPTIONS TYPE_SPECIFIC_OPTIONS IP_OPTIONS\n\n" - " modify [id | uuid | path] <ID> <setting>.<property> <value>\n\n" + " modify [--temporary] [id | uuid | path] <ID> <setting>.<property> <value>\n\n" " edit [id | uuid | path] <ID>\n" " edit [type <new_con_type>] [con-name <new_con_name>]\n\n" " delete [id | uuid | path] <ID>\n\n" @@ -7825,7 +7825,7 @@ modify_connection_cb (NMRemoteConnection *connection, } static NMCResultCode -do_connection_modify (NmCli *nmc, int argc, char **argv) +do_connection_modify (NmCli *nmc, gboolean temporary, int argc, char **argv) { NMConnection *connection = NULL; NMRemoteConnection *rc = NULL; @@ -7944,9 +7944,7 @@ do_connection_modify (NmCli *nmc, int argc, char **argv) goto finish; } - nm_remote_connection_commit_changes (rc, - modify_connection_cb, - nmc); + update_connection (!temporary, rc, modify_connection_cb, nmc); finish: nmc->should_wait = (nmc->return_value == NMC_RESULT_SUCCESS); g_free (value); @@ -8265,11 +8263,18 @@ parse_cmd (NmCli *nmc, int argc, char **argv) nmc->return_value = do_connection_load (nmc, argc-1, argv+1); } else if (matches (*argv, "modify") == 0) { + gboolean temporary = FALSE; + if (nmc_arg_is_help (*(argv+1))) { usage_connection_modify (); goto usage_exit; } - nmc->return_value = do_connection_modify (nmc, argc-1, argv+1); + next_arg (&argc, &argv); + if (nmc_arg_is_option (*argv, "temporary")) { + temporary = TRUE; + next_arg (&argc, &argv); + } + nmc->return_value = do_connection_modify (nmc, temporary, argc, argv); } else { usage (); |