You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltacloud.apache.org by Francesco Vollero <fv...@redhat.com> on 2013/03/22 14:11:10 UTC

[PATCH core 2/3] core: views got modified due to tilt template changes

Signed-off-by: Francesco Vollero <fv...@redhat.com>
---
 server/views/addresses/index.xml.haml         |  2 +-
 server/views/addresses/show.xml.haml          | 18 +++----
 server/views/buckets/index.xml.haml           |  2 +-
 server/views/buckets/show.xml.haml            | 12 ++---
 server/views/hardware_profiles/index.xml.haml |  4 +-
 server/views/hardware_profiles/show.xml.haml  |  8 +--
 server/views/images/index.xml.haml            |  2 +-
 server/views/images/show.xml.haml             | 28 +++++-----
 server/views/instances/index.xml.haml         |  2 +-
 server/views/instances/show.xml.haml          | 74 +++++++++++++--------------
 server/views/keys/index.xml.haml              |  2 +-
 server/views/keys/show.xml.haml               | 24 ++++-----
 server/views/load_balancers/index.xml.haml    |  2 +-
 server/views/load_balancers/show.xml.haml     | 18 +++----
 server/views/metrics/index.xml.haml           |  2 +-
 server/views/metrics/show.xml.haml            |  6 +--
 server/views/realms/index.xml.haml            |  2 +-
 server/views/realms/show.xml.haml             | 10 ++--
 server/views/storage_snapshots/index.xml.haml |  2 +-
 server/views/storage_snapshots/show.xml.haml  |  8 +--
 server/views/storage_volumes/index.xml.haml   |  2 +-
 server/views/storage_volumes/show.xml.haml    | 42 +++++++--------
 22 files changed, 136 insertions(+), 136 deletions(-)

diff --git a/server/views/addresses/index.xml.haml b/server/views/addresses/index.xml.haml
index abf83b7..7806bda 100644
--- a/server/views/addresses/index.xml.haml
+++ b/server/views/addresses/index.xml.haml
@@ -1,4 +1,4 @@
 !!!XML
 %addresses
   - @elements.each do |c|
-    = haml :'addresses/show', :locals => { :@address => c, :partial => true }
+    = haml :'addresses/show', :locals => { :address => c, :partial => true }
diff --git a/server/views/addresses/show.xml.haml b/server/views/addresses/show.xml.haml
index 1ae8814..28d8b6d 100644
--- a/server/views/addresses/show.xml.haml
+++ b/server/views/addresses/show.xml.haml
@@ -1,14 +1,14 @@
 - unless defined?(partial)
   !!! XML
-%address{ :href => address_url(@address.id), :id => @address.id }
+%address{ :href => address_url(address.id), :id => address.id }
   %ip<
-    =@address.id
+    =address.id
   %actions
     - if driver.respond_to?(:destroy_address)
-      %link{ :rel => "destroy", :method => "delete", :href => destroy_address_url(@address.id)}
-    - if driver.respond_to?(:associate_address) and not @address.instance_id
-      %link{ :rel => "associate", :method => "post", :href => associate_address_url(@address.id)}
-    - if driver.respond_to?(:disassociate_address) and @address.instance_id
-      %link{ :rel => "disassociate", :method => "post", :href => disassociate_address_url(@address.id)}
-  - if @address.instance_id
-    %instance{ :href => instance_url(@address.instance_id), :id => @address.instance_id}
+      %link{ :rel => "destroy", :method => "delete", :href => destroy_address_url(address.id)}
+    - if driver.respond_to?(:associate_address) and not address.instance_id
+      %link{ :rel => "associate", :method => "post", :href => associate_address_url(address.id)}
+    - if driver.respond_to?(:disassociate_address) and address.instance_id
+      %link{ :rel => "disassociate", :method => "post", :href => disassociate_address_url(address.id)}
+  - if address.instance_id
+    %instance{ :href => instance_url(address.instance_id), :id => address.instance_id}
diff --git a/server/views/buckets/index.xml.haml b/server/views/buckets/index.xml.haml
index 9f1fd20..9cc4dc5 100644
--- a/server/views/buckets/index.xml.haml
+++ b/server/views/buckets/index.xml.haml
@@ -1,4 +1,4 @@
 !!!XML
 %buckets
   - @elements.each do |c|
