deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@redhat.com
Subject [PATCH core 1/3] Core: Display :destroy_image link only if driver support this operation
Date Thu, 17 Jan 2013 11:48:55 GMT
From: Michal Fojtik <mfojtik@redhat.com>


Signed-off-by: Michal fojtik <mfojtik@redhat.com>
---
 server/views/images/show.xml.haml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/server/views/images/show.xml.haml b/server/views/images/show.xml.haml
index 6350706..db33666 100644
--- a/server/views/images/show.xml.haml
+++ b/server/views/images/show.xml.haml
@@ -15,4 +15,5 @@
         %hardware_profile{ :href => hardware_profile_url(profile.id), :id => profile.id,
:rel => :hardware_profile }
   %actions
     %link{ :rel => 'create_instance', :method => :post, :href => "#{instances_url};image_id=#{@image.id}"}
-    %link{ :rel => 'destroy_image', :method => :delete, :href => "#{destroy_image_url(@image.id)}"
}
+    - if driver.respond_to? :destroy_image
+      %link{ :rel => 'destroy_image', :method => :delete, :href => "#{destroy_image_url(@image.id)}"
}
-- 
1.8.0.2


Mime
View raw message