Skip to content
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

network: create systemd .link files for ifname= boot options (#1695894) #1940

Conversation

rvykydal
Copy link
Contributor

@rvykydal rvykydal commented Apr 8, 2019

We can't rely on initscripts renaming a device based on DEVICE and HWADDR
values in ifcfg file as initscripts may not be installed. Instead, use systemd
.link configuration file mechanism.

We can't rely on initscripts renaming a device based on DEVICE and HWADDR
values in ifcfg file as initscripts may not be installed. Instead, use systemd
.link configuration file mechanism.
Copy link
Contributor

@poncovka poncovka left a comment

Choose a reason for hiding this comment

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

Looks good to me. Thanks!

Copy link
Member

@jkonecny12 jkonecny12 left a comment

Choose a reason for hiding this comment

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

Looks good to me. I just have one small idea for improvement below.

for ifname_value in ifname_option_values:
iface, mac = ifname_value.split(":", 1)
content = self.INTERFACE_RENAME_FILE_CONTENT_TEMPLATE.format(mac, iface)
file_path = self.INTERFACE_RENAME_FILE_TEMPLATE.format(iface)
Copy link
Member

Choose a reason for hiding this comment

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

Just an idea.
Wouldn't it be better to have methods to create a string from these templates. These methods could have a documented arguments so it would be easier to not miss {} in a templates.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'd do it if/when the function will have more than one caller. For now I think it is ok.

@rvykydal rvykydal merged commit bbefb2a into rhinstaller:f30-devel Apr 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants