mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-6869: SSH Public key content is overridden by template's meta data when you create a instance
This commit is contained in:
parent
31d870933d
commit
522208dec2
|
|
@ -1656,6 +1656,7 @@ public class TemplateManagerImpl extends ManagerBase implements TemplateManager,
|
|||
}
|
||||
}
|
||||
if (cmd.getDetails() != null) {
|
||||
details.remove("Encrypted.Password"); // new password will be generated during vm deployment from password enabled template
|
||||
details.putAll(cmd.getDetails());
|
||||
}
|
||||
if (!details.isEmpty()) {
|
||||
|
|
|
|||
|
|
@ -2909,6 +2909,12 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir
|
|||
.getLimitCpuUse(), owner.getDomainId(), owner.getId(), offering.getId(), userData, hostName, diskOfferingId);
|
||||
vm.setUuid(uuidName);
|
||||
vm.setDynamicallyScalable(template.isDynamicallyScalable());
|
||||
|
||||
Map<String, String> details = template.getDetails();
|
||||
if (details != null && !details.isEmpty()) {
|
||||
vm.details.putAll(details);
|
||||
}
|
||||
|
||||
if (sshPublicKey != null) {
|
||||
vm.setDetail("SSH.PublicKey", sshPublicKey);
|
||||
}
|
||||
|
|
@ -2982,11 +2988,6 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir
|
|||
}
|
||||
}
|
||||
|
||||
Map<String, String> details = template.getDetails();
|
||||
if (details != null && !details.isEmpty()) {
|
||||
vm.details.putAll(details);
|
||||
}
|
||||
|
||||
_vmDao.persist(vm);
|
||||
if (customParameters != null && customParameters.size() > 0) {
|
||||
for (String key : customParameters.keySet()) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue