Bug 1703960 - Device.Reapply() fails if wired setting have not been explicitly set
Summary: Device.Reapply() fails if wired setting have not been explicitly set
Keywords:
Status: ON_QA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: NetworkManager
Version: 7.6
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Beniamino Galvani
QA Contact: Desktop QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-04-29 08:40 UTC by Edward Haas
Modified: 2019-10-09 15:10 UTC (History)
9 users (show)

Fixed In Version: NetworkManager-1.18.4-1.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:


Attachments (Terms of Use)

Description Edward Haas 2019-04-29 08:40:07 UTC
Description of problem:
While attempting to use `reapply` in the Nmstate project, we have found that in case the wired setting is not defined/added to the new profile, the reapply operation will fail, claiming that the mac address change is not supported.

`nm-device-error-quark: Can't reapply changes to '802-3-ethernet.cloned-mac-address' setting (3)`

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. Fetch existing profile using `get_connection_by_id`.
2. Create new profile using SimpleConnection.new()
3. Add to the new profile the wanted setting (connection and IPvX in our case) using `add_setting`. (do not include the wired setting)
4. Replace existing profile settings with the new profile setting using `replace_settings_from_connection(new_profile)`.
5. Commit the existing profile changes using `commit_changes_async`.
7. Execute reapply with the existing profile.

Actual results:
Step 7 fails with the following error:
`nm-device-error-quark: Can't reapply changes to '802-3-ethernet.cloned-mac-address' setting (3)`

Expected results:
Reapply should succeed because no wired changes have been requested.

Additional info:
Workaround: 
Fetching the wired setting from the current profile and using it in the new profile has resolved the problem.

Comment 2 Edward Haas 2019-04-29 08:41:52 UTC
Seems like Device.Reapply() doesn't normalize input connection.

Comment 3 Beniamino Galvani 2019-05-25 16:20:33 UTC
The root cause is that the ifcfg-rh settings plugin adds an empty wired setting when saving and reloading a bond/bridge/team connection. The patch at [1] should fix this issue.

[1] https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/166


Note You need to log in before you can comment on or make changes to this bug.