lib/fog/rackspace.rb in fog-maestrodev-1.15.0.20130927082724 vs lib/fog/rackspace.rb in fog-maestrodev-1.18.0.20131111203459
- old
+ new
@@ -60,15 +60,18 @@
end
class InternalServerError < ServiceError; end
class Conflict < ServiceError; end
class ServiceUnavailable < ServiceError; end
-
+ class MethodNotAllowed < ServiceError; end
class BadRequest < ServiceError
- #TODO - Need to find a better way to print out these validation errors when they are thrown
attr_reader :validation_errors
+ def to_s
+ "#{super} - #{validation_errors}"
+ end
+
def self.slurp(error, service=nil)
new_error = super(error)
unless new_error.response_data.nil? or new_error.response_data['badRequest'].nil?
new_error.instance_variable_set(:@validation_errors, new_error.response_data['badRequest']['validationErrors'])
end
@@ -90,10 +93,11 @@
service(:storage, 'rackspace/storage', 'Storage')
service(:load_balancers, 'rackspace/load_balancers', 'LoadBalancers')
service(:identity, 'rackspace/identity', 'Identity')
service(:databases, 'rackspace/databases', 'Databases')
service(:monitoring, 'rackspace/monitoring', 'Monitoring')
+ service(:queues, 'rackspace/queues', 'Queues')
def self.authenticate(options, connection_options = {})
rackspace_auth_url = options[:rackspace_auth_url]
rackspace_auth_url ||= options[:rackspace_endpoint] == Fog::Compute::RackspaceV2::LON_ENDPOINT ? "lon.auth.api.rackspacecloud.com" : "auth.api.rackspacecloud.com"
url = rackspace_auth_url.match(/^https?:/) ? \
@@ -106,10 +110,9 @@
:expects => [200, 204],
:headers => {
'X-Auth-Key' => @rackspace_api_key,
'X-Auth-User' => @rackspace_username
},
- :host => uri.host,
:method => 'GET',
:path => (uri.path and not uri.path.empty?) ? uri.path : 'v1.0'
})
response.headers.reject do |key, value|
!['X-Server-Management-Url', 'X-Storage-Url', 'X-CDN-Management-Url', 'X-Auth-Token'].include?(key)