cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edi...@apache.org
Subject git commit: updated refs/heads/master to a39de00
Date Thu, 25 Jul 2013 22:13:17 GMT
Updated Branches:
  refs/heads/master b37901188 -> a39de009d


CLOUDSTACK-2536: fix the regression introduced by 4c81ea69c4e8326cc81a0e2607f6a6d99645ce5f


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

Branch: refs/heads/master
Commit: a39de009da8df5080c2273d77f92a9ae75bff8d6
Parents: b379011
Author: Edison Su <sudison@gmail.com>
Authored: Thu Jul 25 15:10:49 2013 -0700
Committer: Edison Su <sudison@gmail.com>
Committed: Thu Jul 25 15:13:00 2013 -0700

----------------------------------------------------------------------
 .../com/cloud/resource/ResourceManagerImpl.java    | 17 +++++------------
 1 file changed, 5 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a39de009/server/src/com/cloud/resource/ResourceManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/resource/ResourceManagerImpl.java b/server/src/com/cloud/resource/ResourceManagerImpl.java
index c018770..6a9a434 100755
--- a/server/src/com/cloud/resource/ResourceManagerImpl.java
+++ b/server/src/com/cloud/resource/ResourceManagerImpl.java
@@ -215,8 +215,6 @@ public class ResourceManagerImpl extends ManagerBase implements ResourceManager,
     PlannerHostReservationDao _plannerHostReserveDao;
     @Inject
     protected DedicatedResourceDao           _dedicatedDao;
-    @Inject
-    protected ConfigurationServer _configServer;
 
     protected List<? extends Discoverer> _discoverers;
 
@@ -462,7 +460,6 @@ public class ResourceManagerImpl extends ManagerBase implements ResourceManager,
 
         List<ClusterVO> result = new ArrayList<ClusterVO>();
 
-        long clusterId = 0;
         ClusterVO cluster = new ClusterVO(dcId, podId, clusterName);
         cluster.setHypervisorType(hypervisorType.toString());
 
@@ -479,14 +476,8 @@ public class ResourceManagerImpl extends ManagerBase implements ResourceManager,
             ex.addProxyObject(zone.getUuid(), "dcId");
             throw ex;
         }
-        clusterId = cluster.getId();
         result.add(cluster);
 
-        ClusterDetailsVO cluster_detail_cpu = new ClusterDetailsVO(clusterId, "cpuOvercommitRatio",
_configServer.getConfigValue(Config.CPUOverprovisioningFactor.key(), null, null));
-        ClusterDetailsVO cluster_detail_ram = new ClusterDetailsVO(clusterId, "memoryOvercommitRatio",
_configServer.getConfigValue(Config.MemOverprovisioningFactor.key(), null, null));
-        _clusterDetailsDao.persist(cluster_detail_cpu);
-        _clusterDetailsDao.persist(cluster_detail_ram);
-
         if (clusterType == Cluster.ClusterType.CloudManaged) {
             return result;
         }
@@ -496,6 +487,8 @@ public class ResourceManagerImpl extends ManagerBase implements ResourceManager,
         details.put("url", url);
         details.put("username", username);
         details.put("password", password);
+        details.put("cpuOvercommitRatio", _configDao.getValue(Config.CPUOverprovisioningFactor.key()));
+        details.put("memoryOvercommitRatio", _configDao.getValue(Config.MemOverprovisioningFactor.key()));
         _clusterDetailsDao.persist(cluster.getId(), details);
 
         boolean success = false;
@@ -515,7 +508,7 @@ public class ResourceManagerImpl extends ManagerBase implements ResourceManager,
 
             List<HostVO> hosts = new ArrayList<HostVO>();
             Map<? extends ServerResource, Map<String, String>> resources = null;
-            resources = discoverer.find(dcId, podId, clusterId, uri, username, password,
null);
+            resources = discoverer.find(dcId, podId, cluster.getId(), uri, username, password,
null);
 
             if (resources != null) {
                 for (Map.Entry<? extends ServerResource, Map<String, String>>
entry : resources.entrySet()) {
@@ -536,8 +529,8 @@ public class ResourceManagerImpl extends ManagerBase implements ResourceManager,
             throw new DiscoveryException("Unable to add the external cluster");
         } finally {
             if (!success) {
-                _clusterDetailsDao.deleteDetails(clusterId);
-                _clusterDao.remove(clusterId);
+                _clusterDetailsDao.deleteDetails(cluster.getId());
+                _clusterDao.remove(cluster.getId());
             }
         }
     }


Mime
View raw message