-
Notifications
You must be signed in to change notification settings - Fork 314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(nm): NMDBusConnector class refactor #4517
Conversation
e215432
to
262aca4
Compare
kura/org.eclipse.kura.nm/src/main/java/org/eclipse/kura/nm/NMDbusConnector.java
Outdated
Show resolved
Hide resolved
kura/org.eclipse.kura.nm/src/main/java/org/eclipse/kura/nm/NMDbusConnector.java
Outdated
Show resolved
Hide resolved
262aca4
to
e89a422
Compare
kura/org.eclipse.kura.nm/src/main/java/org/eclipse/kura/nm/NMDeviceAddedHandler.java
Outdated
Show resolved
Hide resolved
kura/org.eclipse.kura.nm/src/main/java/org/eclipse/kura/nm/NMDbusConnector.java
Outdated
Show resolved
Hide resolved
kura/org.eclipse.kura.nm/src/main/java/org/eclipse/kura/nm/NMDbusConnector.java
Outdated
Show resolved
Hide resolved
5e85de6
to
2cdcc76
Compare
For documentation purpose I will report here my findings on a new behaviour with this PR. I performed a couple of tests using a Telit HE910 modem. When connected this device creates an additional NetworkManager device of type PPP. When a new configuration is issued (for example disconnecting the modem) the following stacktrace appears in the log: This is due to the fact that the PPP device (which is created upon the modem connecting), disappears and its dbus path invalidated. Since we're iterating over devices here: when we get to the PPP device, it doesn't exist anymore and the DBus path is invalidated. This is all correctly handled by the code (the exception is handled and all remaining operation work as expected). No code chages are required here IMO. |
Signed-off-by: pierantoniomerlino <[email protected]>
Signed-off-by: pierantoniomerlino <[email protected]>
Signed-off-by: pierantoniomerlino <[email protected]>
Signed-off-by: pierantoniomerlino <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Signed-off-by: pierantoniomerlino <[email protected]>
Signed-off-by: pierantoniomerlino <[email protected]>
Signed-off-by: pierantoniomerlino <[email protected]>
Signed-off-by: pierantoniomerlino <[email protected]>
Signed-off-by: pierantoniomerlino <[email protected]>
Signed-off-by: pierantoniomerlino <[email protected]>
Signed-off-by: pierantoniomerlino <[email protected]>
2cdcc76
to
a472769
Compare
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-release-5.3.0 release-5.3.0
# Navigate to the new working tree
cd .worktrees/backport-release-5.3.0
# Create a new branch
git switch --create backport-4517-to-release-5.3.0
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 841a7693f9df37d804cbd9179f1b756471a1f2f0
# Push it to GitHub
git push --set-upstream origin backport-4517-to-release-5.3.0
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-release-5.3.0 Then, create a pull request where the |
* Refectored doApply method in NMDBusConnector class Signed-off-by: pierantoniomerlino <[email protected]> * Revert formatting Signed-off-by: pierantoniomerlino <[email protected]> * Fixed typo Signed-off-by: pierantoniomerlino <[email protected]> * Added method to apply config for single device Signed-off-by: pierantoniomerlino <[email protected]> * Fixed tests Signed-off-by: pierantoniomerlino <[email protected]> * Improved code readability Signed-off-by: pierantoniomerlino <[email protected]> * Updated NMDeviceAddedHandler to use apply(deviceId) Signed-off-by: pierantoniomerlino <[email protected]> * Fixed and added tests Signed-off-by: pierantoniomerlino <[email protected]> * Revert formatting Signed-off-by: pierantoniomerlino <[email protected]> * Changed parameter names Signed-off-by: pierantoniomerlino <[email protected]> * Fixed DeviceAddedHandler and modem reset Signed-off-by: pierantoniomerlino <[email protected]> --------- Signed-off-by: pierantoniomerlino <[email protected]> (cherry picked from commit 841a769)
This PR perform a refactor of the
NMDbusConnector
class. In particular, it adds theapply(String deviceId)
method that is used by theNMConfigurationEnforcementHandler
to apply the configuration to a single device/interface and it rewrites thedoApply
method in a simpler way.