mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[core] toss out nil-value keys when checking required credentials
closes #587
This commit is contained in:
parent
e623b573b6
commit
63ca297eae
1 changed files with 7 additions and 1 deletions
|
@ -176,7 +176,13 @@ module Fog
|
||||||
end
|
end
|
||||||
|
|
||||||
def validate_options(options)
|
def validate_options(options)
|
||||||
missing = requirements - options.keys
|
keys = []
|
||||||
|
for key, value in options
|
||||||
|
unless value.nil?
|
||||||
|
keys << key
|
||||||
|
end
|
||||||
|
end
|
||||||
|
missing = requirements - keys
|
||||||
unless missing.empty?
|
unless missing.empty?
|
||||||
raise ArgumentError, "Missing required arguments: #{missing.join(', ')}"
|
raise ArgumentError, "Missing required arguments: #{missing.join(', ')}"
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue