You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by de...@apache.org on 2014/11/14 07:11:32 UTC

[1/2] git commit: updated refs/heads/master to cfe5a6f

Repository: cloudstack
Updated Branches:
  refs/heads/master e92f42946 -> cfe5a6fcb


CLOUDSTACK-6924. To attach a volume if a volume needs to be moved to another storage
pool, the source and destination pools cannot be local and cluster/zone and vice versa.
Cloudstack detects it and throws a exception. However, the end user only sees an
unexpected exception and not the reason for failure. Fixed it by making sure the
reason for the failure is correctly captured and shown to the end user.


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

Branch: refs/heads/master
Commit: cffae8eef0b1f9bf869a5ec99befbe9ae9d9290d
Parents: e92f429
Author: Devdeep Singh <de...@gmail.com>
Authored: Fri Nov 14 11:11:49 2014 +0530
Committer: Devdeep Singh <de...@gmail.com>
Committed: Fri Nov 14 11:19:19 2014 +0530

----------------------------------------------------------------------
 engine/orchestration/src/com/cloud/vm/VmWorkJobDispatcher.java | 4 ++++
 server/src/com/cloud/storage/VolumeApiServiceImpl.java         | 4 +++-
 2 files changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cffae8ee/engine/orchestration/src/com/cloud/vm/VmWorkJobDispatcher.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/com/cloud/vm/VmWorkJobDispatcher.java b/engine/orchestration/src/com/cloud/vm/VmWorkJobDispatcher.java
index f302002..2ce76ea 100644
--- a/engine/orchestration/src/com/cloud/vm/VmWorkJobDispatcher.java
+++ b/engine/orchestration/src/com/cloud/vm/VmWorkJobDispatcher.java
@@ -28,6 +28,7 @@ import org.apache.cloudstack.framework.jobs.AsyncJobDispatcher;
 import org.apache.cloudstack.framework.jobs.AsyncJobManager;
 import org.apache.cloudstack.jobs.JobInfo;
 
+import com.cloud.exception.InvalidParameterValueException;
 import com.cloud.utils.Pair;
 import com.cloud.utils.component.AdapterBase;
 import com.cloud.vm.dao.VMInstanceDao;
@@ -108,6 +109,9 @@ public class VmWorkJobDispatcher extends AdapterBase implements AsyncJobDispatch
                 if (s_logger.isDebugEnabled())
                     s_logger.debug("Done with run of VM work job: " + cmd + " for VM " + work.getVmId() + ", job origin: " + job.getRelated());
             }
+        } catch(InvalidParameterValueException e) {
+            s_logger.error("Unable to complete " + job + ", job origin:" + job.getRelated());
+            _asyncJobMgr.completeAsyncJob(job.getId(), JobInfo.Status.FAILED, 0, _asyncJobMgr.marshallResultObject(e));
         } catch(Throwable e) {
             s_logger.error("Unable to complete " + job + ", job origin:" + job.getRelated(), e);
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cffae8ee/server/src/com/cloud/storage/VolumeApiServiceImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/VolumeApiServiceImpl.java b/server/src/com/cloud/storage/VolumeApiServiceImpl.java
index 17902c2..a6c6ca7 100644
--- a/server/src/com/cloud/storage/VolumeApiServiceImpl.java
+++ b/server/src/com/cloud/storage/VolumeApiServiceImpl.java
@@ -1365,6 +1365,8 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic
             if (jobResult != null) {
                 if (jobResult instanceof ConcurrentOperationException)
                     throw (ConcurrentOperationException)jobResult;
+                else if (jobResult instanceof InvalidParameterValueException)
+                    throw (InvalidParameterValueException)jobResult;
                 else if (jobResult instanceof Throwable)
                     throw new RuntimeException("Unexpected exception", (Throwable)jobResult);
                 else if (jobResult instanceof Long) {
@@ -2141,7 +2143,7 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic
                     return false;
                 }
             }
-            throw new CloudRuntimeException("Can't move volume between scope: " + storeForNewStoreScope.getScopeType() + " and " + storeForExistingStoreScope.getScopeType());
+            throw new InvalidParameterValueException("Can't move volume between scope: " + storeForNewStoreScope.getScopeType() + " and " + storeForExistingStoreScope.getScopeType());
         }
 
         return !storeForExistingStoreScope.isSameScope(storeForNewStoreScope);


[2/2] git commit: updated refs/heads/master to cfe5a6f

Posted by de...@apache.org.
While adding secondary storage / is not added to secondary storage cifs url.
This causes it to fail if that path doesn't begin with '/'. It works fine
while adding primary storage. Added a check to add '/' in begining if needed.


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

Branch: refs/heads/master
Commit: cfe5a6fcbf909a60947d491fb19b3fb9c5408116
Parents: cffae8e
Author: Devdeep Singh <de...@gmail.com>
Authored: Fri Nov 14 11:12:19 2014 +0530
Committer: Devdeep Singh <de...@gmail.com>
Committed: Fri Nov 14 11:20:25 2014 +0530

----------------------------------------------------------------------
 ui/scripts/sharedFunctions.js | 10 ++++++++++
 1 file changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cfe5a6fc/ui/scripts/sharedFunctions.js
----------------------------------------------------------------------
diff --git a/ui/scripts/sharedFunctions.js b/ui/scripts/sharedFunctions.js
index 95500a1..b148ded 100644
--- a/ui/scripts/sharedFunctions.js
+++ b/ui/scripts/sharedFunctions.js
@@ -1359,6 +1359,11 @@ var processPropertiesInImagestoreObject = function(jsonObj) {
 
     function nfsURL(server, path) {
         var url;
+
+        if (path.substring(0, 1) != "/") {
+            path = "/" + path;
+        }
+
         if (server.indexOf("://") == -1)
             url = "nfs://" + server + path;
         else
@@ -1368,6 +1373,11 @@ var processPropertiesInImagestoreObject = function(jsonObj) {
 
     function smbURL(server, path, smbUsername, smbPassword, smbDomain) {
         var url = '';
+
+        if (path.substring(0, 1) != "/") {
+            path = "/" + path;
+        }
+
         if (server.indexOf('://') == -1) {
         	url += 'cifs://';
         }