deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dko...@apache.org
Subject [6/8] git commit: FGCP: add descriptions to machine templates in system template
Date Mon, 15 Jul 2013 07:00:16 GMT
FGCP: add descriptions to machine templates in system template


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

Branch: refs/heads/master
Commit: cbeeef3956439b7f1c4d94936d9f5422e790579f
Parents: 452093b
Author: Dies Koper <diesk@fast.au.fujitsu.com>
Authored: Mon Jul 15 11:40:31 2013 +1000
Committer: Dies Koper <diesk@fast.au.fujitsu.com>
Committed: Mon Jul 15 11:40:31 2013 +1000

----------------------------------------------------------------------
 .../lib/deltacloud/drivers/fgcp/fgcp_driver_cimi_methods.rb   | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/cbeeef39/server/lib/deltacloud/drivers/fgcp/fgcp_driver_cimi_methods.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/drivers/fgcp/fgcp_driver_cimi_methods.rb b/server/lib/deltacloud/drivers/fgcp/fgcp_driver_cimi_methods.rb
index 20c9223..ffae858 100644
--- a/server/lib/deltacloud/drivers/fgcp/fgcp_driver_cimi_methods.rb
+++ b/server/lib/deltacloud/drivers/fgcp/fgcp_driver_cimi_methods.rb
@@ -244,6 +244,7 @@ module Deltacloud::Drivers::Fgcp
       safely do
         client = new_client(credentials)
         context = opts[:env]
+        images = nil #lazy load
         templates = client.list_vsys_descriptor['vsysdescriptors'][0]['vsysdescriptor'].collect
do |desc|
           conf = client.get_vsys_descriptor_configuration(desc['vsysdescriptorId'][0])['vsysdescriptor'][0]
           components = conf['vservers'][0]['vserver'].collect do |vserver|
@@ -253,13 +254,15 @@ module Deltacloud::Drivers::Fgcp
                 :volume_config => CIMI::Model::VolumeConfiguration.new(:capacity =>
vdisk['size'][0].to_i * 1024 * 1024)
               )
             end if vserver['vdisks']
+            images = images(credentials) if not images
+            this_image = images.find {|img| img.id == vserver['diskimageId'][0] }
             {
               :name             => vserver['vserverName'][0],
-              :description      => '',
+              :description      => this_image ? this_image.description : '',
               :type             => "http://schemas.dmtf.org/cimi/1/Machine",
               :machine_template => CIMI::Model::MachineTemplate.new(
                 :name             => vserver['vserverName'][0],
-                :description      => '',
+                :description      => this_image ? this_image.description : '',
                 :machine_config   => CIMI::Service::MachineConfiguration.find(vserver['vserverType'][0],
context),
                 :machine_image    => { :href => context.machine_image_url(vserver['diskimageId'][0])
},
                 :volume_templates => volume_templates


Mime
View raw message