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] CIMI: make destroy_system(credentials, id) method's signature consistent with destroy_instance's so that operation works on mock
Date Mon, 08 Apr 2013 09:37:14 GMT
On 04/05/2013 06:41 PM, diesk@fast.au.fujitsu.com wrote:

ACK, one minor suggestion below.

> From: Dies Koper <diesk@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 <mfojtik@redhat.com>
Deltacloud API, CloudForms

Mime
View raw message