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
This commit is contained in:
Nitin Mehta 2012-08-21 13:39:05 +05:30
parent 20ccb6c1cb
commit 7aa7d6e39f
2 changed files with 2 additions and 2 deletions

View File

@ -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();

View File

@ -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(),