Sha256: 339d3d442fc492e46900514805ecc6860668f942b1b3abdf64999f2bc393ffc9
Contents?: true
Size: 1.35 KB
Versions: 6
Compression:
Stored size: 1.35 KB
Contents
module Fog module OpenStack module Common attr_reader :unscoped_token include Fog::OpenStack::Core def request(params) retried = false begin std_headers = { 'Content-Type' => 'application/json', 'Accept' => 'application/json', 'X-Auth-Token' => @auth_token } param_headers = params.fetch(:headers, {}) response = @connection.request(params.merge({ :headers => std_headers.merge(param_headers), :path => "#{@path}/#{params[:path]}" })) rescue Excon::Errors::Unauthorized => error raise if retried retried = true @openstack_must_reauthenticate = true authenticate retry rescue Excon::Errors::HTTPStatusError => error raise case error when Excon::Errors::NotFound self.class.not_found_class.slurp(error) else error end end unless response.body.empty? response.body = Fog::JSON.decode(response.body) unless params[:raw_body] end response end end end end
Version data entries
6 entries across 6 versions & 1 rubygems