ACK ... was able to create/destroy load balancers and storage snapshots.

> From: [email protected]
> To: [email protected]
> Sent: Wednesday, August 1, 2012 8:37:45 AM
> Subject: [PATCH core] Core: Added missing :with_capability options 
> (DTACLOUD-298)
> 
> From: Michal Fojtik <[email protected]>
> 
> Without this option the DC will fail to check required capability
> and end with exception.
> 
> Signed-off-by: Michal fojtik <[email protected]>
> ---
>  server/lib/deltacloud/collections/load_balancers.rb  |    8 ++++----
>  server/lib/deltacloud/collections/storage_volumes.rb |    2 +-
>  2 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/server/lib/deltacloud/collections/load_balancers.rb
> b/server/lib/deltacloud/collections/load_balancers.rb
> index 2a10311..f560f16 100644
> --- a/server/lib/deltacloud/collections/load_balancers.rb
> +++ b/server/lib/deltacloud/collections/load_balancers.rb
> @@ -41,7 +41,7 @@ module Deltacloud::Collections
>          end
>        end
>  
> -      operation :create do
> +      operation :create, :with_capability => :create_load_balancer
> do
>          param :name,  :string,  :required
>          param :realm_id,  :string,  :required
>          param :listener_protocol,  :string,  :required, ['HTTP',
>          'TCP']
> @@ -59,7 +59,7 @@ module Deltacloud::Collections
>          end
>        end
>  
> -      action :register do
> +      action :register, :with_capability => :lb_register_instance do
>          param :instance_id, :string,  :required
>          control do
>            driver.lb_register_instance(credentials, params)
> @@ -72,7 +72,7 @@ module Deltacloud::Collections
>          end
>        end
>  
> -      action :unregister do
> +      action :unregister, :with_capability =>
> :lb_unregister_instance do
>          param :instance_id, :string,  :required
>          control do
>            driver.lb_unregister_instance(credentials, params)
> @@ -85,7 +85,7 @@ module Deltacloud::Collections
>          end
>        end
>  
> -      operation :destroy do
> +      operation :destroy, :with_capability => :destroy_load_balancer
> do
>          control do
>            driver.destroy_load_balancer(credentials, params[:id])
>            status 204
> diff --git a/server/lib/deltacloud/collections/storage_volumes.rb
> b/server/lib/deltacloud/collections/storage_volumes.rb
> index 147c4c1..dde5e32 100644
> --- a/server/lib/deltacloud/collections/storage_volumes.rb
> +++ b/server/lib/deltacloud/collections/storage_volumes.rb
> @@ -37,7 +37,7 @@ module Deltacloud::Collections
>          control { show(:storage_volume) }
>        end
>  
> -      operation :create do
> +      operation :create, :with_capability => :create_storage_volume
> do
>          param :snapshot_id, :string,  :optional
>          param :capacity,    :string,  :optional
>          param :realm_id,    :string,  :optional
> --
> 1.7.10.2
> 
> 

Reply via email to