mirror of https://github.com/apache/cloudstack.git
bug 12282: Fixed NPE in register template API. The ssh key enabled attribute didnt have any default value and was throwing NPE. Also changed some minor code to stick to the conventions.
Reviewed by : Kishan.
This commit is contained in:
parent
489a1d5738
commit
3f5fbb8fe4
|
|
@ -153,7 +153,7 @@ public class VMTemplateVO implements VirtualMachineTemplate, Identity {
|
|||
this.uuid = UUID.randomUUID().toString();
|
||||
}
|
||||
|
||||
public VMTemplateVO(long id, String name, ImageFormat format, boolean isPublic, boolean featured, boolean isExtractable, TemplateType type, String url, boolean requiresHvm, int bits, long accountId, String cksum, String displayText, boolean enablePassword, long guestOSId, boolean bootable, HypervisorType hyperType, String templateTag, Map details, Boolean sshKeyEnabled) {
|
||||
public VMTemplateVO(long id, String name, ImageFormat format, boolean isPublic, boolean featured, boolean isExtractable, TemplateType type, String url, boolean requiresHvm, int bits, long accountId, String cksum, String displayText, boolean enablePassword, long guestOSId, boolean bootable, HypervisorType hyperType, String templateTag, Map details, boolean sshKeyEnabled) {
|
||||
this(id, name, format, isPublic, featured, isExtractable, type, url, requiresHvm, bits, accountId, cksum, displayText, enablePassword, guestOSId, bootable, hyperType, details);
|
||||
this.templateTag = templateTag;
|
||||
this.uuid = UUID.randomUUID().toString();
|
||||
|
|
|
|||
|
|
@ -137,6 +137,9 @@ public abstract class TemplateAdapterBase implements TemplateAdapter {
|
|||
if (isExtractable == null) {
|
||||
isExtractable = Boolean.FALSE;
|
||||
}
|
||||
if (sshkeyEnabled == null) {
|
||||
sshkeyEnabled = Boolean.FALSE;
|
||||
}
|
||||
|
||||
boolean isAdmin = _accountDao.findById(templateOwner.getId()).getType() == Account.ACCOUNT_TYPE_ADMIN;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue