You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltacloud.apache.org by di...@fast.au.fujitsu.com on 2013/04/05 18:41:33 UTC

[PATCH] CIMI: make destroy_system(credentials, id) method's signature consistent with destroy_instance's so that operation works on mock

From: Dies Koper <di...@fast.au.fujitsu.com>

---
 server/lib/cimi/service/system.rb                              | 2 +-
 server/lib/deltacloud/drivers/fgcp/fgcp_driver_cimi_methods.rb | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/server/lib/cimi/service/system.rb b/server/lib/cimi/service/system.rb
index 9324783..dac9174 100644
--- a/server/lib/cimi/service/system.rb
+++ b/server/lib/cimi/service/system.rb
@@ -39,7 +39,7 @@ class CIMI::Service::System < CIMI::Service::Base
   end
 
   def self.delete!(id, context)
-    context.driver.destroy_system(context.credentials, {:id=>id})
+    context.driver.destroy_system(context.credentials, id)
   end
 
 
diff --git a/server/lib/deltacloud/drivers/fgcp/fgcp_driver_cimi_methods.rb b/server/lib/deltacloud/drivers/fgcp/fgcp_driver_cimi_methods.rb
index 386cc11..352f9a7 100644
--- a/server/lib/deltacloud/drivers/fgcp/fgcp_driver_cimi_methods.rb
+++ b/server/lib/deltacloud/drivers/fgcp/fgcp_driver_cimi_methods.rb
@@ -92,8 +92,8 @@ module Deltacloud::Drivers::Fgcp
       end
     end
 
-    def destroy_system(credentials, opts={})
-      delete_firewall(credentials, {:id=>"#{opts[:id]}-S-0001"})
+    def destroy_system(credentials, id)
+      delete_firewall(credentials, {:id=>"#{id}-S-0001"})
     end
 
     def start_system(credentials, opts={})
-- 
1.8.0.msysgit.0



Re: [PATCH] CIMI: make destroy_system(credentials, id) method's signature consistent with destroy_instance's so that operation works on mock

Posted by Michal Fojtik <mf...@redhat.com>.
On 04/05/2013 06:41 PM, diesk@fast.au.fujitsu.com wrote:

ACK, one minor suggestion below.

> From: Dies Koper <di...@fast.au.fujitsu.com>
>
> ---
>   server/lib/cimi/service/system.rb                              | 2 +-
>   server/lib/deltacloud/drivers/fgcp/fgcp_driver_cimi_methods.rb | 4 ++--
>   2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/server/lib/cimi/service/system.rb b/server/lib/cimi/service/system.rb
> index 9324783..dac9174 100644
> --- a/server/lib/cimi/service/system.rb
> +++ b/server/lib/cimi/service/system.rb
> @@ -39,7 +39,7 @@ class CIMI::Service::System < CIMI::Service::Base
>     end
>
>     def self.delete!(id, context)
> -    context.driver.destroy_system(context.credentials, {:id=>id})
> +    context.driver.destroy_system(context.credentials, id)
>     end
>
>
> diff --git a/server/lib/deltacloud/drivers/fgcp/fgcp_driver_cimi_methods.rb b/server/lib/deltacloud/drivers/fgcp/fgcp_driver_cimi_methods.rb
> index 386cc11..352f9a7 100644
> --- a/server/lib/deltacloud/drivers/fgcp/fgcp_driver_cimi_methods.rb
> +++ b/server/lib/deltacloud/drivers/fgcp/fgcp_driver_cimi_methods.rb
> @@ -92,8 +92,8 @@ module Deltacloud::Drivers::Fgcp
>         end
>       end
>
> -    def destroy_system(credentials, opts={})
> -      delete_firewall(credentials, {:id=>"#{opts[:id]}-S-0001"})
> +    def destroy_system(credentials, id)
> +      delete_firewall(credentials, {:id=>"#{id}-S-0001"})

FYI, in Ruby you don't need to use {} if the parameter is Hash:

delete_firewall(credentials, :id => "#{id}-S-0001"

but maybe this is just a subjective feeling ;-))

>       end
>
>       def start_system(credentials, opts={})
>


-- 

Michal Fojtik <mf...@redhat.com>
Deltacloud API, CloudForms