-    = haml :'buckets/show', :locals => { :@bucket => c, :partial => true }
+    = haml :'buckets/show', :locals => { :bucket => c, :partial => true }
diff --git a/server/views/buckets/show.xml.haml b/server/views/buckets/show.xml.haml
index 67f6935..ca2c1c9 100644
--- a/server/views/buckets/show.xml.haml
+++ b/server/views/buckets/show.xml.haml
@@ -1,10 +1,10 @@
 - unless defined?(partial)
   !!! XML
-%bucket{:href => bucket_url(@bucket.id), :id => @bucket.id}
-  - @bucket.attributes.select{ |attr| attr!=:id }.each do |attribute|
+%bucket{:href => bucket_url(bucket.id), :id => bucket.id}
+  - bucket.attributes.select{ |attr| attr!=:id }.each do |attribute|
     - unless attribute == :blob_list
       -haml_tag(attribute, :<) do
-        - haml_concat @bucket.send(attribute)
-  - if @bucket.blob_list
-    - @bucket.blob_list.each do |blb|
-      %blob{:id => blb, :href => bucket_url(@bucket.id) +"/#{blb}"}
+        - haml_concat bucket.send(attribute)
+  - if bucket.blob_list
+    - bucket.blob_list.each do |blb|
+      %blob{:id => blb, :href => bucket_url(bucket.id) +"/#{blb}"}
diff --git a/server/views/hardware_profiles/index.xml.haml b/server/views/hardware_profiles/index.xml.haml
index 9292c5b..c977ffb 100644
--- a/server/views/hardware_profiles/index.xml.haml
+++ b/server/views/hardware_profiles/index.xml.haml
@@ -1,4 +1,4 @@
 !!! XML
 %hardware_profiles
-  - order_hardware_profiles(@hardware_profiles).each do |prof|
-    = haml :'hardware_profiles/show', :locals => { :@hardware_profile => prof, :partial => true }
+  - order_hardware_profiles(hardware_profiles).each do |prof|
+    = haml :'hardware_profiles/show', :locals => { :hardware_profile => prof, :partial => true }
diff --git a/server/views/hardware_profiles/show.xml.haml b/server/views/hardware_profiles/show.xml.haml
index 677674f..9709c52 100644
--- a/server/views/hardware_profiles/show.xml.haml
+++ b/server/views/hardware_profiles/show.xml.haml
@@ -1,10 +1,10 @@
 - unless defined?(partial)
   !!! XML
-%hardware_profile{ :href => hardware_profile_url(@hardware_profile.id), :id => @hardware_profile.id }
-  %id= @hardware_profile.id
+%hardware_profile{ :href => hardware_profile_url(hardware_profile.id), :id => hardware_profile.id }
+  %id= hardware_profile.id
   %name<
-    = @hardware_profile.name
-  - @hardware_profile.each_property do |prop|
+    = hardware_profile.name
+  - hardware_profile.each_property do |prop|
     - attr = { :name => prop.name, :kind => prop.kind, :unit => prop.unit }
     - if prop.kind == :fixed
       %property{ attr, :value => prop.value }/
diff --git a/server/views/images/index.xml.haml b/server/views/images/index.xml.haml
index 52d86e6..68c8ef8 100644
--- a/server/views/images/index.xml.haml
+++ b/server/views/images/index.xml.haml
@@ -2,4 +2,4 @@
   !!! XML
 %images
   - @elements.each do |c|
