1
0
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:
Ricardo Diaz 2021-07-06 13:34:46 +02:00 committed by GitHub
parent 72e3b47efd
commit b900491a9a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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