Add failure for missing interface
This will fail with a useful error message in case the interface we are trying to get an address for does not exist. Currently the user will only get an unspecific "undefined method [] for nil" error. Change-Id: I392564324fb5203df3ce390aff990ff976058320
This commit is contained in:
parent
f6ab635369
commit
fe58d5394e
|
@ -37,6 +37,7 @@ module ::Openstack
|
|||
return '0.0.0.0'
|
||||
end
|
||||
end
|
||||
fail "Interface #{interface} does not exist" unless nodeish['network']['interfaces'][interface]
|
||||
addresses = nodeish['network']['interfaces'][interface]['addresses']
|
||||
fail "Interface #{interface} has no addresses assigned" if addresses.to_a.empty?
|
||||
get_address addresses, family, drop_vips
|
||||
|
|
Loading…
Reference in New Issue