-    = haml :'images/show', :locals => { :@image => c, :partial => true }
+    = haml :'images/show', :locals => { :image => c, :partial => true }
diff --git a/server/views/images/show.xml.haml b/server/views/images/show.xml.haml
index ac014af..a1988c0 100644
--- a/server/views/images/show.xml.haml
+++ b/server/views/images/show.xml.haml
@@ -1,20 +1,20 @@
 - unless defined?(partial)
   !!! XML
-%image{:href => image_url(@image.id), :id => @image.id}
-  %name=@image.name
-  %description=@image.description
-  %owner_id=@image.owner_id
-  %architecture=@image.architecture
-  - if @image.state
-    %state=@image.state
-  - if @image.creation_time
-    %creation_time=@image.creation_time
-  - if @image.hardware_profiles
+%image{:href => image_url(image.id), :id => image.id}
+  %name=image.name
+  %description=image.description
+  %owner_id=image.owner_id
+  %architecture=image.architecture
+  - if image.state
+    %state=image.state
+  - if image.creation_time
+    %creation_time=image.creation_time
+  - if image.hardware_profiles
     %hardware_profiles
-      - @image.hardware_profiles.each do |profile|
+      - image.hardware_profiles.each do |profile|
         %hardware_profile{ :href => hardware_profile_url(profile.id), :id => profile.id, :rel => :hardware_profile }
-  %root_type=@image.root_type
+  %root_type=image.root_type
   %actions
-    %link{ :rel => 'create_instance', :method => :post, :href => "#{instances_url};image_id=#{@image.id}"}
+    %link{ :rel => 'create_instance', :method => :post, :href => "#{instances_url};image_id=#{image.id}"}
     - if driver.respond_to? :destroy_image
-      %link{ :rel => 'destroy_image', :method => :delete, :href => "#{destroy_image_url(@image.id)}" }
+      %link{ :rel => 'destroy_image', :method => :delete, :href => "#{destroy_image_url(image.id)}" }
diff --git a/server/views/instances/index.xml.haml b/server/views/instances/index.xml.haml
index e5f39ba..f0807ed 100644
--- a/server/views/instances/index.xml.haml
+++ b/server/views/instances/index.xml.haml
@@ -1,4 +1,4 @@
 !!! XML
 %instances
   - @elements.each do |c|
-    = haml :'instances/show', :locals => { :@instance => c, :partial => true }
+    = haml :'instances/show', :locals => { :instance => c, :partial => true }
diff --git a/server/views/instances/show.xml.haml b/server/views/instances/show.xml.haml
index 6a888f7..654037b 100644
--- a/server/views/instances/show.xml.haml
+++ b/server/views/instances/show.xml.haml
@@ -1,60 +1,60 @@
 - unless defined?(partial)
   !!! XML
-%instance{:href => instance_url(@instance.id), :id => @instance.id}
-  - if @instance.name
+%instance{:href => instance_url(instance.id), :id => instance.id}
+  - if instance.name
     %name<
-      =@instance.name
-  - if @instance.owner_id
+      =instance.name
+  - if instance.owner_id
     %owner_id<
-      =@instance.owner_id
-  - if @instance.image_id
-    %image{:href => image_url(@instance.image_id), :id => @instance.image_id }
-  - if @instance.realm_id
-    %realm{:href => realm_url(@instance.realm_id), :id => @instance.realm_id }
-  - if @instance.state
+      =instance.owner_id
+  - if instance.image_id
+    %image{:href => image_url(instance.image_id), :id => instance.image_id }
+  - if instance.realm_id
+    %realm{:href => realm_url(instance.realm_id), :id => instance.realm_id }
+  - if instance.state
     %state<
-      =@instance.state
-  - if @instance.instance_profile
-    - haml_tag :"hardware_profile", {:id => @instance.instance_profile.id, :href => hardware_profile_url(@instance.instance_profile.id)} do
-      - @instance.instance_profile.overrides.each do |p, v|
+      =instance.state
+  - if instance.instance_profile
+    - haml_tag :"hardware_profile", {:id => instance.instance_profile.id, :href => hardware_profile_url(instance.instance_profile.id)} do
+      - instance.instance_profile.overrides.each do |p, v|
         %property{:kind => 'fixed', :name => p, :value => v, :unit => Deltacloud::HardwareProfile::unit(p)}
