Fix/udev rules persistance of network interfaces#387
Open
BogdanEmilian wants to merge 1 commit intocloudbase:masterfrom
Open
Fix/udev rules persistance of network interfaces#387BogdanEmilian wants to merge 1 commit intocloudbase:masterfrom
BogdanEmilian wants to merge 1 commit intocloudbase:masterfrom
Conversation
Dany9966
requested changes
Jan 29, 2026
coriolis/osmorphing/base.py
Outdated
| coriolis_udev_rules_file = "etc/udev/rules.d/99-coriolis-net.rules" | ||
| if net_ifaces_info: | ||
| content = utils.get_udev_net_rules(net_ifaces_info) | ||
| if not self._test_path(udev_file): |
Contributor
There was a problem hiding this comment.
We don't need to write to the original file anymore, we can simply use the custom one. Please write directly to that.
Dany9966
requested changes
Feb 2, 2026
| @@ -639,11 +639,10 @@ def _set_grub2_console_settings(self, consoles=None, speed=None, | |||
| config_obj, execute_update_grub) | |||
|
|
|||
| def _add_net_udev_rules(self, net_ifaces_info): | |||
Contributor
There was a problem hiding this comment.
This is fine, but I noticed something weird about how net_ifaces_info is passed to this method:
https://github.com/cloudbase/coriolis/blob/master/coriolis/osmorphing/base.py#L693
That feels weird for a method to use, and really presents ambiguous usability when called upon (because of the missing type annotations or method docs, but that's not for you to fix now)
I think we should move the .items() call down the stack, maybe here: https://github.com/cloudbase/coriolis/blob/master/coriolis/utils.py#L201
Overwriting network interface udev rules Writing a file to overwrite the 70-persistent-net.rules if existing or adding if not existent Removing the system udev rules overwrite in order to use only Coriolis specific file Choosing to overwrite just the udev rules created by Coriolis as etc/udev/rules.d/99-coriolis-net.rules in order to keep the current network configuration when the deployment is done, through the reported network interface info Changing path used for the udev rules test to match the changes Changing the path used for the tests to check for changes in etc/udev/rules.d/99-coriolis-net.rules Passing the entire object through the method that adds udev rules, so that we later retrieve its items Fixing tests for new approach of how items are being retrieved for net_ifaces_info
99d2757 to
3c7c100
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Current version does not handle the case of already existing
etc/udev/rules.d/70-persistent-net.rules, so this case will add the fileetc/udev/rules.d/99-coriolis-net.rulesthat will overwrite those configurations and apply them for the interfaces.