incubator-deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michal Fojtik <mfoj...@redhat.com>
Subject Re: [PATCH 1/2] Allow client object actions take arguments.
Date Mon, 15 Nov 2010 09:17:04 GMT
On 13/11/10 07:32 -0500, tcrawley@redhat.com wrote:
>From: Tobias Crawley <tcrawley@redhat.com>
>
>---
> client/lib/base_object.rb |   11 ++++++++---
> 1 files changed, 8 insertions(+), 3 deletions(-)
>
>diff --git a/client/lib/base_object.rb b/client/lib/base_object.rb
>index ddd1b9f..295968c 100644
>--- a/client/lib/base_object.rb
>+++ b/client/lib/base_object.rb
>@@ -172,7 +172,7 @@ module DeltaCloud
>           base_method_handler(m, args)
>         rescue NoHandlerForMethod
>           case m[:type]
>-            when :action_link then do_action(m)
>+            when :action_link then do_action(m, args)
>             else raise NoHandlerForMethod
>           end
>         end
>@@ -180,8 +180,13 @@ module DeltaCloud
>
>       private
>
>-      def do_action(m)
>-        @client.request(:"#{m[:method]}", m[:href], {}, {})
>+      def do_action(m, args)
>+        args = args.first || {}
>+        method = m[:method].to_sym
>+        @client.request(method,
>+                        m[:href],
>+                        method == :get ? args : {},
>+                        method == :get ? {} : args)
>         action_trigger(m[:rel])
>       end
>
>--
>1.7.2.3

Works perfectly fine to me. ACK

>

-- 
--------------------------------------------------------
Michal Fojtik, mfojtik@redhat.com
Deltacloud API: http://deltacloud.org
--------------------------------------------------------

Mime
View raw message