Skip to content

Commit

Permalink
Fix AutoYaST dhcp_hostname config
Browse files Browse the repository at this point in the history
  • Loading branch information
teclator committed Mar 19, 2020
1 parent f35d96e commit 0c622ac
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/lib/y2network/autoinst/hostname_reader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def initialize(section)
# @return [Hostname] the imported {Hostname} config
def config
Y2Network::Hostname.new(
dhcp_hostname: section.dhcp_hostname,
dhcp_hostname: section.dhcp_hostname ? :any : :none,
static: static_hostname,
installer: section.hostname
)
Expand Down
5 changes: 4 additions & 1 deletion test/y2network/autoinst/config_reader_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@
"ipv4_forward" => true,
"ipv6_forward" => false,
"routes" => routes
}
},
"dns" => dns
}
end

Expand All @@ -67,6 +68,8 @@
expect(subject.config).to be_a Y2Network::Config
expect(subject.config.routing).to be_a Y2Network::Routing
expect(subject.config.dns).to be_a Y2Network::DNS
expect(subject.config.hostname.dhcp_hostname).to eq(:any)
expect(subject.config.hostname.installer).to eq("host")
end
end
end
4 changes: 2 additions & 2 deletions test/y2network/autoinst/hostname_reader_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
{
"dns" => {
"hostname" => "host",
"dhcp_hostname" => true, "write_hostname" => true
"dhcp_hostname" => false, "write_hostname" => true
}
}
end
Expand All @@ -50,7 +50,7 @@
config = subject.config
expect(config).to be_a Y2Network::Hostname
expect(config.installer).to eq("host")
expect(config.dhcp_hostname).to eq(true)
expect(config.dhcp_hostname).to eq(:none)
expect(config.static).to eq(current_static_hostname)
end
end
Expand Down

0 comments on commit 0c622ac

Please sign in to comment.