cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mc...@apache.org
Subject git commit: updated refs/heads/4.2 to e3d3a8c
Date Tue, 20 Aug 2013 21:57:10 GMT
Updated Branches:
  refs/heads/4.2 a6d765141 -> e3d3a8cb7


CLOUDSTACK-4412: NPE while trying to force delete zone wide primary
storage when volumes are present.


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

Branch: refs/heads/4.2
Commit: e3d3a8cb7e4abba0fe08d18038065aaaf25e3d58
Parents: a6d7651
Author: Min Chen <min.chen@citrix.com>
Authored: Tue Aug 20 14:56:13 2013 -0700
Committer: Min Chen <min.chen@citrix.com>
Committed: Tue Aug 20 14:56:36 2013 -0700

----------------------------------------------------------------------
 .../CloudStackPrimaryDataStoreDriverImpl.java   | 31 ++++++++++++++++----
 1 file changed, 25 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e3d3a8cb/plugins/storage/volume/default/src/org/apache/cloudstack/storage/datastore/driver/CloudStackPrimaryDataStoreDriverImpl.java
----------------------------------------------------------------------
diff --git a/plugins/storage/volume/default/src/org/apache/cloudstack/storage/datastore/driver/CloudStackPrimaryDataStoreDriverImpl.java
b/plugins/storage/volume/default/src/org/apache/cloudstack/storage/datastore/driver/CloudStackPrimaryDataStoreDriverImpl.java
index 1e04a76..47cd1a8 100644
--- a/plugins/storage/volume/default/src/org/apache/cloudstack/storage/datastore/driver/CloudStackPrimaryDataStoreDriverImpl.java
+++ b/plugins/storage/volume/default/src/org/apache/cloudstack/storage/datastore/driver/CloudStackPrimaryDataStoreDriverImpl.java
@@ -36,7 +36,6 @@ import com.cloud.storage.dao.SnapshotDao;
 import com.cloud.storage.dao.VMTemplateDao;
 import com.cloud.storage.dao.VolumeDao;
 import com.cloud.storage.snapshot.SnapshotManager;
-import com.cloud.utils.db.DB;
 import com.cloud.vm.dao.VMInstanceDao;
 import org.apache.cloudstack.engine.subsystem.api.storage.*;
 import org.apache.cloudstack.framework.async.AsyncCompletionCallback;
@@ -91,7 +90,14 @@ public class CloudStackPrimaryDataStoreDriverImpl implements PrimaryDataStoreDri
 
         CreateObjectCommand cmd = new CreateObjectCommand(volume.getTO());
         EndPoint ep = epSelector.select(volume);
-        Answer answer = ep.sendMessage(cmd);
+        Answer answer = null;
+        if ( ep == null ){
+            String errMsg = "No remote endpoint to send DeleteCommand, check if host or ssvm
is down?";
+            s_logger.error(errMsg);
+            answer = new Answer(cmd, false, errMsg);
+        } else{
+            answer = ep.sendMessage(cmd);
+        }
         return answer;
     }
 
@@ -138,9 +144,15 @@ public class CloudStackPrimaryDataStoreDriverImpl implements PrimaryDataStoreDri
         CommandResult result = new CommandResult();
         try {
             EndPoint ep = epSelector.select(data);
-            Answer answer = ep.sendMessage(cmd);
-            if (answer != null && !answer.getResult()) {
-                result.setResult(answer.getDetails());
+            if ( ep == null ){
+                String errMsg = "No remote endpoint to send DeleteCommand, check if host
or ssvm is down?";
+                s_logger.error(errMsg);
+                result.setResult(errMsg);
+            } else {
+                Answer answer = ep.sendMessage(cmd);
+                if (answer != null && !answer.getResult()) {
+                    result.setResult(answer.getDetails());
+                }
             }
         } catch (Exception ex) {
             s_logger.debug("Unable to destoy volume" + data.getId(), ex);
@@ -166,7 +178,14 @@ public class CloudStackPrimaryDataStoreDriverImpl implements PrimaryDataStoreDri
 
             CreateObjectCommand cmd = new CreateObjectCommand(snapshotTO);
             EndPoint ep = this.epSelector.select(snapshot);
-            Answer answer = ep.sendMessage(cmd);
+            Answer answer = null;
+            if ( ep == null ){
+                String errMsg = "No remote endpoint to send DeleteCommand, check if host
or ssvm is down?";
+                s_logger.error(errMsg);
+                answer = new Answer(cmd, false, errMsg);
+            } else{
+                answer = ep.sendMessage(cmd);
+            }
 
             result = new CreateCmdResult(null, answer);
             if (answer != null && !answer.getResult()) {


Mime
View raw message