1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

Show failure for Openstack Storate service_type

The openstack_service_type for the Openstack Storage Service (Swift) currently
defaults to "object-store".  However, if the Swift service is unvailable, the
authenticate_v2 method attempts to call:

    service_type.join ", "

The problem is that the String "object-store" doesn't have a join method.

The new tests show that "object-store" is an invalid service_type, whereas
["object-store"] is a valid service_type.

https://github.com/fog/fog/issues/3112
This commit is contained in:
Greg Blomquist 2014-08-15 15:03:01 -04:00
parent 9b177a7f6a
commit a239227d2a

View file

@ -102,6 +102,26 @@ Shindo.tests('OpenStack | authenticate', ['openstack']) do
end
end
tests("v2 missing storage service") do
Excon.stub({ :method => 'POST', :path => "/v2.0/tokens" },
{ :status => 200, :body => Fog::JSON.encode(body) })
raises(NoMethodError,
"undefined method `join' for \"object-store\":String") do
Fog::OpenStack.authenticate_v2(
:openstack_auth_uri => URI('http://example/v2.0/tokens'),
:openstack_tenant => 'admin',
:openstack_service_type => 'object-store')
end
raises(Fog::Errors::NotFound,
"Could not find service object-store. Have compute, image") do
Fog::OpenStack.authenticate_v2(
:openstack_auth_uri => URI('http://example/v2.0/tokens'),
:openstack_tenant => 'admin',
:openstack_service_type => %w[object-store])
end
end
tests("v2 auth with two compute services") do
body_clone = body.clone
body_clone["access"]["serviceCatalog"] <<