mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[rackspace|dns] updated DNS service to use Fog::DNS::Rackspace::NotFound exceptions in keeping with the rest of the services.
This commit is contained in:
parent
39bc371513
commit
9f1050c5c4
5 changed files with 8 additions and 7 deletions
|
@ -4,6 +4,7 @@ require 'fog/dns'
|
|||
module Fog
|
||||
module DNS
|
||||
class Rackspace < Fog::Service
|
||||
include Fog::Rackspace::Errors
|
||||
|
||||
class CallbackError < Fog::Errors::Error
|
||||
attr_reader :response, :message, :details
|
||||
|
@ -118,7 +119,7 @@ module Fog
|
|||
rescue Excon::Errors::Conflict => error
|
||||
raise Fog::Rackspace::Errors::Conflict.slurp error
|
||||
rescue Excon::Errors::NotFound => error
|
||||
raise Fog::Rackspace::Errors::NotFound.slurp error
|
||||
raise NotFound.slurp(error, region)
|
||||
rescue Excon::Errors::ServiceUnavailable => error
|
||||
raise Fog::Rackspace::Errors::ServiceUnavailable.slurp error
|
||||
end
|
||||
|
|
|
@ -24,7 +24,7 @@ module Fog
|
|||
#nil or empty string will trigger an argument error
|
||||
rescue ArgumentError
|
||||
nil
|
||||
rescue Fog::Rackspace::Errors::NotFound
|
||||
rescue Fog::DNS::Rackspace::NotFound
|
||||
nil
|
||||
end
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ module Fog
|
|||
|
||||
data = service.list_domain_details(zone_id).body
|
||||
new(data)
|
||||
rescue Fog::Rackspace::Errors::NotFound
|
||||
rescue Fog::DNS::Rackspace::NotFound
|
||||
nil
|
||||
#Accessing a valid (but other customer's) id returns a 503 error
|
||||
rescue Fog::Rackspace::Errors::ServiceUnavailable
|
||||
|
|
|
@ -111,7 +111,7 @@ Shindo.tests('Fog::DNS[:rackspace] | DNS requests', ['rackspace', 'dns']) do
|
|||
Fog::DNS[:rackspace].list_domains :limit => 5, :offset => 8
|
||||
end
|
||||
|
||||
tests('list_domain_details 34335353').raises(Fog::Rackspace::Errors::NotFound) do
|
||||
tests('list_domain_details 34335353').raises(Fog::DNS::Rackspace::NotFound) do
|
||||
Fog::DNS[:rackspace].list_domain_details 34335353
|
||||
end
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ Shindo.tests('Fog::DNS[:rackspace] | dns records requests', ['rackspace', 'dns']
|
|||
Fog::DNS[:rackspace].list_records('')
|
||||
end
|
||||
|
||||
tests("list_records('abc')").raises(Fog::Rackspace::Errors::NotFound) do
|
||||
tests("list_records('abc')").raises(Fog::DNS::Rackspace::NotFound) do
|
||||
Fog::DNS[:rackspace].list_records('abc')
|
||||
end
|
||||
|
||||
|
@ -63,7 +63,7 @@ Shindo.tests('Fog::DNS[:rackspace] | dns records requests', ['rackspace', 'dns']
|
|||
Fog::DNS[:rackspace].list_record_details(@domain_id, '')
|
||||
end
|
||||
|
||||
tests("list_record_details(#{@domain_id}, 'abc')").raises(Fog::Rackspace::Errors::NotFound) do
|
||||
tests("list_record_details(#{@domain_id}, 'abc')").raises(Fog::DNS::Rackspace::NotFound) do
|
||||
Fog::DNS[:rackspace].list_record_details(@domain_id, 'abc')
|
||||
end
|
||||
|
||||
|
@ -71,7 +71,7 @@ Shindo.tests('Fog::DNS[:rackspace] | dns records requests', ['rackspace', 'dns']
|
|||
Fog::DNS[:rackspace].remove_record(@domain_id, '')
|
||||
end
|
||||
|
||||
tests("remove_record(#{@domain_id}, 'abc')").raises(Fog::Rackspace::Errors::NotFound) do
|
||||
tests("remove_record(#{@domain_id}, 'abc')").raises(Fog::DNS::Rackspace::NotFound) do
|
||||
Fog::DNS[:rackspace].remove_record(@domain_id, 'abc')
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue