deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@redhat.com
Subject [PATCH core 4/6] Mock: The user_metadata Hash is not being properly serialized
Date Tue, 20 Mar 2012 13:28:07 GMT
From: Michal Fojtik <mfojtik@redhat.com>

The user_metadata has is not properly serialized to Hash in the Mock
driver. This patch will asure that the user_metadata is hash before
iterate through it.

Signed-off-by: Michal fojtik <mfojtik@redhat.com>
---
 server/views/blobs/show.xml.haml |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/server/views/blobs/show.xml.haml b/server/views/blobs/show.xml.haml
index 34b9cca..686d793 100644
--- a/server/views/blobs/show.xml.haml
+++ b/server/views/blobs/show.xml.haml
@@ -5,7 +5,8 @@
       - haml_tag(attribute, :<) do
         - haml_concat @blob.send(attribute)
   %user_metadata
-    - @blob.user_metadata.each do |k, v|
-      %entry{:key => k}
-        #{cdata v}
+    - if @blob.kind_of? Hash
+      - @blob.user_metadata.each do |k, v|
+        %entry{:key => k}
+          #{cdata v}
   %content{:href => bucket_url(@blob.bucket) + '/' + @blob.id + '/content'}
-- 
1.7.9.1


Mime
View raw message