-  - if @instance.actions
+  - if instance.actions
     %actions
-      - @instance.actions.compact.each do |instance_action|
-        %link{:rel => instance_action, :method => instance_action_method(instance_action), :href => self.send("#{instance_action}_instance_url", @instance.id)}
+      - instance.actions.compact.each do |instance_action|
+        %link{:rel => instance_action, :method => instance_action_method(instance_action), :href => self.send("#{instance_action}_instance_url", instance.id)}
       - if driver.respond_to?(:run_on_instance)
-        %link{:rel => 'run', :method => :post, :href => "#{run_instance_url(@instance.id)};id=#{@instance.id}"}
-      - if @instance.can_create_image?
-        %link{:rel => 'create_image', :method => :post, :href => "#{create_image_url};instance_id=#{@instance.id}"}
-  - if @instance.launch_time
+        %link{:rel => 'run', :method => :post, :href => "#{run_instance_url(instance.id)};id=#{instance.id}"}
+      - if instance.can_create_image?
+        %link{:rel => 'create_image', :method => :post, :href => "#{create_image_url};instance_id=#{instance.id}"}
+  - if instance.launch_time
     %launch_time<
-      =@instance.launch_time
-  - if @instance.public_addresses
+      =instance.launch_time
+  - if instance.public_addresses
     %public_addresses<
-      - @instance.public_addresses.each do |a|
+      - instance.public_addresses.each do |a|
         %address{ :type => a.address_type, :port => a.port }=a.address
-  - if @instance.private_addresses
+  - if instance.private_addresses
     %private_addresses<
-      - @instance.private_addresses.each do |a|
+      - instance.private_addresses.each do |a|
         %address{ :type => a.address_type, :port => a.port }=a.address
-  - if @instance.firewalls
+  - if instance.firewalls
     %firewalls<
-      - @instance.firewalls.each do |firewall|
+      - instance.firewalls.each do |firewall|
         %firewall{:href => firewall_url(firewall), :id => firewall }
-  - if @instance.storage_volumes
+  - if instance.storage_volumes
     %storage_volumes<
-      - @instance.storage_volumes.each do |volume|
+      - instance.storage_volumes.each do |volume|
         %storage_volume{:href=> storage_volume_url(volume.keys.first), :id => volume.keys.first, :device => volume.values.first}
   - if driver.class.has_feature?(:instances, :authentication_key) or driver.class.has_feature?(:instances, :authentication_password)
     %authentication{ :type => auth_feature_name }
-      - if @instance.authn_feature_failed?
-        %error  #{@instance.authn_error}
+      - if instance.authn_feature_failed?
+        %error  #{instance.authn_error}
       - else
-        - if @instance.password
+        - if instance.password
           %login
-            %username #{@instance.username}
-            %password=cdata(@instance.password)
-        - if @instance.keyname
+            %username #{instance.username}
+            %password=cdata(instance.password)
+        - if instance.keyname
           %login
-            %keyname #{@instance.keyname}
+            %keyname #{instance.keyname}
 
diff --git a/server/views/keys/index.xml.haml b/server/views/keys/index.xml.haml
index 9256716..76ae781 100644
--- a/server/views/keys/index.xml.haml
+++ b/server/views/keys/index.xml.haml
@@ -1,4 +1,4 @@
 !!!XML
 %keys
   - @elements.each do |c|
-    = haml :'keys/show', :locals => { :@key => c, :partial => true }
+    = haml :'keys/show', :locals => { :key => c, :partial => true }
diff --git a/server/views/keys/show.xml.haml b/server/views/keys/show.xml.haml
index db0786b..49e6de3 100644
--- a/server/views/keys/show.xml.haml
+++ b/server/views/keys/show.xml.haml
@@ -1,23 +1,23 @@
 - unless defined?(partial)
   !!! XML
