deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject git commit: Fixes DTACLOUD_181: json output of 'HardareProfile' within an 'Image' object
Date Wed, 28 Mar 2012 10:26:02 GMT
Updated Branches:
  refs/heads/master d2d9cab94 -> bd67983ca


Fixes DTACLOUD_181: json output of 'HardareProfile' within an 'Image' object

https://issues.apache.org/jira/browse/DTACLOUD-181


Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/bd67983c
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/bd67983c
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/bd67983c

Branch: refs/heads/master
Commit: bd67983cac800cec97e4ff5aa0b3ac491452a2f7
Parents: d2d9cab
Author: marios <marios@redhat.com>
Authored: Wed Mar 28 12:18:02 2012 +0300
Committer: marios <marios@redhat.com>
Committed: Wed Mar 28 12:18:02 2012 +0300

----------------------------------------------------------------------
 server/lib/deltacloud/helpers/conversion_helper.rb |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/bd67983c/server/lib/deltacloud/helpers/conversion_helper.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/helpers/conversion_helper.rb b/server/lib/deltacloud/helpers/conversion_helper.rb
index 4afbc0e..310ba4b 100644
--- a/server/lib/deltacloud/helpers/conversion_helper.rb
+++ b/server/lib/deltacloud/helpers/conversion_helper.rb
@@ -31,6 +31,9 @@ module ConversionHelper
           data.merge!({ :href => self.send(:"bucket_url", "#{data[:bucket]}/#{data[:id]}"
) })
         else
           data.merge!({ :href => self.send(:"#{type}_url", data[:id]) })
+          if data.has_key?(:hardware_profiles)
+            data[:hardware_profiles] = data[:hardware_profiles].inject([]){|res, hwp| res
<< {hwp.name => {:href => self.send(:"hardware_profile_url", hwp.name)}}; res
}
+          end
         end
       end
       return { :"#{type}" => data }.to_json


Mime
View raw message