-
Notifications
You must be signed in to change notification settings - Fork 34
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
Sets DHCLIENT_SET_HOSTNAME based on linuxrc or from the control file (bsc#1054933) #564
Conversation
fc2df1b
to
3d58a33
Compare
package/yast2-network.changes
Outdated
@@ -1,4 +1,14 @@ | |||
------------------------------------------------------------------- | |||
Tue Sep 26 12:44:47 UTC 2017 - knut.anderssen@suse.com | |||
|
|||
- Preloads the global DHCLIENT_SET_HOSTNAME option based on linuxrc |
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.
"Preload" (same verbe tense than "Do not override").
@@ -5,8 +5,15 @@ class SetupDhcp | |||
include Singleton | |||
include Logger | |||
|
|||
def initialize | |||
Yast.import "Linuxrc" |
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 usually move Yast.import
to the same place than require
calls.
@@ -17,5 +24,39 @@ def main | |||
# warning: possibly useless use of a literal in void context | |||
:next | |||
end | |||
|
|||
# Check if set of DHCLIENT_SET_HOSTNAME in /etc/sysconfig/network/dhcp has | |||
# been disable by linuxrc cmdline |
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.
NP: @return [Boolean]
test/inst_setup_dhcp_test.rb
Outdated
before do | ||
allow(Yast::NetworkInterfaces).to receive(:adapt_old_config!) | ||
end | ||
let(:subject) { Yast::SetupDhcp.instance } |
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.
Please, use subject
instead of let(:subject)
test/inst_setup_dhcp_test.rb
Outdated
end | ||
|
||
describe "set_dhcp_hostname?" do | ||
let(:set_hostname) { "1" } |
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.
NP: you could move this to context where it applies, to make it clearer.
Basically, it sets the DHCLIENT_SET_HOSTNAME in /etc/sysconfig/network/dhcp based on linuxrc cmdline sethostname option if provided or obtains the default from the control file if not.
https://github.com/yast/skelcd-control-SLES/blob/master/control/control.SLES.xml#L21
Screenshot after inst_setup_dhcp client (just after wellcome screen)
Screenshot after manual installation without special linuxrc cmdline options
CaaSP 2.0 Manual Network config
Notes and tricks
The libvirt network config used for the host:
The tests have been done with a modified CaaSP iso with last linuxrc modification and also modified with a DUD containing this code.
Replace widget instead of just the Items to show the complete interface name