-%key{ :href => key_url(@key.id), :id => @key.id, :type => "#{@key.credential_type}" }
-  %name=@key.name
+%key{ :href => key_url(key.id), :id => key.id, :type => "#{key.credential_type}" }
+  %name=key.name
   %actions
     - if driver.respond_to?(:destroy_key)
-      %link{ :rel => "destroy", :method => "delete", :href => destroy_key_url(@key.id)}
-  - if @key.is_key?
-    - if @key.fingerprint
+      %link{ :rel => "destroy", :method => "delete", :href => destroy_key_url(key.id)}
+  - if key.is_key?
+    - if key.fingerprint
       %fingerprint<
-        =@key.fingerprint
-    - unless @key.pem_rsa_key.nil?
+        =key.fingerprint
+    - unless key.pem_rsa_key.nil?
       %pem
-        ~render_cdata(@key.pem_rsa_key)
-  - if @key.is_password?
+        ~render_cdata(key.pem_rsa_key)
+  - if key.is_password?
     %username<
       =cdata do
-        =@key.username
+        =key.username
     %password<
       =cdata do
-        =@key.password
+        =key.password
   %state<
-    =@key.state
+    =key.state
diff --git a/server/views/load_balancers/index.xml.haml b/server/views/load_balancers/index.xml.haml
index 053b628..2459fcb 100644
--- a/server/views/load_balancers/index.xml.haml
+++ b/server/views/load_balancers/index.xml.haml
@@ -1,4 +1,4 @@
 !!!XML
 %load_balancers
   - @elements.each do |c|
-    = haml :'load_balancers/show', :locals => { :@load_balancer => c, :partial => true }
+    = haml :'load_balancers/show', :locals => { :load_balancer => c, :partial => true }
diff --git a/server/views/load_balancers/show.xml.haml b/server/views/load_balancers/show.xml.haml
index 2eeb09e..43b7034 100644
--- a/server/views/load_balancers/show.xml.haml
+++ b/server/views/load_balancers/show.xml.haml
@@ -1,21 +1,21 @@
 - unless defined?(partial)
   !!! XML
-%load_balancer{ :href => load_balancer_url(@load_balancer.id), :id => @load_balancer.id}
+%load_balancer{ :href => load_balancer_url(load_balancer.id), :id => load_balancer.id}
   %actions
-    %link{ :rel => "destroy", :method => "delete", :href => destroy_load_balancer_url(@load_balancer.id)}
-    %link{ :rel => "register", :method => "post", :href => register_load_balancer_url(@load_balancer.id)}
+    %link{ :rel => "destroy", :method => "delete", :href => destroy_load_balancer_url(load_balancer.id)}
+    %link{ :rel => "register", :method => "post", :href => register_load_balancer_url(load_balancer.id)}
   %public_addresses
-    - @load_balancer.public_addresses.each do |address|
+    - load_balancer.public_addresses.each do |address|
       %address #{address}
   %created_at<
-    = @load_balancer.created_at
-  %realm{ :href => realm_url(@load_balancer.realms.first.id), :id => @load_balancer.realms.first.id}
+    = load_balancer.created_at
+  %realm{ :href => realm_url(load_balancer.realms.first.id), :id => load_balancer.realms.first.id}
   %listeners
-    - @load_balancer.listeners.each do |listener|
+    - load_balancer.listeners.each do |listener|
       %listener{ :protocol => listener.protocol}
         %load_balancer_port #{listener.load_balancer_port}
         %instance_port #{listener.instance_port}
   %instances
-    - @load_balancer.instances.each do |instance|
+    - load_balancer.instances.each do |instance|
       %instance{:href => instance_url(instance.id), :id => instance.id}
