Return-Path: X-Original-To: apmail-deltacloud-commits-archive@www.apache.org Delivered-To: apmail-deltacloud-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3080E10D2D for ; Mon, 15 Jul 2013 07:00:20 +0000 (UTC) Received: (qmail 70983 invoked by uid 500); 15 Jul 2013 07:00:17 -0000 Delivered-To: apmail-deltacloud-commits-archive@deltacloud.apache.org Received: (qmail 70955 invoked by uid 500); 15 Jul 2013 07:00:16 -0000 Mailing-List: contact commits-help@deltacloud.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@deltacloud.apache.org Delivered-To: mailing list commits@deltacloud.apache.org Received: (qmail 70900 invoked by uid 99); 15 Jul 2013 07:00:11 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Jul 2013 07:00:11 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 406DA89D2A4; Mon, 15 Jul 2013 07:00:11 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: dkoper@apache.org To: commits@deltacloud.apache.org Date: Mon, 15 Jul 2013 07:00:16 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [6/8] git commit: FGCP: add descriptions to machine templates in system template 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 Authored: Mon Jul 15 11:40:31 2013 +1000 Committer: Dies Koper 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