incubator-deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@apache.org
Subject svn commit: r1171037 - /incubator/deltacloud/trunk/server/lib/deltacloud/drivers/vsphere/vsphere_driver.rb
Date Thu, 15 Sep 2011 10:37:21 GMT
Author: mfojtik
Date: Thu Sep 15 10:37:20 2011
New Revision: 1171037

URL: http://svn.apache.org/viewvc?rev=1171037&view=rev
Log:
VSphere: Report the minimum of available memory for all datacenter instead of doing a sum
in hardware_profile

Modified:
    incubator/deltacloud/trunk/server/lib/deltacloud/drivers/vsphere/vsphere_driver.rb

Modified: incubator/deltacloud/trunk/server/lib/deltacloud/drivers/vsphere/vsphere_driver.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/lib/deltacloud/drivers/vsphere/vsphere_driver.rb?rev=1171037&r1=1171036&r2=1171037&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/lib/deltacloud/drivers/vsphere/vsphere_driver.rb (original)
+++ incubator/deltacloud/trunk/server/lib/deltacloud/drivers/vsphere/vsphere_driver.rb Thu
Sep 15 10:37:20 2011
@@ -41,14 +41,14 @@ module Deltacloud::Drivers::VSphere
       vsphere = new_client(credentials)
       safely do
         service = vsphere.serviceInstance.content
-        max_memory, max_cpu_cores = 0, 0
+        max_memory, max_cpu_cores = [], []
         service.rootFolder.childEntity.grep(RbVmomi::VIM::Datacenter).each do |dc|
-          max_memory += dc.hostFolder.childEntity.first.summary.effectiveMemory
-          max_cpu_cores += dc.hostFolder.childEntity.first.summary.numCpuCores
+          max_memory << dc.hostFolder.childEntity.first.summary.effectiveMemory
+          max_cpu_cores << dc.hostFolder.childEntity.first.summary.numCpuCores
         end
         [Deltacloud::HardwareProfile::new('default') do
-          cpu (1..max_cpu_cores)
-          memory (128..max_memory)
+          cpu (1..max_cpu_cores.min)
+          memory (128..max_memory.min)
           architecture ['x86_64', 'i386']
         end]
       end



Mime
View raw message