You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ni...@apache.org on 2012/08/21 10:17:24 UTC

git commit: CS-16089: Create Template after upgrade from snapshot taken in 2.2.14 was failing since the swift_id was not null but 0 instead. Put a check in the code to check for not null and not 0 swift_id to go and download the snapshot from the swift.

Updated Branches:
  refs/heads/master 20ccb6c1c -> 7aa7d6e39


CS-16089: Create Template after upgrade from snapshot taken in 2.2.14 was failing since the swift_id was not null but 0 instead. Put a check in the code to check for not null and not 0 swift_id to go and download the snapshot from the swift.
Reviewed-by: Kishan


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

Branch: refs/heads/master
Commit: 7aa7d6e39fdfbc36cd614d5ad887b7c1051ad71f
Parents: 20ccb6c
Author: Nitin Mehta <ni...@citrix.com>
Authored: Tue Aug 21 13:39:05 2012 +0530
Committer: Nitin Mehta <ni...@citrix.com>
Committed: Tue Aug 21 13:46:18 2012 +0530

----------------------------------------------------------------------
 .../storage/snapshot/SnapshotManagerImpl.java      |    2 +-
 server/src/com/cloud/vm/UserVmManagerImpl.java     |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7aa7d6e3/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java b/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java
index 2f0c640..8ae8ddc 100755
--- a/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java
+++ b/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java
@@ -842,7 +842,7 @@ public class SnapshotManagerImpl implements SnapshotManager, SnapshotService, Ma
     @Override
     public HostVO getSecondaryStorageHost(SnapshotVO snapshot) {
         HostVO secHost = null;
-        if( snapshot.getSwiftId() == null ) {
+        if( snapshot.getSwiftId() == null || snapshot.getSwiftId() == 0) {
             secHost = _hostDao.findById(snapshot.getSecHostId());
         } else {
             Long dcId = snapshot.getDataCenterId();

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7aa7d6e3/server/src/com/cloud/vm/UserVmManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/vm/UserVmManagerImpl.java b/server/src/com/cloud/vm/UserVmManagerImpl.java
index b7c1c0e..051791f 100755
--- a/server/src/com/cloud/vm/UserVmManagerImpl.java
+++ b/server/src/com/cloud/vm/UserVmManagerImpl.java
@@ -1523,7 +1523,7 @@ public class UserVmManagerImpl implements UserVmManager, UserVmService, Manager
                         }
                     }
                 }
-                if( snapshot.getSwiftId() != null ) {
+                if( snapshot.getSwiftId() != null && snapshot.getSwiftId() != 0 ) {
                     _snapshotMgr.downloadSnapshotsFromSwift(snapshot);
                 }
                 cmd = new CreatePrivateTemplateFromSnapshotCommand(pool.getUuid(), secondaryStorageURL, dcId, accountId, snapshot.getVolumeId(), backupSnapshotUUID, snapshot.getName(),