mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Fix non-circular-require warnings
This fixes miscellaneous warnings in fog including unused variables, indentation mismatch and one warning for a duplicated attr_reader.
This commit is contained in:
parent
b58c0ab145
commit
701dfa31b5
9 changed files with 12 additions and 16 deletions
|
@ -132,8 +132,6 @@ module Fog
|
||||||
def self.data
|
def self.data
|
||||||
@data ||= Hash.new do |hash, region|
|
@data ||= Hash.new do |hash, region|
|
||||||
hash[region] = Hash.new do |region_hash, key|
|
hash[region] = Hash.new do |region_hash, key|
|
||||||
owner_id = Fog::AWS::Mock.owner_id
|
|
||||||
security_group_id = Fog::AWS::Mock.security_group_id
|
|
||||||
region_hash[key] = {
|
region_hash[key] = {
|
||||||
:clusters => {}, # cache cluster data, indexed by cluster ID
|
:clusters => {}, # cache cluster data, indexed by cluster ID
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,7 @@ module Fog
|
||||||
begin
|
begin
|
||||||
require 'multi_json'
|
require 'multi_json'
|
||||||
include NewJSON
|
include NewJSON
|
||||||
rescue Exception => e
|
rescue Exception
|
||||||
Fog::Logger.deprecation "Defaulting to json library for json parsing. Please consider using multi_json library for the greatest performance/flexibility."
|
Fog::Logger.deprecation "Defaulting to json library for json parsing. Please consider using multi_json library for the greatest performance/flexibility."
|
||||||
require 'json'
|
require 'json'
|
||||||
include LegacyJSON
|
include LegacyJSON
|
||||||
|
|
|
@ -72,7 +72,7 @@ module Fog
|
||||||
def fetch_credentials(options)
|
def fetch_credentials(options)
|
||||||
# attempt to load credentials from config file
|
# attempt to load credentials from config file
|
||||||
begin
|
begin
|
||||||
default_credentials = Fog.credentials.reject {|key, value| !(recognized | requirements).include?(key)}
|
Fog.credentials.reject {|key, value| !(recognized | requirements).include?(key)}
|
||||||
rescue LoadError
|
rescue LoadError
|
||||||
# if there are no configured credentials, do nothing
|
# if there are no configured credentials, do nothing
|
||||||
{}
|
{}
|
||||||
|
|
|
@ -177,7 +177,7 @@ module Fog
|
||||||
signature = Fog::HP.escape(signature)
|
signature = Fog::HP.escape(signature)
|
||||||
|
|
||||||
# generate the temp url using the signature and expiry
|
# generate the temp url using the signature and expiry
|
||||||
temp_url = "#{scheme}://#{host}:#{port}#{encoded_path}?temp_url_sig=#{signature}&temp_url_expires=#{expires}"
|
"#{scheme}://#{host}:#{port}#{encoded_path}?temp_url_sig=#{signature}&temp_url_expires=#{expires}"
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -63,7 +63,6 @@ module Fog
|
||||||
|
|
||||||
class Mock
|
class Mock
|
||||||
attr_reader :auth_token
|
attr_reader :auth_token
|
||||||
attr_reader :unscoped_token
|
|
||||||
attr_reader :auth_token_expiration
|
attr_reader :auth_token_expiration
|
||||||
attr_reader :current_user
|
attr_reader :current_user
|
||||||
attr_reader :current_tenant
|
attr_reader :current_tenant
|
||||||
|
|
|
@ -30,7 +30,7 @@ module Fog
|
||||||
def to_s
|
def to_s
|
||||||
"Image should have transitioned to '#{desired_state}' not '#{current_state}'"
|
"Image should have transitioned to '#{desired_state}' not '#{current_state}'"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
DFW_ENDPOINT = 'https://dfw.servers.api.rackspacecloud.com/v2'
|
DFW_ENDPOINT = 'https://dfw.servers.api.rackspacecloud.com/v2'
|
||||||
ORD_ENDPOINT = 'https://ord.servers.api.rackspacecloud.com/v2'
|
ORD_ENDPOINT = 'https://ord.servers.api.rackspacecloud.com/v2'
|
||||||
|
@ -163,7 +163,7 @@ module Fog
|
||||||
unless response.body.empty?
|
unless response.body.empty?
|
||||||
begin
|
begin
|
||||||
response.body = Fog::JSON.decode(response.body)
|
response.body = Fog::JSON.decode(response.body)
|
||||||
rescue Fog::JSON::LoadError => e
|
rescue Fog::JSON::LoadError
|
||||||
response.body = {}
|
response.body = {}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -104,8 +104,7 @@ module Fog
|
||||||
"extra_specs" => {},
|
"extra_specs" => {},
|
||||||
}
|
}
|
||||||
|
|
||||||
#Mock Data Hash
|
mock_data = {
|
||||||
h = {
|
|
||||||
#Compute V2
|
#Compute V2
|
||||||
:flavors => Hash.new { |h,k| h[k] = flavor unless k == NOT_FOUND_ID},
|
:flavors => Hash.new { |h,k| h[k] = flavor unless k == NOT_FOUND_ID},
|
||||||
:images => Hash.new { |h,k| h[k] = image unless k == NOT_FOUND_ID },
|
:images => Hash.new { |h,k| h[k] = image unless k == NOT_FOUND_ID },
|
||||||
|
@ -121,11 +120,11 @@ module Fog
|
||||||
}
|
}
|
||||||
|
|
||||||
# seed with initial data
|
# seed with initial data
|
||||||
h[:flavors][flavor_id] = flavor
|
mock_data[:flavors][flavor_id] = flavor
|
||||||
h[:images][image_id] = image
|
mock_data[:images][image_id] = image
|
||||||
h[:networks][network_id] = network
|
mock_data[:networks][network_id] = network
|
||||||
|
|
||||||
h
|
mock_data
|
||||||
end
|
end
|
||||||
end[@rackspace_api_key]
|
end[@rackspace_api_key]
|
||||||
end
|
end
|
||||||
|
|
|
@ -28,7 +28,7 @@ module Fog
|
||||||
|
|
||||||
def authenticate(options)
|
def authenticate(options)
|
||||||
self.send authentication_method, options
|
self.send authentication_method, options
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
|
|
@ -84,7 +84,7 @@ module Fog
|
||||||
data[key_id][:status] = status
|
data[key_id][:status] = status
|
||||||
end
|
end
|
||||||
|
|
||||||
if regrant = user[:new_key_secret]
|
if user[:new_key_secret]
|
||||||
data[key_id][:key_secret] = rand(100).to_s
|
data[key_id][:key_secret] = rand(100).to_s
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue