You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltacloud.apache.org by mf...@apache.org on 2011/04/26 10:58:36 UTC

svn commit: r1096699 - /incubator/deltacloud/trunk/server/lib/deltacloud/drivers/rhevm/rhevm_driver.rb

Author: mfojtik
Date: Tue Apr 26 08:58:36 2011
New Revision: 1096699

URL: http://svn.apache.org/viewvc?rev=1096699&view=rev
Log:
Tomas Von Veschler: Fixed wrong calculation of instance properties for RHEV-M driver

Modified:
    incubator/deltacloud/trunk/server/lib/deltacloud/drivers/rhevm/rhevm_driver.rb

Modified: incubator/deltacloud/trunk/server/lib/deltacloud/drivers/rhevm/rhevm_driver.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/lib/deltacloud/drivers/rhevm/rhevm_driver.rb?rev=1096699&r1=1096698&r2=1096699&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/lib/deltacloud/drivers/rhevm/rhevm_driver.rb (original)
+++ incubator/deltacloud/trunk/server/lib/deltacloud/drivers/rhevm/rhevm_driver.rb Tue Apr 26 08:58:36 2011
@@ -199,7 +199,7 @@ class RHEVMDriver < Deltacloud::BaseDriv
 
   def convert_instance(client, inst)
     state = convert_state(inst.status)
-    storage_size = inst.storage.nil? ? 1 :  (inst.storage.to_i/1048576/100)
+    storage_size = inst.storage.nil? ? 1 :  (inst.storage.to_i/1024/1024/1024)
     profile = InstanceProfile::new(inst.profile.upcase, 
                                    :hwp_memory => inst.memory.to_i/1024/1024,
                                    :hwp_cpu => inst.cores,
@@ -249,7 +249,7 @@ class RHEVMDriver < Deltacloud::BaseDriv
     StorageVolume.new(
       :id => volume.id,
       :state => 'AVAILABLE',
-      :capacity => ((volume.available.to_i-volume.used.to_i)/1024/1024).abs,
+      :capacity => ((volume.available.to_i-volume.used.to_i)/1024/1024/1024).abs,
       :instance_id => nil,
       :kind => volume.kind,
       :name => volume.name,