lib/fog/compute/rackspace.rb in fog-0.6.0 vs lib/fog/compute/rackspace.rb in fog-0.7.0
- old
+ new
@@ -51,25 +51,24 @@
:servers => {}
}
end
end
- def self.reset_data(keys=data.keys)
- for key in [*keys]
- data.delete(key)
- end
- end
-
def initialize(options={})
unless options.delete(:provider)
location = caller.first
warning = "[yellow][WARN] Fog::Rackspace::Compute.new is deprecated, use Fog::Compute.new(:provider => 'Rackspace') instead[/]"
warning << " [light_black](" << location << ")[/] "
Formatador.display_line(warning)
end
@rackspace_username = options[:rackspace_username]
+ reset_data
+ end
+
+ def reset_data
+ self.class.data.delete(@rackspace_username)
@data = self.class.data[@rackspace_username]
end
end
@@ -101,10 +100,11 @@
:headers => {
'Content-Type' => 'application/json',
'X-Auth-Token' => @auth_token
}.merge!(params[:headers] || {}),
:host => @host,
- :path => "#{@path}/#{params[:path]}"
+ :path => "#{@path}/#{params[:path]}",
+ :query => ('ignore_awful_caching' << Time.now.to_i.to_s)
}))
rescue Excon::Errors::Unauthorized => error
if JSON.parse(response.body)['unauthorized']['message'] == 'Invalid authentication token. Please renew.'
authenticate
retry