Skip to content

Commit

Permalink
fail with useful error on unmatched interface (bsc#990745)
Browse files Browse the repository at this point in the history
If we fail to find an interface matching a pattern such as "+10g1"
for a given node, don't proceed blindly, but instead bail with a
helpful error message.

This helps more quickly identify incorrectly configured network.json
files, and was experienced in a scenario where the Crowbar nodes were a
mix of physical machines and VMs with slow virtio interfaces.

https://bugzilla.suse.com/show_bug.cgi?id=990745
  • Loading branch information
Adam Spiers committed Jul 27, 2016
1 parent 5cc6c6d commit 1b13bda
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion chef/cookbooks/barclamp/libraries/barclamp_library.rb
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,11 @@ def self.build_node_map(node)
v.each do |mk, mv|
if mk == "if_list"
hash["if_list"] = v["if_list"].map do |if_ref|
map_if_ref(if_remap, if_ref)
r = map_if_ref(if_remap, if_ref)
if r.nil?
raise "Unable to find interface for #{node.fqdn} matching #{if_ref} out of #{if_remap}"
end
r
end
else
hash[mk] = mv
Expand Down

0 comments on commit 1b13bda

Please sign in to comment.