Fixed deployVm with sshKeyPair via 8096 port - take account info from the vm's owner, not from the caller

This commit is contained in:
alena 2011-07-05 13:35:29 -07:00
parent c31605d51f
commit ba95181dc4
1 changed files with 1 additions and 2 deletions

View File

@ -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.");
}