From 63ca297eae471d6db72d793ff180e668b6117dcc Mon Sep 17 00:00:00 2001 From: geemus <geemus@gmail.com> Date: Tue, 8 Nov 2011 09:13:53 -0600 Subject: [PATCH] [core] toss out nil-value keys when checking required credentials closes #587 --- lib/fog/core/service.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/fog/core/service.rb b/lib/fog/core/service.rb index 876aba6fb..9196de2c1 100644 --- a/lib/fog/core/service.rb +++ b/lib/fog/core/service.rb @@ -176,7 +176,13 @@ module Fog end 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? raise ArgumentError, "Missing required arguments: #{missing.join(', ')}" end