-        %link{:rel => "unregister", :href => unregister_load_balancer_url(@load_balancer.id, { :instance_id => instance.id})}
+        %link{:rel => "unregister", :href => unregister_load_balancer_url(load_balancer.id, { :instance_id => instance.id})}
diff --git a/server/views/metrics/index.xml.haml b/server/views/metrics/index.xml.haml
index bd5c184..b67f2a8 100644
--- a/server/views/metrics/index.xml.haml
+++ b/server/views/metrics/index.xml.haml
@@ -2,4 +2,4 @@
   !!!XML
 %metrics
   - @elements.each do |c|
-    = haml :'metrics/show', :locals => { :@metric => c, :partial => true}
+    = haml :'metrics/show', :locals => { :metric => c, :partial => true}
diff --git a/server/views/metrics/show.xml.haml b/server/views/metrics/show.xml.haml
index 87254d0..5434413 100644
--- a/server/views/metrics/show.xml.haml
+++ b/server/views/metrics/show.xml.haml
@@ -1,10 +1,10 @@
 - unless defined?(partial)
   !!! XML
-%metric{:href => metric_url(@metric.id), :id => @metric.id}
+%metric{:href => metric_url(metric.id), :id => metric.id}
   -haml_tag(:entity, :<) do
-    -haml_concat @metric.send(:entity) || @metric.send(:id)
+    -haml_concat metric.send(:entity) || metric.send(:id)
   %properties
-    -@metric.properties.each do |prop|
+    -metric.properties.each do |prop|
       -haml_tag(prop.name, :<) do
         - if prop.values
           - prop.values.each do |p|
diff --git a/server/views/realms/index.xml.haml b/server/views/realms/index.xml.haml
index 71d1cb1..2c6cef3 100644
--- a/server/views/realms/index.xml.haml
+++ b/server/views/realms/index.xml.haml
@@ -1,4 +1,4 @@
 !!!XML
 %realms
   - @elements.each do |c|
-    = haml :'realms/show', :locals => { :@realm => c, :partial => true }
+    = haml :'realms/show', :locals => { :realm => c, :partial => true }
diff --git a/server/views/realms/show.xml.haml b/server/views/realms/show.xml.haml
index 5c06c06..2cc0c8c 100644
--- a/server/views/realms/show.xml.haml
+++ b/server/views/realms/show.xml.haml
@@ -1,11 +1,11 @@
 - unless defined?(partial)
   !!! XML
-%realm{:href => realm_url(@realm.id), :id => @realm.id }
+%realm{:href => realm_url(realm.id), :id => realm.id }
   %name<
-    =@realm.name
+    =realm.name
   %state<
-    =@realm.state
-  - unless @realm.limit.eql?(:unlimited)
+    =realm.state
+  - unless realm.limit.eql?(:unlimited)
     %limit<
       =cdata do
-        =@realm.limit
+        =realm.limit
diff --git a/server/views/storage_snapshots/index.xml.haml b/server/views/storage_snapshots/index.xml.haml
index 9ae9675..3d29a2b 100644
--- a/server/views/storage_snapshots/index.xml.haml
+++ b/server/views/storage_snapshots/index.xml.haml
@@ -1,4 +1,4 @@
 !!!XML
 %storage_snapshots
   - @elements.each do |c|
-    = haml :'storage_snapshots/show', :locals => { :@storage_snapshot => c, :partial => true }
+    = haml :'storage_snapshots/show', :locals => { :storage_snapshot => c, :partial => true }
diff --git a/server/views/storage_snapshots/show.xml.haml b/server/views/storage_snapshots/show.xml.haml
index a47a652..075fdc4 100644
--- a/server/views/storage_snapshots/show.xml.haml
+++ b/server/views/storage_snapshots/show.xml.haml
@@ -1,7 +1,7 @@
 - unless defined?(partial)
   !!! XML
