-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
nmcli: avoid changed status for most cases with VPN connections (#5126)
* nmcli: avoid changed status for most cases with VPN connections Follow-up #4746 * `nmcli connection show` includes vpn.service-type but not vpn-type. Switching to vpn.service-type removes unneeded diffs while keeping the same functionality, as vpn-type is an alias of vpn.service-type per nm-settings-nmcli(1). NetworkManager also adds `org.freedesktop.NetworkManager.` prefix for known VPN types [1]. The logic is non-trivial so I didn't implement it in this commit. If a user specifies `service-type: l2tp`, changed will be always be True: - "vpn.service-type": "org.freedesktop.NetworkManager.l2tp" + "vpn.service-type": "l2tp" * The vpn.data field from `nmcli connection show` is sorted by keys and there are spaces around equal signs. I added codes for parsing such data. Tests are also updated to match outputs of nmcli commands. [1] https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/blob/1.38.4/src/libnm-core-impl/nm-vpn-plugin-info.c#L619 * Add changelog * Some suggested changes * Make space stripping more flexible - works for cases without equal signs. * Keep vpn.data in a test case with no spaces * nmcli: allow any string for vpn service-type
- Loading branch information
Chih-Hsuan Yen
authored
Sep 3, 2022
1 parent
7ffe653
commit 6ff594b
Showing
3 changed files
with
13 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
bugfixes: | ||
- "nmcli - avoid changed status for most cases with VPN connections (https://github.com/ansible-collections/community.general/pull/5126)." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters