Sha256: cfc6cab85c7e89fafd4520453f9a8f83bafcf3d408682cafbc617746093d2c0f
Contents?: true
Size: 1.07 KB
Versions: 22
Compression:
Stored size: 1.07 KB
Contents
module Fog module OpenStack class Compute class Real def set_metadata(collection_name, parent_id, metadata = {}) request( :body => Fog::JSON.encode('metadata' => metadata), :expects => 200, :method => 'PUT', :path => "#{collection_name}/#{parent_id}/metadata" ) end end class Mock def set_metadata(collection_name, parent_id, metadata = {}) if collection_name == "images" unless list_images_detail.body['images'].find { |image| image['id'] == parent_id } raise Fog::OpenStack::Compute::NotFound end end if collection_name == "servers" unless list_servers_detail.body['servers'].find { |server| server['id'] == parent_id } raise Fog::OpenStack::Compute::NotFound end end response = Excon::Response.new response.body = {"metadata" => metadata} response.status = 200 response end end end end end
Version data entries
22 entries across 22 versions & 3 rubygems