-%storage_snapshot{:href => storage_snapshot_url(@storage_snapshot.id), :id => @storage_snapshot.id }
-  %name=@storage_snapshot.id
+%storage_snapshot{:href => storage_snapshot_url(storage_snapshot.id), :id => storage_snapshot.id }
+  %name=storage_snapshot.id
   %created<
-    =@storage_snapshot.created
-  %storage_volume{:href => storage_volume_url(@storage_snapshot.storage_volume_id), :id => @storage_snapshot.storage_volume_id}
+    =storage_snapshot.created
+  %storage_volume{:href => storage_volume_url(storage_snapshot.storage_volume_id), :id => storage_snapshot.storage_volume_id}
diff --git a/server/views/storage_volumes/index.xml.haml b/server/views/storage_volumes/index.xml.haml
index e73c46a..7dfb2b5 100644
--- a/server/views/storage_volumes/index.xml.haml
+++ b/server/views/storage_volumes/index.xml.haml
@@ -1,4 +1,4 @@
 !!!XML
 %storage_volumes
   - @elements.each do |volume|
-    = haml :'storage_volumes/show', :locals =>  { :@storage_volume =>  volume, :partial =>  true } 
+    = haml :'storage_volumes/show', :locals =>  { :storage_volume =>  volume, :partial =>  true } 
diff --git a/server/views/storage_volumes/show.xml.haml b/server/views/storage_volumes/show.xml.haml
index ccd1baa..f96bc4f 100644
--- a/server/views/storage_volumes/show.xml.haml
+++ b/server/views/storage_volumes/show.xml.haml
@@ -1,33 +1,33 @@
 - unless defined?(partial)
   !!!XML
-%storage_volume{ :href => storage_volume_url(@storage_volume.id), :id => @storage_volume.id}
-  - if @storage_volume.created
+%storage_volume{ :href => storage_volume_url(storage_volume.id), :id => storage_volume.id}
+  - if storage_volume.created
     %created<
-      =@storage_volume.created
+      =storage_volume.created
   %capacity{ :unit => "GB" }<
-    = @storage_volume.capacity
-  - if @storage_volume.kind
+    = storage_volume.capacity
+  - if storage_volume.kind
     %kind<
-      = @storage_volume.kind
+      = storage_volume.kind
   %name<
-    = @storage_volume.name || @storage_volume.id
-  - if @storage_volume.device
+    = storage_volume.name || storage_volume.id
+  - if storage_volume.device
     %device<
-      = @storage_volume.device
-  - if @storage_volume.realm_id
-    %realm{:id => @storage_volume.realm_id, :href => realm_url(@storage_volume.realm_id)}
+      = storage_volume.device
+  - if storage_volume.realm_id
+    %realm{:id => storage_volume.realm_id, :href => realm_url(storage_volume.realm_id)}
     %realm_id<
-      = @storage_volume.realm_id
-  - if @storage_volume.state
+      = storage_volume.realm_id
+  - if storage_volume.state
     %state<
-      = @storage_volume.state
+      = storage_volume.state
 
-  - unless @storage_volume.instance_id.nil?
+  - unless storage_volume.instance_id.nil?
     %mount
-      %instance{:href => instance_url(@storage_volume.instance_id), :id => @storage_volume.instance_id}
-      - unless @storage_volume.device.nil?
-        %device{ :name => @storage_volume.device }
-  - if @storage_volume.actions
+      %instance{:href => instance_url(storage_volume.instance_id), :id => storage_volume.instance_id}
+      - unless storage_volume.device.nil?
+        %device{ :name => storage_volume.device }
+  - if storage_volume.actions
     %actions
-      - @storage_volume.actions.each do |action|
-        %link{:rel => action, :method => :post, :href => self.send("#{action}_storage_volume_url", @storage_volume.id)}
+      - storage_volume.actions.each do |action|
+        %link{:rel => action, :method => :post, :href => self.send("#{action}_storage_volume_url", storage_volume.id)}
-- 
1.8.1.4