Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

handle explicit null dns setting

Used by micro bosh deployer
  • Loading branch information...
commit a683a689763c682acab95a6456a31bc6e7af506e 1 parent f14cb82
Alex Jackson and Vinicius Fuentes authored
View
2  bosh_agent/lib/bosh_agent/platform/linux/network.rb
@@ -53,7 +53,7 @@ def setup_networking_from_settings
def dns
default_dns_network = networks.values.detect do |settings|
- settings.fetch('default', []).include?('dns') && settings.has_key?("dns")
+ settings.fetch('default', []).include?('dns') && settings["dns"]
end
default_dns_network ? default_dns_network["dns"] : []
end
View
20 bosh_agent/spec/unit/platform/linux/network_spec.rb
@@ -16,6 +16,20 @@ def write_network_interfaces
end
end
+ let(:microbosh_network) do
+ {
+ "netmask" => "255.255.248.0",
+ "mac" => "00:50:56:89:17:70",
+ "ip" => "172.30.40.115",
+ "default" => ["gateway", "dns"],
+ "gateway" => nil,
+ "dns" => nil,
+ "cloud_properties" => {
+ "name" => "VLAN440"
+ }
+ }
+ end
+
let(:complete_network) do
{
"netmask" => "255.255.248.0",
@@ -101,6 +115,12 @@ def write_network_interfaces
network_wrapper.dns.should == []
end
+ it "does not parse DNS when DNS config is explicitly null" do
+ complete_settings["networks"]["network_a"] = microbosh_network
+
+ network_wrapper.dns.should == []
+ end
+
it "parses dns from network settings" do
network_wrapper.dns.should == ["172.30.22.153", "172.30.22.154"]
end
Please sign in to comment.
Something went wrong with that request. Please try again.