CLOUDSTACK-4628:[Automation] Failed to create template from snapshot

with same name; after deleting the first one.
This commit is contained in:
Min Chen 2013-09-09 16:07:46 -07:00
parent 771b8377fd
commit 16a1f150eb

View File

@ -432,7 +432,9 @@ public class
int _createprivatetemplatefromsnapshotwait = NumbersUtil.parseInt(value,
Integer.parseInt(Config.CreatePrivateTemplateFromSnapshotWait.getDefaultValue()));
boolean needCache = false;
if (needCacheStorage(srcData, destData)) {
needCache = true;
SnapshotInfo snapshot = (SnapshotInfo) srcData;
srcData = cacheSnapshotChain(snapshot);
}
@ -442,7 +444,7 @@ public class
Answer answer = ep.sendMessage(cmd);
// clean up snapshot copied to staging
if (srcData != null) {
if (needCache && srcData != null) {
cacheMgr.deleteCacheObject(srcData);
}
return answer;