Commit 68fa68b3 authored by Thomas Haller's avatar Thomas Haller

cli: rework printing of general active-connection properties

use nmc_print() for the job.

Also, localize non-terse output.

Also, fix bug with

  $ nmcli c s /org/freedesktop/NetworkManager/ActiveConnection/1

if active connection #1 is invisible to the user.

Also, previously, fill_output_active_connection() wrongly tries to
write to a field that doesn't exist:

  set_val_strc (arr, 13-idx_start, s_con ? nm_setting_connection_get_slave_type (s_con) : NULL);
parent b990cee0
This diff is collapsed.
......@@ -36,7 +36,7 @@ nmc_read_connection_properties (NmCli *nmc,
NMMetaColor nmc_active_connection_state_to_color (NMActiveConnectionState state);
extern const NmcMetaGenericInfo *const metagen_con_show[];
extern const NmcMetaGenericInfo *const nmc_fields_con_active_details_general[];
extern const NmcMetaGenericInfo *const metagen_con_active_general[];
extern const NmcMetaGenericInfo *const nmc_fields_con_active_details_vpn[];
extern const NmcMetaGenericInfo *const nmc_fields_con_active_details_groups[];
......
......@@ -189,7 +189,7 @@ complete_fields (const char *option, const char *prefix)
complete_field (h, nmc_fields_dhcp_config);
complete_field (h, nmc_fields_ip6_config);
complete_field (h, metagen_con_show);
complete_field (h, nmc_fields_con_active_details_general);
complete_field (h, metagen_con_active_general);
complete_field (h, nmc_fields_con_active_details_vpn);
complete_field (h, nmc_fields_con_active_details_groups);
complete_field (h, nmc_fields_dev_status);
......
......@@ -137,6 +137,20 @@ typedef enum {
NMC_GENERIC_INFO_TYPE_CON_SHOW_SLAVE,
_NMC_GENERIC_INFO_TYPE_CON_SHOW_NUM,
NMC_GENERIC_INFO_TYPE_CON_ACTIVE_GENERAL_NAME = 0,
NMC_GENERIC_INFO_TYPE_CON_ACTIVE_GENERAL_UUID,
NMC_GENERIC_INFO_TYPE_CON_ACTIVE_GENERAL_DEVICES,
NMC_GENERIC_INFO_TYPE_CON_ACTIVE_GENERAL_STATE,
NMC_GENERIC_INFO_TYPE_CON_ACTIVE_GENERAL_DEFAULT,
NMC_GENERIC_INFO_TYPE_CON_ACTIVE_GENERAL_DEFAULT6,
NMC_GENERIC_INFO_TYPE_CON_ACTIVE_GENERAL_SPEC_OBJECT,
NMC_GENERIC_INFO_TYPE_CON_ACTIVE_GENERAL_VPN,
NMC_GENERIC_INFO_TYPE_CON_ACTIVE_GENERAL_DBUS_PATH,
NMC_GENERIC_INFO_TYPE_CON_ACTIVE_GENERAL_CON_PATH,
NMC_GENERIC_INFO_TYPE_CON_ACTIVE_GENERAL_ZONE,
NMC_GENERIC_INFO_TYPE_CON_ACTIVE_GENERAL_MASTER_PATH,
_NMC_GENERIC_INFO_TYPE_CON_ACTIVE_GENERAL_NUM,
} NmcGenericInfoType;
#define NMC_HANDLE_COLOR(color) \
......
......@@ -2,9 +2,9 @@ location: clients/tests/test-client.py:749:test_003()/25
cmd: $NMCLI -f GENERAL.STATE con s ethernet
lang: pl_PL.UTF-8
returncode: 0
stdout: 50 bytes
stdout: 51 bytes
>>>
GENERAL.STATE: activated
GENERAL.STATE: aktywowano
<<<
stderr: 0 bytes
......
......@@ -2,7 +2,7 @@ location: clients/tests/test-client.py:752:test_003()/27
cmd: $NMCLI con s ethernet
lang: pl_PL.UTF-8
returncode: 0
stdout: 4201 bytes
stdout: 4202 bytes
>>>
connection.id: ethernet
connection.uuid: UUID-ethernet-REPLACED-REPLACED-REPL
......@@ -85,7 +85,7 @@ proxy.pac-script: --
GENERAL.NAME: ethernet
GENERAL.UUID: UUID-ethernet-REPLACED-REPLACED-REPL
GENERAL.DEVICES: eth0
GENERAL.STATE: activated
GENERAL.STATE: aktywowano
GENERAL.DEFAULT: nie
GENERAL.DEFAULT6: nie
GENERAL.SPEC-OBJECT: --
......
......@@ -2,11 +2,11 @@ location: clients/tests/test-client.py:749:test_003()/46
cmd: $NMCLI -f GENERAL.STATE con s ethernet
lang: pl_PL.UTF-8
returncode: 0
stdout: 101 bytes
stdout: 103 bytes
>>>
GENERAL.STATE: activated
GENERAL.STATE: aktywowano
GENERAL.STATE: activated
GENERAL.STATE: aktywowano
<<<
stderr: 0 bytes
......
......@@ -2,7 +2,7 @@ location: clients/tests/test-client.py:752:test_003()/48
cmd: $NMCLI con s ethernet
lang: pl_PL.UTF-8
returncode: 0
stdout: 4869 bytes
stdout: 4871 bytes
>>>
connection.id: ethernet
connection.uuid: UUID-ethernet-REPLACED-REPLACED-REPL
......@@ -85,7 +85,7 @@ proxy.pac-script: --
GENERAL.NAME: ethernet
GENERAL.UUID: UUID-ethernet-REPLACED-REPLACED-REPL
GENERAL.DEVICES: eth0
GENERAL.STATE: activated
GENERAL.STATE: aktywowano
GENERAL.DEFAULT: nie
GENERAL.DEFAULT6: nie
GENERAL.SPEC-OBJECT: --
......@@ -98,7 +98,7 @@ GENERAL.MASTER-PATH: --
GENERAL.NAME: ethernet
GENERAL.UUID: UUID-ethernet-REPLACED-REPLACED-REPL
GENERAL.DEVICES: eth1
GENERAL.STATE: activated
GENERAL.STATE: aktywowano
GENERAL.DEFAULT: nie
GENERAL.DEFAULT6: nie
GENERAL.SPEC-OBJECT: --
......
......@@ -2,7 +2,7 @@ location: clients/tests/test-client.py:796:test_003()/70
cmd: $NMCLI con s ethernet
lang: pl_PL.UTF-8
returncode: 0
stdout: 4872 bytes
stdout: 4875 bytes
>>>
connection.id: ethernet
connection.uuid: UUID-ethernet-REPLACED-REPLACED-REPL
......@@ -85,7 +85,7 @@ proxy.pac-script: --
GENERAL.NAME: ethernet
GENERAL.UUID: UUID-ethernet-REPLACED-REPLACED-REPL
GENERAL.DEVICES: eth1
GENERAL.STATE: activated
GENERAL.STATE: aktywowano
GENERAL.DEFAULT: nie
GENERAL.DEFAULT6: nie
GENERAL.SPEC-OBJECT: --
......@@ -98,7 +98,7 @@ GENERAL.MASTER-PATH: --
GENERAL.NAME: ethernet
GENERAL.UUID: UUID-ethernet-REPLACED-REPLACED-REPL
GENERAL.DEVICES: eth0
GENERAL.STATE: deactivating
GENERAL.STATE: dezaktywowanie
GENERAL.DEFAULT: nie
GENERAL.DEFAULT6: nie
GENERAL.SPEC-OBJECT: --
......
......@@ -2,7 +2,7 @@ location: clients/tests/test-client.py:799:test_003()/72
cmd: $NMCLI c s /org/freedesktop/NetworkManager/ActiveConnection/1
lang: pl_PL.UTF-8
returncode: 0
stdout: 4204 bytes
stdout: 4206 bytes
>>>
connection.id: ethernet
connection.uuid: UUID-ethernet-REPLACED-REPLACED-REPL
......@@ -85,7 +85,7 @@ proxy.pac-script: --
GENERAL.NAME: ethernet
GENERAL.UUID: UUID-ethernet-REPLACED-REPLACED-REPL
GENERAL.DEVICES: eth0
GENERAL.STATE: deactivating
GENERAL.STATE: dezaktywowanie
GENERAL.DEFAULT: nie
GENERAL.DEFAULT6: nie
GENERAL.SPEC-OBJECT: --
......
location: clients/tests/test-client.py:799:test_003()/91
cmd: $NMCLI c s /org/freedesktop/NetworkManager/ActiveConnection/1
lang: C
returncode: -6
stdout: 0 bytes
returncode: 0
stdout: 667 bytes
>>>
GENERAL.NAME: ethernet
GENERAL.UUID: UUID-ethernet-REPLACED-REPLACED-REPL
GENERAL.DEVICES: eth0
GENERAL.STATE: deactivating
GENERAL.DEFAULT: no
GENERAL.DEFAULT6: no
GENERAL.SPEC-OBJECT: --
GENERAL.VPN: no
GENERAL.DBUS-PATH: /org/freedesktop/NetworkManager/ActiveConnection/1
GENERAL.CON-PATH: /org/freedesktop/NetworkManager/Settings/Connection/3
GENERAL.ZONE: --
GENERAL.MASTER-PATH: --
<<<
stderr: 103 bytes
stderr: 0 bytes
>>>
**
nmcli:ERROR:clients/cli/connections.c:1068:fill_output_active_connection: assertion failed: (s_con)
<<<
location: clients/tests/test-client.py:799:test_003()/92
cmd: $NMCLI c s /org/freedesktop/NetworkManager/ActiveConnection/1
lang: pl_PL.UTF-8
returncode: -6
stdout: 0 bytes
returncode: 0
stdout: 672 bytes
>>>
GENERAL.NAME: ethernet
GENERAL.UUID: UUID-ethernet-REPLACED-REPLACED-REPL
GENERAL.DEVICES: eth0
GENERAL.STATE: dezaktywowanie
GENERAL.DEFAULT: nie
GENERAL.DEFAULT6: nie
GENERAL.SPEC-OBJECT: --
GENERAL.VPN: nie
GENERAL.DBUS-PATH: /org/freedesktop/NetworkManager/ActiveConnection/1
GENERAL.CON-PATH: /org/freedesktop/NetworkManager/Settings/Connection/3
GENERAL.ZONE: --
GENERAL.MASTER-PATH: --
<<<
stderr: 103 bytes
stderr: 0 bytes
>>>
**
nmcli:ERROR:clients/cli/connections.c:1068:fill_output_active_connection: assertion failed: (s_con)
<<<
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment