Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions coriolis/osmorphing/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -640,10 +640,13 @@ def _set_grub2_console_settings(self, consoles=None, speed=None,

def _add_net_udev_rules(self, net_ifaces_info):
udev_file = "etc/udev/rules.d/70-persistent-net.rules"
if not self._test_path(udev_file):
if net_ifaces_info:
content = utils.get_udev_net_rules(net_ifaces_info)
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):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need to write to the original file anymore, we can simply use the custom one. Please write directly to that.

self._write_file_sudo(udev_file, content)
else:
self._write_file_sudo(coriolis_udev_rules_file, content)

def _setup_network_preservation(self, nics_info) -> None:
net_ifaces_info = dict()
Expand Down
Loading