mirror of https://github.com/apache/cloudstack.git
Fixed deployVm with sshKeyPair via 8096 port - take account info from the vm's owner, not from the caller
This commit is contained in:
parent
c31605d51f
commit
ba95181dc4
|
|
@ -2432,8 +2432,7 @@ public class UserVmManagerImpl implements UserVmManager, UserVmService, Manager
|
|||
// Find an SSH public key corresponding to the key pair name, if one is given
|
||||
String sshPublicKey = null;
|
||||
if (sshKeyPair != null && !sshKeyPair.equals("")) {
|
||||
Account account = UserContext.current().getCaller();
|
||||
SSHKeyPair pair = _sshKeyPairDao.findByName(account.getAccountId(), account.getDomainId(), sshKeyPair);
|
||||
SSHKeyPair pair = _sshKeyPairDao.findByName(owner.getAccountId(), owner.getDomainId(), sshKeyPair);
|
||||
if (pair == null) {
|
||||
throw new InvalidParameterValueException("A key pair with name '" + sshKeyPair + "' was not found.");
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue