cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From weiz...@apache.org
Subject git commit: updated refs/heads/master to 1a67750
Date Thu, 29 Aug 2013 10:45:50 GMT
Updated Branches:
  refs/heads/master 53ee2c905 -> 1a67750cb


CLOUDSTACK-4538: set default value of cpu.overprovisioning.factor and mem.overprovisioning.factor
to 1

On a fresh environment, some values in cloud.configuration table are persisted in com.cloud.server.ConfigurationServerImpl.persistDefaultValues()
A default value need to be set before com.cloud.upgrade.DatabaseUpgradeChecker


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

Branch: refs/heads/master
Commit: 1a67750cb66cf74175e2776ba3f3ba76fde0d1bb
Parents: 53ee2c9
Author: Wei Zhou <w.zhou@leaseweb.com>
Authored: Thu Aug 29 12:41:18 2013 +0200
Committer: Wei Zhou <w.zhou@leaseweb.com>
Committed: Thu Aug 29 12:41:18 2013 +0200

----------------------------------------------------------------------
 .../schema/src/com/cloud/upgrade/dao/Upgrade410to420.java | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1a67750c/engine/schema/src/com/cloud/upgrade/dao/Upgrade410to420.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade410to420.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade410to420.java
index d578e0e..e50e792 100755
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade410to420.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade410to420.java
@@ -650,12 +650,14 @@ public class Upgrade410to420 implements DbUpgrade {
             pstmt3=conn.prepareStatement("select value from `cloud`.`configuration` where
name=?");
             pstmt3.setString(1,"cpu.overprovisioning.factor");
             rscpu_global = pstmt3.executeQuery();
-            rscpu_global.next();
-            String global_cpu_overprovisioning_factor=rscpu_global.getString(1);
+            String global_cpu_overprovisioning_factor = "1";
+            if (rscpu_global.next())
+                global_cpu_overprovisioning_factor = rscpu_global.getString(1);
             pstmt3.setString(1,"mem.overprovisioning.factor");
             rsmem_global = pstmt3.executeQuery();
-            rsmem_global.next();
-            String global_mem_overprovisioning_factor = rsmem_global.getString(1);
+            String global_mem_overprovisioning_factor = "1";
+            if (rsmem_global.next())
+                global_mem_overprovisioning_factor = rsmem_global.getString(1);
             rs1 = pstmt.executeQuery();
 
             while (rs1.next()) {


Mime
View raw message