From 8fca81df4069f28d42098cdbfe20ee2f213b1aad Mon Sep 17 00:00:00 2001 From: Rupak Ganguly Date: Fri, 18 Jan 2013 15:08:27 -0500 Subject: [PATCH] Update to new code and tests based on changes from upstream fog. --- lib/fog/hp/block_storage.rb | 11 +++--- .../models/block_storage/bootable_volumes.rb | 4 +-- lib/fog/hp/models/block_storage/snapshot.rb | 8 ++--- lib/fog/hp/models/block_storage/snapshots.rb | 4 +-- lib/fog/hp/models/block_storage/volume.rb | 11 +++--- lib/fog/hp/models/block_storage/volumes.rb | 4 +-- lib/fog/hp/models/compute/meta.rb | 4 +-- lib/fog/hp/models/compute/metadata.rb | 10 +++--- .../hp/models/storage/shared_directories.rb | 4 +-- lib/fog/hp/models/storage/shared_directory.rb | 2 +- lib/fog/hp/models/storage/shared_file.rb | 4 +-- lib/fog/hp/models/storage/shared_files.rb | 4 +-- .../requests/block_storage/create_snapshot.rb | 2 +- .../requests/block_storage/create_volume.rb | 2 +- lib/fog/hp/requests/compute/attach_volume.rb | 2 +- .../compute/create_persistent_server.rb | 2 +- lib/fog/hp/requests/compute/set_metadata.rb | 2 +- lib/fog/hp/requests/compute/update_meta.rb | 2 +- .../hp/requests/compute/update_metadata.rb | 2 +- .../hp/models/compute/metadata_image_tests.rb | 1 + tests/hp/models/storage/directories_tests.rb | 10 ++++-- tests/hp/models/storage/directory_tests.rb | 3 +- tests/hp/models/storage/file_tests.rb | 2 +- tests/hp/models/storage/files_tests.rb | 36 +++++++++---------- .../hp/requests/block_storage/volume_tests.rb | 18 +++++----- tests/hp/requests/compute/metadata_tests.rb | 2 +- .../compute/persistent_server_tests.rb | 2 +- .../requests/compute/server_volume_tests.rb | 2 +- 28 files changed, 83 insertions(+), 77 deletions(-) diff --git a/lib/fog/hp/block_storage.rb b/lib/fog/hp/block_storage.rb index f870354da..27e96e223 100644 --- a/lib/fog/hp/block_storage.rb +++ b/lib/fog/hp/block_storage.rb @@ -1,11 +1,15 @@ -require File.expand_path(File.join(File.dirname(__FILE__), '..', 'hp')) +require 'fog/hp' module Fog module HP class BlockStorage < Fog::Service requires :hp_secret_key, :hp_account_id, :hp_tenant_id, :hp_avl_zone - recognizes :hp_auth_uri, :persistent, :connection_options, :hp_use_upass_auth_style, :hp_auth_version, :user_agent + recognizes :hp_auth_uri + recognizes :persistent, :connection_options + recognizes :hp_use_upass_auth_style, :hp_auth_version, :user_agent + + secrets :hp_secret_key model_path 'fog/hp/models/block_storage' model :volume @@ -78,7 +82,6 @@ module Fog include Utils def initialize(options={}) - require 'multi_json' @hp_secret_key = options[:hp_secret_key] @hp_account_id = options[:hp_account_id] @hp_auth_uri = options[:hp_auth_uri] @@ -138,7 +141,7 @@ module Fog end end if !response.body.empty? && parse_json && response.headers['Content-Type'] =~ %r{application/json} - response.body = MultiJson.decode(response.body) + response.body = Fog::JSON.decode(response.body) end response end diff --git a/lib/fog/hp/models/block_storage/bootable_volumes.rb b/lib/fog/hp/models/block_storage/bootable_volumes.rb index cd0d16768..f40eb170b 100644 --- a/lib/fog/hp/models/block_storage/bootable_volumes.rb +++ b/lib/fog/hp/models/block_storage/bootable_volumes.rb @@ -10,12 +10,12 @@ module Fog model Fog::HP::BlockStorage::Volume def all - data = connection.list_bootable_volumes.body['volumes'] + data = service.list_bootable_volumes.body['volumes'] load(data) end def get(volume_id) - volume = connection.get_bootable_volume_details(volume_id).body['volume'] + volume = service.get_bootable_volume_details(volume_id).body['volume'] new(volume) rescue Fog::HP::BlockStorage::NotFound nil diff --git a/lib/fog/hp/models/block_storage/snapshot.rb b/lib/fog/hp/models/block_storage/snapshot.rb index e8795681c..39c4dcfdc 100644 --- a/lib/fog/hp/models/block_storage/snapshot.rb +++ b/lib/fog/hp/models/block_storage/snapshot.rb @@ -17,14 +17,14 @@ module Fog #attribute :metadata def initialize(attributes = {}) - # assign these attributes first to prevent race condition with new_record? + # assign these attributes first to prevent race condition with persisted? self.force = attributes.delete(:force) # force snapshotting of attached volumes super end def destroy requires :id - connection.delete_snapshot(id) + service.delete_snapshot(id) true end @@ -37,14 +37,14 @@ module Fog end def save - raise Fog::Errors::Error.new('Resaving an existing object may create a duplicate') if identity + raise Fog::Errors::Error.new('Resaving an existing object may create a duplicate') if persisted? requires :name, :volume_id options = { #'metadata' => metadata, # TODO: Add metadata when snapshots support it 'force' => @force } options = options.reject {|key, value| value.nil?} - data = connection.create_snapshot(name, description, volume_id, options) + data = service.create_snapshot(name, description, volume_id, options) merge_attributes(data.body['snapshot']) true end diff --git a/lib/fog/hp/models/block_storage/snapshots.rb b/lib/fog/hp/models/block_storage/snapshots.rb index c9a2aee43..c0a7135d5 100644 --- a/lib/fog/hp/models/block_storage/snapshots.rb +++ b/lib/fog/hp/models/block_storage/snapshots.rb @@ -10,12 +10,12 @@ module Fog model Fog::HP::BlockStorage::Snapshot def all - data = connection.list_snapshots.body['snapshots'] + data = service.list_snapshots.body['snapshots'] load(data) end def get(snapshot_id) - if snapshot = connection.get_snapshot_details(snapshot_id).body['snapshot'] + if snapshot = service.get_snapshot_details(snapshot_id).body['snapshot'] new(snapshot) end rescue Fog::HP::BlockStorage::NotFound diff --git a/lib/fog/hp/models/block_storage/volume.rb b/lib/fog/hp/models/block_storage/volume.rb index 142c75b31..88a342704 100644 --- a/lib/fog/hp/models/block_storage/volume.rb +++ b/lib/fog/hp/models/block_storage/volume.rb @@ -26,7 +26,6 @@ module Fog def initialize(attributes = {}) # assign these attributes first to prevent race condition with new_record? self.image_id = attributes.delete(:image_id) - @connection = attributes[:connection] super end @@ -60,7 +59,7 @@ module Fog def attach(new_server_id, device) requires :id unless in_use? - data = connection.compute.attach_volume(new_server_id, id, device) + data = service.compute.attach_volume(new_server_id, id, device) merge_attributes(:attachments => attachments << data.body['volumeAttachment']) true else @@ -71,19 +70,19 @@ module Fog def detach requires :id if has_attachments? - connection.compute.detach_volume(server_id, id) + service.compute.detach_volume(server_id, id) end true end def destroy requires :id - connection.delete_volume(id) + service.delete_volume(id) true end def save - raise Fog::Errors::Error.new('Resaving an existing object may create a duplicate') if identity + raise Fog::Errors::Error.new('Resaving an existing object may create a duplicate') if persisted? requires :name, :size options = { 'metadata' => metadata, @@ -91,7 +90,7 @@ module Fog 'imageRef' => @image_id } options = options.reject {|key, value| value.nil?} - data = connection.create_volume(name, description, size, options) + data = service.create_volume(name, description, size, options) merge_attributes(data.body['volume']) true end diff --git a/lib/fog/hp/models/block_storage/volumes.rb b/lib/fog/hp/models/block_storage/volumes.rb index ed378f247..a9db39783 100644 --- a/lib/fog/hp/models/block_storage/volumes.rb +++ b/lib/fog/hp/models/block_storage/volumes.rb @@ -10,12 +10,12 @@ module Fog model Fog::HP::BlockStorage::Volume def all - data = connection.list_volumes.body['volumes'] + data = service.list_volumes.body['volumes'] load(data) end def get(volume_id) - volume = connection.get_volume_details(volume_id).body['volume'] + volume = service.get_volume_details(volume_id).body['volume'] new(volume) rescue Fog::HP::BlockStorage::NotFound nil diff --git a/lib/fog/hp/models/compute/meta.rb b/lib/fog/hp/models/compute/meta.rb index 638453c01..df8f7f445 100644 --- a/lib/fog/hp/models/compute/meta.rb +++ b/lib/fog/hp/models/compute/meta.rb @@ -13,13 +13,13 @@ module Fog def destroy requires :identity - connection.delete_meta(collection_name, @parent.id, key) + service.delete_meta(collection_name, @parent.id, key) true end def save requires :identity, :value - connection.update_meta(collection_name, @parent.id, key, value) + service.update_meta(collection_name, @parent.id, key, value) true end diff --git a/lib/fog/hp/models/compute/metadata.rb b/lib/fog/hp/models/compute/metadata.rb index dbf52dd2b..f7c911b57 100644 --- a/lib/fog/hp/models/compute/metadata.rb +++ b/lib/fog/hp/models/compute/metadata.rb @@ -17,7 +17,7 @@ module Fog def all requires :parent if @parent.id - metadata = connection.list_metadata(collection_name, @parent.id).body['metadata'] + metadata = service.list_metadata(collection_name, @parent.id).body['metadata'] metas = [] metadata.each_pair {|k,v| metas << {"key" => k, "value" => v} } load(metas) @@ -26,14 +26,14 @@ module Fog def destroy(key) requires :parent - connection.delete_meta(collection_name, @parent.id, key) + service.delete_meta(collection_name, @parent.id, key) rescue Fog::Compute::HP::NotFound nil end def get(key) requires :parent - data = connection.get_meta(collection_name, @parent.id, key).body["meta"] + data = service.get_meta(collection_name, @parent.id, key).body["meta"] metas = [] data.each_pair {|k,v| metas << {"key" => k, "value" => v} } new(metas[0]) @@ -48,12 +48,12 @@ module Fog def set(data=nil) requires :parent - connection.set_metadata(collection_name, @parent.id, meta_hash(data)) + service.set_metadata(collection_name, @parent.id, meta_hash(data)) end def update(data=nil) requires :parent - connection.update_metadata(collection_name, @parent.id, meta_hash(data)) + service.update_metadata(collection_name, @parent.id, meta_hash(data)) end diff --git a/lib/fog/hp/models/storage/shared_directories.rb b/lib/fog/hp/models/storage/shared_directories.rb index 7df96e2a6..c105b6807 100644 --- a/lib/fog/hp/models/storage/shared_directories.rb +++ b/lib/fog/hp/models/storage/shared_directories.rb @@ -14,7 +14,7 @@ module Fog end def head(url) - data = connection.head_shared_container(url) + data = service.head_shared_container(url) shared_directory = new(:url => url) for key, value in data.headers if ['X-Container-Bytes-Used', 'X-Container-Object-Count'].include?(key) @@ -29,7 +29,7 @@ module Fog end def get(url) - data = connection.get_shared_container(url) + data = service.get_shared_container(url) shared_directory = new(:url => url) for key, value in data.headers if ['X-Container-Bytes-Used', 'X-Container-Object-Count'].include?(key) diff --git a/lib/fog/hp/models/storage/shared_directory.rb b/lib/fog/hp/models/storage/shared_directory.rb index ce1f2c865..fed94c13e 100644 --- a/lib/fog/hp/models/storage/shared_directory.rb +++ b/lib/fog/hp/models/storage/shared_directory.rb @@ -16,7 +16,7 @@ module Fog @files ||= begin Fog::Storage::HP::SharedFiles.new( :shared_directory => self, - :connection => connection + :service => service ) end end diff --git a/lib/fog/hp/models/storage/shared_file.rb b/lib/fog/hp/models/storage/shared_file.rb index c447b1604..a1e1beeeb 100644 --- a/lib/fog/hp/models/storage/shared_file.rb +++ b/lib/fog/hp/models/storage/shared_file.rb @@ -32,7 +32,7 @@ module Fog def destroy requires :shared_directory, :key - connection.delete_shared_object(self.url) + service.delete_shared_object(self.url) true # throws exception Fog::HP::Errors::Forbidden if insufficient access rescue Fog::Storage::HP::NotFound @@ -46,7 +46,7 @@ module Fog def save(options = {}) requires :shared_directory, :key options['Content-Type'] = content_type if content_type - data = connection.put_shared_object(shared_directory.url, key, body, options) + data = service.put_shared_object(shared_directory.url, key, body, options) merge_attributes(data.headers) self.content_length = Fog::Storage.get_body_size(body) true diff --git a/lib/fog/hp/models/storage/shared_files.rb b/lib/fog/hp/models/storage/shared_files.rb index 385bd7e2b..da65392fe 100644 --- a/lib/fog/hp/models/storage/shared_files.rb +++ b/lib/fog/hp/models/storage/shared_files.rb @@ -27,7 +27,7 @@ module Fog def get(key, &block) requires :shared_directory shared_object_url = "#{shared_directory.url}/#{key}" - data = connection.get_shared_object(shared_object_url, &block) + data = service.get_shared_object(shared_object_url, &block) file_data = data.headers.merge({ :body => data.body, :key => key @@ -41,7 +41,7 @@ module Fog def head(key) requires :shared_directory shared_object_url = "#{shared_directory.url}/#{key}" - data = connection.head_shared_object(shared_object_url) + data = service.head_shared_object(shared_object_url) file_data = data.headers.merge({ :body => '', :key => key diff --git a/lib/fog/hp/requests/block_storage/create_snapshot.rb b/lib/fog/hp/requests/block_storage/create_snapshot.rb index 428d32ce0..0049a315c 100644 --- a/lib/fog/hp/requests/block_storage/create_snapshot.rb +++ b/lib/fog/hp/requests/block_storage/create_snapshot.rb @@ -38,7 +38,7 @@ module Fog end request( - :body => MultiJson.encode(data), + :body => Fog::JSON.encode(data), :expects => 200, :method => 'POST', :path => "os-snapshots" diff --git a/lib/fog/hp/requests/block_storage/create_volume.rb b/lib/fog/hp/requests/block_storage/create_volume.rb index b1a370e13..e16705739 100644 --- a/lib/fog/hp/requests/block_storage/create_volume.rb +++ b/lib/fog/hp/requests/block_storage/create_volume.rb @@ -44,7 +44,7 @@ module Fog end request( - :body => MultiJson.encode(data), + :body => Fog::JSON.encode(data), :expects => 200, :method => 'POST', :path => "os-volumes" diff --git a/lib/fog/hp/requests/compute/attach_volume.rb b/lib/fog/hp/requests/compute/attach_volume.rb index 5b117aef8..7635b6d37 100644 --- a/lib/fog/hp/requests/compute/attach_volume.rb +++ b/lib/fog/hp/requests/compute/attach_volume.rb @@ -24,7 +24,7 @@ module Fog } } response = request( - :body => MultiJson.encode(data), + :body => Fog::JSON.encode(data), :expects => 200, :method => 'POST', :path => "servers/#{server_id}/os-volume_attachments" diff --git a/lib/fog/hp/requests/compute/create_persistent_server.rb b/lib/fog/hp/requests/compute/create_persistent_server.rb index 705ffcfe1..87186fa43 100644 --- a/lib/fog/hp/requests/compute/create_persistent_server.rb +++ b/lib/fog/hp/requests/compute/create_persistent_server.rb @@ -107,7 +107,7 @@ module Fog end request( - :body => MultiJson.encode(data), + :body => Fog::JSON.encode(data), :expects => 200, :method => 'POST', :path => 'os-volumes_boot' diff --git a/lib/fog/hp/requests/compute/set_metadata.rb b/lib/fog/hp/requests/compute/set_metadata.rb index 4eb691682..09ac0fe46 100644 --- a/lib/fog/hp/requests/compute/set_metadata.rb +++ b/lib/fog/hp/requests/compute/set_metadata.rb @@ -17,7 +17,7 @@ module Fog # def set_metadata(collection_name, parent_id, metadata = {}) request( - :body => MultiJson.encode({ 'metadata' => metadata }), + :body => Fog::JSON.encode({ 'metadata' => metadata }), :expects => 200, :method => 'PUT', :path => "#{collection_name}/#{parent_id}/metadata" diff --git a/lib/fog/hp/requests/compute/update_meta.rb b/lib/fog/hp/requests/compute/update_meta.rb index f72996d4a..f03f8c89e 100644 --- a/lib/fog/hp/requests/compute/update_meta.rb +++ b/lib/fog/hp/requests/compute/update_meta.rb @@ -18,7 +18,7 @@ module Fog # def update_meta(collection_name, parent_id, key, value) request( - :body => MultiJson.encode({ 'meta' => { key => value }}), + :body => Fog::JSON.encode({ 'meta' => { key => value }}), :expects => 200, :method => 'PUT', :path => "#{collection_name}/#{parent_id}/metadata/#{key}" diff --git a/lib/fog/hp/requests/compute/update_metadata.rb b/lib/fog/hp/requests/compute/update_metadata.rb index 504722dc5..cac456e2e 100644 --- a/lib/fog/hp/requests/compute/update_metadata.rb +++ b/lib/fog/hp/requests/compute/update_metadata.rb @@ -17,7 +17,7 @@ module Fog # def update_metadata(collection_name, parent_id, metadata = {}) request( - :body => MultiJson.encode({ 'metadata' => metadata }), + :body => Fog::JSON.encode({ 'metadata' => metadata }), :expects => 200, :method => 'POST', :path => "#{collection_name}/#{parent_id}/metadata.json" diff --git a/tests/hp/models/compute/metadata_image_tests.rb b/tests/hp/models/compute/metadata_image_tests.rb index 6b0bd438c..5cad29b73 100644 --- a/tests/hp/models/compute/metadata_image_tests.rb +++ b/tests/hp/models/compute/metadata_image_tests.rb @@ -17,6 +17,7 @@ Shindo.tests("Fog::Compute[:hp] | metadata for images", ['hp']) do end tests("#get('Meta1')").succeeds do + pending if Fog.mocking? @image.metadata.get('Meta1') end diff --git a/tests/hp/models/storage/directories_tests.rb b/tests/hp/models/storage/directories_tests.rb index f92c97766..fc8741653 100644 --- a/tests/hp/models/storage/directories_tests.rb +++ b/tests/hp/models/storage/directories_tests.rb @@ -1,17 +1,23 @@ -Shindo.tests('Fog::Storage[:hp] | directories', ['hp', 'storage']) do +Shindo.tests("Fog::Storage[:hp] | directories", ['hp', 'storage']) do collection_tests(Fog::Storage[:hp].directories, {:key => "fogdirtests"}, true) tests('success') do + tests("#create('fogdirtests')").succeeds do + Fog::Storage[:hp].directories.create(:key => 'fogdirtests') + end + tests("#head('fogdirtests')").succeeds do Fog::Storage[:hp].directories.head('fogdirtests') end tests("#get('fogdirtests')").succeeds do - Fog::Storage[:hp].directories.get('fogdirtests') + @directory = Fog::Storage[:hp].directories.get('fogdirtests') end + @directory.destroy + end end \ No newline at end of file diff --git a/tests/hp/models/storage/directory_tests.rb b/tests/hp/models/storage/directory_tests.rb index 02b450d75..63b8137d0 100644 --- a/tests/hp/models/storage/directory_tests.rb +++ b/tests/hp/models/storage/directory_tests.rb @@ -1,4 +1,4 @@ -Shindo.tests('Fog::Storage[:hp] | directory', ['hp', 'storage']) do +Shindo.tests("Fog::Storage[:hp] | directory", ['hp', 'storage']) do model_tests(Fog::Storage[:hp].directories, {:key => "fogdirtests"}, true) do @@ -25,6 +25,7 @@ Shindo.tests('Fog::Storage[:hp] | directory', ['hp', 'storage']) do @instance.files.get('sample.txt').destroy tests("#cdn_enable=(true)").succeeds do + pending if Fog.mocking? @instance.cdn_enable=(true) tests("cdn_enabled?").returns(true) do pending if Fog.mocking? diff --git a/tests/hp/models/storage/file_tests.rb b/tests/hp/models/storage/file_tests.rb index 47a2211da..6c2b8f1a5 100644 --- a/tests/hp/models/storage/file_tests.rb +++ b/tests/hp/models/storage/file_tests.rb @@ -1,4 +1,4 @@ -Shindo.tests('Fog::Storage[:hp] | directory', ['hp', 'storage']) do +Shindo.tests("Fog::Storage[:hp] | directory", ['hp', 'storage']) do file_attributes = { :key => 'fog_file_tests', diff --git a/tests/hp/models/storage/files_tests.rb b/tests/hp/models/storage/files_tests.rb index 4a12d1cc5..a211dad0a 100644 --- a/tests/hp/models/storage/files_tests.rb +++ b/tests/hp/models/storage/files_tests.rb @@ -1,4 +1,4 @@ -Shindo.tests('Fog::Storage[:hp] | files', ['hp', 'storage']) do +Shindo.tests("Fog::Storage[:hp] | files", ['hp', 'storage']) do file_attributes = { :key => 'fog_files_tests', @@ -9,34 +9,30 @@ Shindo.tests('Fog::Storage[:hp] | files', ['hp', 'storage']) do :key => 'fogfilestests' } + collection_tests(Fog::Storage[:hp].directories.create(directory_attributes).files, file_attributes, true) + @directory = Fog::Storage[:hp].directories.create(directory_attributes) + @file = @directory.files.create(file_attributes) - collection_tests(@directory.files, file_attributes, true) do + tests('success') do - tests('success') do + tests("#get_url('#{@directory.key}')").succeeds do + @directory.files.get_url(@directory.key) + end - tests("#get_url('#{@directory.key}')").succeeds do - @directory.files.get_url("#{@directory.key}") - end - - tests("#get_cdn_url('#{@directory.key}')").succeeds do - pending if Fog.mocking? - @directory.files.get_cdn_url("#{@directory.key}") - end - - tests("#get_cdn_ssl_url('#{@directory.key}')").succeeds do - pending if Fog.mocking? - @directory.files.get_cdn_ssl_url("#{@directory.key}") - end - - tests("#head('#{@directory.key}')").succeeds do - @directory.files.head("#{@directory.key}") - end + tests("#get_cdn_url('#{@directory.key}')").succeeds do + pending if Fog.mocking? + @directory.files.get_cdn_url(@directory.key) + end + tests("#get_cdn_ssl_url('#{@directory.key}')").succeeds do + pending if Fog.mocking? + @directory.files.get_cdn_ssl_url(@directory.key) end end + @file.destroy @directory.destroy end \ No newline at end of file diff --git a/tests/hp/requests/block_storage/volume_tests.rb b/tests/hp/requests/block_storage/volume_tests.rb index 9b5bbba91..3a2716bbd 100644 --- a/tests/hp/requests/block_storage/volume_tests.rb +++ b/tests/hp/requests/block_storage/volume_tests.rb @@ -26,7 +26,7 @@ Shindo.tests("HP::BlockStorage | volume requests", ['hp', 'block_storage', 'volu @volume_desc = @volume_name + " desc" @base_image_id = ENV["BASE_IMAGE_ID"] || 1242 - @server = HP[:block_storage].compute.servers.create(:name => 'fogvoltests', :flavor_id => 100, :image_id => @base_image_id) + @server = Fog::Compute[:hp].servers.create(:name => 'fogvoltests', :flavor_id => 100, :image_id => @base_image_id) @server.wait_for { ready? } tests("#create_volume(#{@volume_name}, #{@volume_desc}, 1)").formats(@volume_format) do @@ -46,12 +46,12 @@ Shindo.tests("HP::BlockStorage | volume requests", ['hp', 'block_storage', 'volu HP[:block_storage].volumes.get(@volume_id).wait_for { ready? } tests("#attach_volume(#{@server.id}, #{@volume_id}, '/dev/sdg')").formats(@volume_attach_format) do - HP[:block_storage].compute.attach_volume(@server.id, @volume_id, "/dev/sdg").body['volumeAttachment'] + Fog::Compute[:hp].attach_volume(@server.id, @volume_id, "/dev/sdg").body['volumeAttachment'] end HP[:block_storage].volumes.get(@volume_id).wait_for { in_use? } unless Fog.mocking? tests("#detach_volume(#{@server.id}, #{@volume_id})").succeeds do - HP[:block_storage].compute.detach_volume(@server.id, @volume_id) + Fog::Compute[:hp].detach_volume(@server.id, @volume_id) end HP[:block_storage].volumes.get(@volume_id).wait_for { ready? } @@ -68,19 +68,19 @@ Shindo.tests("HP::BlockStorage | volume requests", ['hp', 'block_storage', 'volu end tests("#attach_volume(0, 0, '/dev/sdg')").raises(Fog::Compute::HP::NotFound) do - HP[:block_storage].compute.attach_volume(0, 0, "/dev/sdg") + Fog::Compute[:hp].attach_volume(0, 0, "/dev/sdg") end - tests("#attach_volume(#{@server.id}, 0, '/dev/sdg')").raises(Fog::Compute::HP::NotFound) do + tests("#attach_volume(#{@server.id}, 0, '/dev/sdg')").raises(Fog::HP::BlockStorage::NotFound) do pending if Fog.mocking? - HP[:block_storage].compute.attach_volume(@server.id, 0, "/dev/sdg") + Fog::Compute[:hp].attach_volume(@server.id, 0, "/dev/sdg") end tests("#detach_volume(0, 0)").raises(Fog::Compute::HP::NotFound) do - HP[:block_storage].compute.detach_volume(0, 0) + Fog::Compute[:hp].detach_volume(0, 0) end - tests("#detach_volume(#{@server.id}, 0)").raises(Fog::Compute::HP::NotFound) do + tests("#detach_volume(#{@server.id}, 0)").raises(Fog::HP::BlockStorage::NotFound) do pending if Fog.mocking? - HP[:block_storage].compute.detach_volume(@server.id, 0) + Fog::Compute[:hp].detach_volume(@server.id, 0) end tests("#delete_volume(0)").raises(Fog::HP::BlockStorage::NotFound) do diff --git a/tests/hp/requests/compute/metadata_tests.rb b/tests/hp/requests/compute/metadata_tests.rb index c53fc47b7..688a6d1cd 100644 --- a/tests/hp/requests/compute/metadata_tests.rb +++ b/tests/hp/requests/compute/metadata_tests.rb @@ -1,4 +1,4 @@ -Shindo.tests('Fog::Compute[:hp] | metadata requests', ['hp']) do +Shindo.tests("Fog::Compute[:hp] | metadata requests", ['hp']) do @metadata_format = { 'metadata' => Fog::Nullable::Hash diff --git a/tests/hp/requests/compute/persistent_server_tests.rb b/tests/hp/requests/compute/persistent_server_tests.rb index c3c6e69f5..5d6df7ed4 100644 --- a/tests/hp/requests/compute/persistent_server_tests.rb +++ b/tests/hp/requests/compute/persistent_server_tests.rb @@ -1,4 +1,4 @@ -Shindo.tests('Fog::Compute[:hp] | persistent server requests', ['hp', 'compute']) do +Shindo.tests("Fog::Compute[:hp] | persistent server requests", ['hp', 'compute']) do @server_format = { 'addresses' => Fog::Nullable::Hash, diff --git a/tests/hp/requests/compute/server_volume_tests.rb b/tests/hp/requests/compute/server_volume_tests.rb index 1ba2fec8e..81ba1fdaf 100644 --- a/tests/hp/requests/compute/server_volume_tests.rb +++ b/tests/hp/requests/compute/server_volume_tests.rb @@ -1,4 +1,4 @@ -Shindo.tests('Fog::Compute[:hp] | volume requests', ['hp', 'compute', 'volumes']) do +Shindo.tests("Fog::Compute[:hp] | volume requests", ['hp', 'compute', 'volumes']) do @list_volume_attachments_format = { 'volumeAttachments' => [{