You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltacloud.apache.org by jv...@redhat.com on 2012/12/18 15:00:19 UTC

[PATCH] DTACLOUD-390 Add name when creating volume.

From: Joe VLcek <jv...@redhat.com>

---
 server/lib/cimi/models/volume.rb | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/server/lib/cimi/models/volume.rb b/server/lib/cimi/models/volume.rb
index 53613f5..bbc61f9 100644
--- a/server/lib/cimi/models/volume.rb
+++ b/server/lib/cimi/models/volume.rb
@@ -95,9 +95,13 @@ class CIMI::Model::Volume < CIMI::Model::Base
   def self.create_volume(params, data, context)
     if params[:volume_config_id]
       volume_config = CIMI::Model::VolumeConfiguration.find(params[:volume_config_id], context)
-      opts = {:capacity=>context.from_kibibyte(volume_config.capacity, "GB"), :snapshot_id=>params[:volume_image_id] }
+      opts = {:capacity=>context.from_kibibyte(volume_config.capacity, "GB"),
+              :snapshot_id=>params[:volume_image_id],
+              :name=>data["name"]}
     elsif params[:capacity]
-      opts = {:capacity=>context.from_kibibyte(params[:capacity], "GB"), :snapshot_id=>params[:volume_image_id]}
+      opts = {:capacity=>context.from_kibibyte(params[:capacity], "GB"),
+              :snapshot_id=>params[:volume_image_id],
+              :name=>data["name"]}
     end
     storage_volume = context.driver.create_storage_volume(context.credentials, opts)
     entity = store_attributes_for(storage_volume, data)
-- 
1.7.11.7


Re: [PATCH] DTACLOUD-390 Add name when creating volume.

Posted by "marios@redhat.com" <ma...@redhat.com>.
ACK & PSH

(I updated DTACLOUD-390 accordingly)

marios

On 18/12/12 16:00, jvlcek@redhat.com wrote:
> From: Joe VLcek <jv...@redhat.com>
> 
> ---
>  server/lib/cimi/models/volume.rb | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/server/lib/cimi/models/volume.rb b/server/lib/cimi/models/volume.rb
> index 53613f5..bbc61f9 100644
> --- a/server/lib/cimi/models/volume.rb
> +++ b/server/lib/cimi/models/volume.rb
> @@ -95,9 +95,13 @@ class CIMI::Model::Volume < CIMI::Model::Base
>    def self.create_volume(params, data, context)
>      if params[:volume_config_id]
>        volume_config = CIMI::Model::VolumeConfiguration.find(params[:volume_config_id], context)
> -      opts = {:capacity=>context.from_kibibyte(volume_config.capacity, "GB"), :snapshot_id=>params[:volume_image_id] }
> +      opts = {:capacity=>context.from_kibibyte(volume_config.capacity, "GB"),
> +              :snapshot_id=>params[:volume_image_id],
> +              :name=>data["name"]}
>      elsif params[:capacity]
> -      opts = {:capacity=>context.from_kibibyte(params[:capacity], "GB"), :snapshot_id=>params[:volume_image_id]}
> +      opts = {:capacity=>context.from_kibibyte(params[:capacity], "GB"),
> +              :snapshot_id=>params[:volume_image_id],
> +              :name=>data["name"]}
>      end
>      storage_volume = context.driver.create_storage_volume(context.credentials, opts)
>      entity = store_attributes_for(storage_volume, data)
>