mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
CLOUDSTACK-8312: Fix NPE regression, copy template can have NULL volume size
The copy command reply can have null size returned, so check and set values Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com> (cherry picked from commit 53ca0b1861c743caf61ec04f776c87eac334f185) Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
parent
62a733e8cf
commit
694b723899
@ -190,7 +190,9 @@ public class TemplateObject implements TemplateInfo {
|
|||||||
TemplateObjectTO newTemplate = (TemplateObjectTO)cpyAnswer.getNewData();
|
TemplateObjectTO newTemplate = (TemplateObjectTO)cpyAnswer.getNewData();
|
||||||
VMTemplateStoragePoolVO templatePoolRef = templatePoolDao.findByPoolTemplate(getDataStore().getId(), getId());
|
VMTemplateStoragePoolVO templatePoolRef = templatePoolDao.findByPoolTemplate(getDataStore().getId(), getId());
|
||||||
templatePoolRef.setDownloadPercent(100);
|
templatePoolRef.setDownloadPercent(100);
|
||||||
templatePoolRef.setTemplateSize(newTemplate.getSize());
|
if (newTemplate.getSize() != null) {
|
||||||
|
templatePoolRef.setTemplateSize(newTemplate.getSize());
|
||||||
|
}
|
||||||
templatePoolRef.setDownloadState(Status.DOWNLOADED);
|
templatePoolRef.setDownloadState(Status.DOWNLOADED);
|
||||||
templatePoolRef.setLocalDownloadPath(newTemplate.getPath());
|
templatePoolRef.setLocalDownloadPath(newTemplate.getPath());
|
||||||
templatePoolRef.setInstallPath(newTemplate.getPath());
|
templatePoolRef.setInstallPath(newTemplate.getPath());
|
||||||
|
|||||||
@ -877,7 +877,9 @@ public class XenServerStorageProcessor implements StorageProcessor {
|
|||||||
|
|
||||||
newVol.setUuid(uuidToReturn);
|
newVol.setUuid(uuidToReturn);
|
||||||
newVol.setPath(uuidToReturn);
|
newVol.setPath(uuidToReturn);
|
||||||
newVol.setSize(physicalSize);
|
if (physicalSize != null) {
|
||||||
|
newVol.setSize(physicalSize);
|
||||||
|
}
|
||||||
newVol.setFormat(ImageFormat.VHD);
|
newVol.setFormat(ImageFormat.VHD);
|
||||||
|
|
||||||
return new CopyCmdAnswer(newVol);
|
return new CopyCmdAnswer(newVol);
|
||||||
|
|||||||
@ -292,7 +292,9 @@ public class Xenserver625StorageProcessor extends XenServerStorageProcessor {
|
|||||||
|
|
||||||
newVol.setUuid(uuidToReturn);
|
newVol.setUuid(uuidToReturn);
|
||||||
newVol.setPath(uuidToReturn);
|
newVol.setPath(uuidToReturn);
|
||||||
newVol.setSize(physicalSize);
|
if (physicalSize != null) {
|
||||||
|
newVol.setSize(physicalSize);
|
||||||
|
}
|
||||||
newVol.setFormat(Storage.ImageFormat.VHD);
|
newVol.setFormat(Storage.ImageFormat.VHD);
|
||||||
|
|
||||||
return new CopyCmdAnswer(newVol);
|
return new CopyCmdAnswer(newVol);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user