-
Notifications
You must be signed in to change notification settings - Fork 837
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
Fix Gentoo hostname bug #611
Conversation
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.
It does look good to me.
Gentoo's hostname file format instead of being just the host name is hostname=thename". The old code works fine when the file has no comments but if there is a comment the line ``` gentoo_hostname_config = 'hostname="%s"' % conf ``` can render an invalid hostname file that looks similar to ``` hostname="#This is the host namehello" ``` The fix inserts the hostname in a gentoo friendly way so that it gets handled by HostnameConf as a whole and comments are handled and preserved
5e707dc
to
4ec8df8
Compare
Re-based branch and fixed flake8 issue |
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, thanks!
@@ -13,6 +13,7 @@ johnsonshi | |||
jqueuniet | |||
landon912 | |||
lucasmoura | |||
manuelisimo |
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.
I've confirmed this signature internally, thanks!
|
||
# Many distro's format is the hostname by itself, and that is the | ||
# way HostnameConf works but gentoo expects it to be in | ||
# hostname="the-actual-hostname" |
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.
Gentoo's hostname file format instead of being just the host name by itself is
hostname="thename"
. The existing code works fine when the file has no comments but if there is a comment, then the line:can render an invalid hostname file that looks similar to
The fix calls
set_hostname
with the parameter in a gentoo friendly way so that it gets handled by HostnameConf as a whole, and comments are handled and preserved