[PR #5126/6ff594b5 backport][stable-5] nmcli: avoid changed status for most cases with VPN connections #5220
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a backport of PR #5126 as merged into main (6ff594b).
SUMMARY
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 forknown 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 willbe always be True:
nmcli connection show
is sorted by keys andthere 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
ISSUE TYPE
COMPONENT NAME
nmcli
ADDITIONAL INFORMATION
N/A