From f88998b9886c860bc7b37e024346e24e3fd92b3e Mon Sep 17 00:00:00 2001 From: Alena Prokharchyk Date: Thu, 19 Apr 2012 10:37:08 -0700 Subject: [PATCH] Revert "bug CS-14530: Whwnever creating an agent for the host put in enabled and disabled according to the hierarchy." This reverts commit ec69814683847873984ad14ca0e8485b849be477. --- .../src/com/cloud/resource/ResourceManagerImpl.java | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/server/src/com/cloud/resource/ResourceManagerImpl.java b/server/src/com/cloud/resource/ResourceManagerImpl.java index 1d7eea349f2..3d662c3e413 100755 --- a/server/src/com/cloud/resource/ResourceManagerImpl.java +++ b/server/src/com/cloud/resource/ResourceManagerImpl.java @@ -43,7 +43,6 @@ import com.cloud.agent.manager.AgentAttache; import com.cloud.agent.manager.allocator.PodAllocator; import com.cloud.agent.transport.Request; import com.cloud.api.ApiConstants; -import com.cloud.api.ApiDBUtils; import com.cloud.api.commands.AddClusterCmd; import com.cloud.api.commands.AddHostCmd; import com.cloud.api.commands.AddSecondaryStorageCmd; @@ -61,7 +60,6 @@ import com.cloud.capacity.dao.CapacityDao; import com.cloud.cluster.ClusterManager; import com.cloud.cluster.ManagementServerNode; import com.cloud.configuration.Config; -import com.cloud.configuration.ConfigurationManager; import com.cloud.configuration.dao.ConfigurationDao; import com.cloud.dc.ClusterDetailsDao; import com.cloud.dc.ClusterVO; @@ -97,7 +95,6 @@ import com.cloud.network.dao.IPAddressDao; import com.cloud.org.Cluster; import com.cloud.org.Grouping; import com.cloud.org.Managed; -import com.cloud.org.Grouping.AllocationState; import com.cloud.service.ServiceOfferingVO; import com.cloud.storage.GuestOSCategoryVO; import com.cloud.storage.StorageManager; @@ -199,8 +196,6 @@ public class ResourceManagerImpl implements ResourceManager, ResourceService, Ma @Inject protected ClusterManager _clusterMgr; @Inject - ConfigurationManager _configMgr; - @Inject protected StoragePoolHostDao _storagePoolHostDao; @Inject(adapter = PodAllocator.class) protected Adapters _podAllocators = null; @@ -1043,11 +1038,7 @@ public class ResourceManagerImpl implements ResourceManager, ResourceService, Ma } // TO DO - Make it more granular and have better conversion into capacity type - AllocationState capacityState = _configMgr.findClusterAllocationState(ApiDBUtils.findClusterById(host.getClusterId())); - if (capacityState == AllocationState.Enabled && nextState != ResourceState.Enabled){ - capacityState = AllocationState.Disabled; - } - _capacityDao.updateCapacityState(null, null, null, host.getId(), capacityState.toString()); + _capacityDao.updateCapacityState(null, null, null, host.getId(), nextState.toString()); return _hostDao.updateResourceState(currentState, event, nextState, host); }