mirror of
https://github.com/OpenNebula/one.git
synced 2025-01-08 21:17:43 +03:00
M #-: Skip null values from Equinix response (#1348)
It can happen that Equinix API responses contain null values for certain attributes (e.g. "facility":null). This fix avoids the provision crashes with this error "[one.vn.allocate] undefined method `each_pair' for nil:NilClass" when creating the packet-cluster-public network. Signed-off-by: Ricardo Diaz <rdiaz@opennebula.io>
This commit is contained in:
parent
72e3b47efd
commit
b900491a9a
@ -24,6 +24,7 @@ module Packet
|
||||
|
||||
def update_attributes(attributes = {})
|
||||
attributes.each_pair do |attribute, value|
|
||||
next if value.nil?
|
||||
setter = "#{attribute}="
|
||||
send(setter, _cast_value(attribute, value)) if respond_to?(setter)
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user