From ba95181dc4e4aab18c658cc092172b679e4e5c73 Mon Sep 17 00:00:00 2001 From: alena Date: Tue, 5 Jul 2011 13:35:29 -0700 Subject: [PATCH] Fixed deployVm with sshKeyPair via 8096 port - take account info from the vm's owner, not from the caller --- server/src/com/cloud/vm/UserVmManagerImpl.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/server/src/com/cloud/vm/UserVmManagerImpl.java b/server/src/com/cloud/vm/UserVmManagerImpl.java index 58113ab3327..0d99ec3a95c 100755 --- a/server/src/com/cloud/vm/UserVmManagerImpl.java +++ b/server/src/com/cloud/vm/UserVmManagerImpl.java @@ -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."); }