Skip to content

Commit

Permalink
fail with useful error on unmatched admin interface (bsc#990745)
Browse files Browse the repository at this point in the history
Catch the case where we failed to find an admin interface for a node,
and bail with a more helpful error message.

This was experienced in a scenario where the Crowbar nodes were a mix of
physical machines and VMs with slow virtio interfaces, but the
network.json was incorrectly configured and the admin network conduit
failed to match the slow virtio interfaces.

https://bugzilla.suse.com/show_bug.cgi?id=990745
  • Loading branch information
Adam Spiers committed Jul 28, 2016
1 parent 6789b06 commit 58c7863
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions chef/cookbooks/provisioner/recipes/update_nodes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ def find_node_boot_mac_addresses(node, admin_data_net)
result = []
admin_interfaces = admin_data_net.interface_list
admin_interfaces.each do |interface|
if interface.nil?
raise "Failed to find admin node interface for node #{node.fqdn}! " \
"Check your network barclamp proposal."
end
node["network"]["interfaces"][interface]["addresses"].each do |addr, addr_data|
next if addr_data["family"] != "lladdr"
result << addr unless result.include? addr
Expand Down

0 comments on commit 58c7863

Please sign in to comment.