diff --git a/lib/fog/openstack/models/compute/metadata.rb b/lib/fog/openstack/models/compute/metadata.rb index 0630c64d2..070473ec5 100644 --- a/lib/fog/openstack/models/compute/metadata.rb +++ b/lib/fog/openstack/models/compute/metadata.rb @@ -34,12 +34,12 @@ module Fog def update(data=nil) requires :parent - service.update_metadata(collection_name, @parent.id, meta_hash(data)) + service.update_metadata(collection_name, @parent.id, to_hash(data)) end def set(data=nil) requires :parent - service.set_metadata(collection_name, @parent.id, meta_hash(data)) + service.set_metadata(collection_name, @parent.id, to_hash(data)) end def new(attributes = {}) @@ -47,8 +47,7 @@ module Fog super({ :parent => @parent }.merge!(attributes)) end - private - def meta_hash(data=nil) + def to_hash(data=nil) if data.nil? data={} self.each do |meta|