cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h...@apache.org
Subject [22/44] git commit: updated refs/heads/vpc-toolkit-hugo to 1ad1883
Date Mon, 14 Jul 2014 13:37:26 GMT
Some minor fixes in simulator code


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

Branch: refs/heads/vpc-toolkit-hugo
Commit: e85d1f911c4f5b0f4eea32cbec7f42d9f01d630f
Parents: f275eb1
Author: Koushik Das <koushik@apache.org>
Authored: Wed Jul 9 12:27:47 2014 +0530
Committer: Koushik Das <koushik@apache.org>
Committed: Wed Jul 9 13:20:28 2014 +0530

----------------------------------------------------------------------
 .../src/com/cloud/agent/manager/MockStorageManagerImpl.java    | 6 +++---
 .../simulator/src/com/cloud/resource/SimulatorDiscoverer.java  | 5 -----
 .../src/com/cloud/resource/SimulatorSecondaryDiscoverer.java   | 3 ---
 3 files changed, 3 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e85d1f91/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockStorageManagerImpl.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockStorageManagerImpl.java
b/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockStorageManagerImpl.java
index 8e1aaed..89b7950 100644
--- a/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockStorageManagerImpl.java
+++ b/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockStorageManagerImpl.java
@@ -289,11 +289,11 @@ public class MockStorageManagerImpl extends ManagerBase implements MockStorageMa
             vm = _mockVMDao.findByVmName(vmName);
             txn.commit();
             if (vm == null) {
-                return new Answer(cmd, false, "can't vm :" + vmName);
+                return new Answer(cmd, false, "can't find vm :" + vmName);
             }
         } catch (Exception ex) {
             txn.rollback();
-            throw new CloudRuntimeException("Error when attaching iso to vm " + vm.getName(),
ex);
+            throw new CloudRuntimeException("Error when attaching iso to vm " + vmName, ex);
         } finally {
             txn.close();
             txn = TransactionLegacy.open(TransactionLegacy.CLOUD_DB);
@@ -514,8 +514,8 @@ public class MockStorageManagerImpl extends ManagerBase implements MockStorageMa
 
             if (cmd.getVmName() != null) {
                 MockVm vm = _mockVMDao.findByVmName(cmd.getVmName());
-                vm.setState(State.Expunging);
                 if (vm != null) {
+                    vm.setState(State.Expunging);
                     MockVMVO vmVo = _mockVMDao.createForUpdate(vm.getId());
                     _mockVMDao.update(vm.getId(), vmVo);
                 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e85d1f91/plugins/hypervisors/simulator/src/com/cloud/resource/SimulatorDiscoverer.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/simulator/src/com/cloud/resource/SimulatorDiscoverer.java
b/plugins/hypervisors/simulator/src/com/cloud/resource/SimulatorDiscoverer.java
index d1ebfb5..7c31a9a 100644
--- a/plugins/hypervisors/simulator/src/com/cloud/resource/SimulatorDiscoverer.java
+++ b/plugins/hypervisors/simulator/src/com/cloud/resource/SimulatorDiscoverer.java
@@ -41,7 +41,6 @@ import com.cloud.agent.api.StartupRoutingCommand;
 import com.cloud.agent.manager.MockAgentManager;
 import com.cloud.agent.manager.MockStorageManager;
 import com.cloud.dc.ClusterVO;
-import com.cloud.dc.dao.ClusterDao;
 import com.cloud.exception.ConnectionException;
 import com.cloud.exception.DiscoveryException;
 import com.cloud.host.Host;
@@ -65,15 +64,11 @@ public class SimulatorDiscoverer extends DiscovererBase implements Discoverer,
L
     @Inject
     VMTemplateZoneDao _vmTemplateZoneDao;
     @Inject
-    ClusterDao _clusterDao;
-    @Inject
     AgentManager _agentMgr = null;
     @Inject
     MockAgentManager _mockAgentMgr = null;
     @Inject
     MockStorageManager _mockStorageMgr = null;
-    @Inject
-    ResourceManager _resourceMgr;
 
     /**
      * Finds ServerResources of an in-process simulator

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e85d1f91/plugins/hypervisors/simulator/src/com/cloud/resource/SimulatorSecondaryDiscoverer.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/simulator/src/com/cloud/resource/SimulatorSecondaryDiscoverer.java
b/plugins/hypervisors/simulator/src/com/cloud/resource/SimulatorSecondaryDiscoverer.java
index 715e9f3..11bf346 100644
--- a/plugins/hypervisors/simulator/src/com/cloud/resource/SimulatorSecondaryDiscoverer.java
+++ b/plugins/hypervisors/simulator/src/com/cloud/resource/SimulatorSecondaryDiscoverer.java
@@ -31,7 +31,6 @@ import org.apache.cloudstack.storage.resource.SecondaryStorageDiscoverer;
 import org.apache.cloudstack.storage.resource.SecondaryStorageResource;
 import org.apache.log4j.Logger;
 
-import com.cloud.agent.AgentManager;
 import com.cloud.agent.Listener;
 import com.cloud.agent.api.AgentControlAnswer;
 import com.cloud.agent.api.AgentControlCommand;
@@ -52,8 +51,6 @@ public class SimulatorSecondaryDiscoverer extends SecondaryStorageDiscoverer
imp
     @Inject
     MockStorageManager _mockStorageMgr = null;
     @Inject
-    AgentManager _agentMgr;
-    @Inject
     SnapshotDao _snapshotDao;
     @Inject
     ImageStoreDao imageStoreDao;


Mime
View raw message