You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltacloud.apache.org by mf...@redhat.com on 2010/12/21 12:58:03 UTC

[PATCH core 2/2] Added name and kind properties to Storage Volume model to match RHEV-M model of Storage Domain

From: Michal Fojtik <mf...@redhat.com>

---
 server/lib/deltacloud/models/storage_volume.rb |    2 ++
 server/views/storage_volumes/show.html.haml    |    4 ++++
 server/views/storage_volumes/show.xml.haml     |   14 ++++++++++++--
 3 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/server/lib/deltacloud/models/storage_volume.rb b/server/lib/deltacloud/models/storage_volume.rb
index 0673f85..6bbd938 100644
--- a/server/lib/deltacloud/models/storage_volume.rb
+++ b/server/lib/deltacloud/models/storage_volume.rb
@@ -24,5 +24,7 @@ class StorageVolume < BaseModel
   attr_accessor :capacity
   attr_accessor :instance_id
   attr_accessor :device
+  attr_accessor :name
+  attr_accessor :kind
 
 end
diff --git a/server/views/storage_volumes/show.html.haml b/server/views/storage_volumes/show.html.haml
index 7cbe172..ca2fded 100644
--- a/server/views/storage_volumes/show.html.haml
+++ b/server/views/storage_volumes/show.html.haml
@@ -3,6 +3,10 @@
 
 %dl
   %di
+    %dt Name
+    %dd
+      = @storage_volume.name
+  %di
     %dt Created
     %dd
       = @storage_volume.created
diff --git a/server/views/storage_volumes/show.xml.haml b/server/views/storage_volumes/show.xml.haml
index ebf1b24..b5eced8 100644
--- a/server/views/storage_volumes/show.xml.haml
+++ b/server/views/storage_volumes/show.xml.haml
@@ -1,9 +1,19 @@
 !!!XML
 %storage_volume{ :href => storage_volume_url(@storage_volume.id), :id => @storage_volume.id}
-  %created<
-    =@storage_volume.created
+  - if @storage_volume.created
+    %created<
+      =@storage_volume.created
   %capacity{ :unit => "GB" }<
     = @storage_volume.capacity
+  - if @storage_volume.kind
+    %kind
+      = @storage_volume.kind
+  - if @storage_volume.name
+    %name
+      = @storage_volume.name
+  - if @storage_volume.device
+    %device
+      = @storage_volume.device
   - unless @storage_volume.instance_id.nil?
     %mount
       %instance{:href => @storage_volume.instance_id, :id => @storage_volume.instance_id}
-- 
1.7.3.3