Do not save an SSH public key unless one is provided.

This commit is contained in:
Ragnar B. Johannsson 2011-01-13 00:48:48 +00:00
parent 381717854c
commit 81bb2a43d1

View File

@ -2316,7 +2316,8 @@ public class UserVmManagerImpl implements UserVmManager, UserVmService, Manager
UserVmVO vm = new UserVmVO(id, instanceName, cmd.getDisplayName(), template.getId(), hypervisorType,
template.getGuestOSId(), offering.getOfferHA(), domainId, owner.getId(), offering.getId(), userData, hostName);
vm.setDetail("SSH.PublicKey", sshPublicKey);
if (sshPublicKey != null)
vm.setDetail("SSH.PublicKey", sshPublicKey);
if (_itMgr.allocate(vm, template, offering, rootDiskOffering, dataDiskOfferings, networks, null, plan, cmd.getHypervisor(), owner) == null) {
return null;