You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltacloud.apache.org by ts...@redhat.com on 2012/02/24 16:13:35 UTC

[PATCH core] Fix valid_provider_url? to return a boolean value

From: Tomas Sedovic <to...@sedovic.cz>

Calling `client.driver('rhevm').valid_provider_url?` used to return an array of
true/false values instead of a single boolean.
---
 client/lib/base_object.rb |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/client/lib/base_object.rb b/client/lib/base_object.rb
index fb9738f..5f63b5d 100644
--- a/client/lib/base_object.rb
+++ b/client/lib/base_object.rb
@@ -151,7 +151,7 @@ module DeltaCloud
             return providers.any? { |p| p.keys.include? args.first.to_sym }
           end
           if method_name == :"valid_provider_url?"
-            return providers.map { |p| !p.find { |k, v| v.find { |u| u[:url] == args.first } }.nil? }
+            return providers.any? { |p| !p.find { |k, v| v.find { |u| u[:url] == args.first } }.nil? }
           end
           super
         else
-- 
1.7.6.5


Re: [PATCH core] Fix valid_provider_url? to return a boolean value

Posted by Michal Fojtik <mf...@redhat.com>.
Hi Tomas,

ACK. Good catch!

  -- Michal


Michal Fojtik
http://deltacloud.org
mfojtik@redhat.com



On Feb 24, 2012, at 4:13 PM, tsedovic@redhat.com wrote:

> From: Tomas Sedovic <to...@sedovic.cz>
> 
> Calling `client.driver('rhevm').valid_provider_url?` used to return an array of
> true/false values instead of a single boolean.
> ---
> client/lib/base_object.rb |    2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/client/lib/base_object.rb b/client/lib/base_object.rb
> index fb9738f..5f63b5d 100644
> --- a/client/lib/base_object.rb
> +++ b/client/lib/base_object.rb
> @@ -151,7 +151,7 @@ module DeltaCloud
>             return providers.any? { |p| p.keys.include? args.first.to_sym }
>           end
>           if method_name == :"valid_provider_url?"
> -            return providers.map { |p| !p.find { |k, v| v.find { |u| u[:url] == args.first } }.nil? }
> +            return providers.any? { |p| !p.find { |k, v| v.find { |u| u[:url] == args.first } }.nil? }
>           end
>           super
>         else
> -- 
> 1.7.6.5
>