diff options
author | Thomas Haller <thaller@redhat.com> | 2019-07-23 16:59:36 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2019-07-25 18:43:05 +0200 |
commit | 2ec7c9e86650a033536b45eea37179990f57422f (patch) | |
tree | 5a98422b1f96f658c4b5c4b61cfb16d909023fc3 | |
parent | 42613a6bca1d5a49335652ac28a156e5c1755ca0 (diff) | |
download | NetworkManager-th/settings-integration.tar.gz |
-rw-r--r-- | clients/cli/connections.c | 5 | ||||
-rw-r--r-- | src/settings/nm-settings.c | 13 | ||||
-rwxr-xr-x | w | 28 |
3 files changed, 46 insertions, 0 deletions
diff --git a/clients/cli/connections.c b/clients/cli/connections.c index 53105f957f..cf547be97b 100644 --- a/clients/cli/connections.c +++ b/clients/cli/connections.c @@ -5199,6 +5199,7 @@ do_connection_add (NmCli *nmc, int argc, char **argv) gboolean save_bool = TRUE; gboolean seen_dash_dash = FALSE; NMMetaSettingType s; + const char *env_uuid; next_arg (nmc, &argc, &argv, NULL); @@ -5291,6 +5292,10 @@ read_properties: /* For some software connection types we generate the interface name for the user. */ set_default_interface_name (nmc, s_con); + env_uuid = getenv ("NM_UUID"); + if (env_uuid) + g_object_set (s_con, NM_SETTING_CONNECTION_UUID, env_uuid, NULL); + /* Now see if there's something optional that needs to be asked for. * Keep asking until there's no more things to ask for. */ do { diff --git a/src/settings/nm-settings.c b/src/settings/nm-settings.c index 12c0f4e2ff..e5779a7d5d 100644 --- a/src/settings/nm-settings.c +++ b/src/settings/nm-settings.c @@ -1933,6 +1933,7 @@ nm_settings_update_connection (NMSettings *self, const char *uuid; gboolean tombstone_in_memory = FALSE; gboolean tombstone_on_disk = FALSE; + StorageData *sd; g_return_val_if_fail (NM_IS_SETTINGS (self), FALSE); g_return_val_if_fail (NM_IS_SETTINGS_CONNECTION (sett_conn), FALSE); @@ -1955,6 +1956,18 @@ nm_settings_update_connection (NMSettings *self, sett_conn_entry = _sett_conn_entries_get (self, uuid); + _LOGD (">>>> update connection %s: storage="NM_SETTINGS_STORAGE_PRINT_FMT", persist-mode=%d", + uuid, + NM_SETTINGS_STORAGE_PRINT_ARG (cur_storage), + (int) persist_mode); + + c_list_for_each_entry (sd, &sett_conn_entry->sd_lst_head, sd_lst) { + _LOGD (">>>> has storage: "NM_SETTINGS_STORAGE_PRINT_FMT" %s%s", + NM_SETTINGS_STORAGE_PRINT_ARG (sd->storage), + sd->connection ? "(has connection)" : "(has no connection)", + sd->prioritize ? " (prioritized)" : ""); + } + nm_assert (_sett_conn_entry_get_conn (sett_conn_entry) == sett_conn); if (connection) { @@ -0,0 +1,28 @@ +#!/bin/bash + +#set -x +set -e + +show() { + nmcli -f all connection show | grep "$UUID" || return + nmcli -o connection show id "$ID" +} + +export ID="$1" +shift; + +nmcli connection delete id "$ID" &>/dev/null || true + +sleep 1 + +nmcli connection add type ethernet con-name "$ID" autoconnect no ifname \* connection.stable-id STAB2 + +export UUID=$(nmcli -g UUID,NAME connection show | sed -n "s/:$ID$//p") + +show + +sleep 1 + +#examples/python/gi/nm-update2.py id "$ID" "$@" + +show |