server: fix reset sshkey is broken in master/4.16#5390
server: fix reset sshkey is broken in master/4.16#5390nvazquez merged 5 commits intoapache:mainapache/cloudstack:mainfrom shapeblue:4.16-fix-reset-sshkeyshapeblue/cloudstack:4.16-fix-reset-sshkeyCopy head branch name to clipboard
Conversation
|
@nvazquez @GutoVeronezi @rhtyd |
|
@blueorangutan package |
|
@weizhouapache a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔️ el7 ✔️ el8 ✔️ debian ✔️ suse15. SL-JID 1063 |
nvazquez
left a comment
There was a problem hiding this comment.
Thanks @weizhouapache just a minor comment
| throw new CloudRuntimeException("Failed to reset SSH Key for the virtual machine "); | ||
| } | ||
|
|
||
| _vmDao.loadDetails(userVm); |
There was a problem hiding this comment.
I would prefer moving this line into the removeEncryptedPasswordFromUserVmVoDetails method if the VM details are empty
There was a problem hiding this comment.
@nvazquez done.
details are loaded but not updated, therefore it does not contain the new ssh key.
This reverts commit db278cf.
|
@blueorangutan package |
|
@weizhouapache a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔️ el7 ✔️ el8 ✔️ debian ✔️ suse15. SL-JID 1072 |
|
@blueorangutan test |
|
@rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
|
||
| final boolean canHandle = canHandle(network.getTrafficType()); | ||
|
|
||
| if (canHandle) { |
There was a problem hiding this comment.
since password is not reset when reset sshkey (in #4819 ), it is not needed to save password in vm details.
|
@blueorangutan package |
|
@weizhouapache a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔️ el7 ✔️ el8 ✔️ debian ✔️ suse15. SL-JID 1079 |
|
@blueorangutan test |
|
@nvazquez a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
Trillian test result (tid-1872)
|
|
@weizhouapache a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔️ el7 ✔️ el8 ✔️ debian ✔️ suse15. SL-JID 1108 |
|
@blueorangutan test |
|
@weizhouapache a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
Trillian Build Failed (tid-1938) |
|
@blueorangutan test |
|
@nvazquez a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
Trillian test result (tid-1940)
|
|
Trillian test result (tid-1942)
|
|
Trillian test result (tid-1939)
|
|
@blueorangutan package |
|
@weizhouapache a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔️ el7 ✔️ el8 ✔️ debian ✔️ suse15. SL-JID 1125 |
|
@blueorangutan test |
|
@weizhouapache a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
Trillian test result (tid-1960)
|
|
Ping @rhtyd @davidjumani @sureshanaparti @shwstppr can you please review? |
| } | ||
|
|
||
| protected void removeEncryptedPasswordFromUserVmVoDetails(UserVmVO userVmVo) { | ||
| _vmDao.loadDetails(userVmVo); |
There was a problem hiding this comment.
@weizhouapache I'm not sure but instead of loading all details, removing one detail and then storing all details, can we do:
userVmDetailsDao.removeDetail(userVmVo.getId(), VmDetailConstants.ENCRYPTED_PASSWORD);
_vmDao.loadDetails(userVmVo);
Also in the caller of this method we load details (ln 859), not sure if that is needed
There was a problem hiding this comment.
@shwstppr
user vm details is updated in line 883 (ssh key is added), but userVmVo does not contain it.
boolean result = resetVMSSHKeyInternal(vmId, sshPublicKey);
therefore we need to reload the details.
it is good idea to use userVmDetailsDao.removeDetail. I will change the code and test it. thanks.
There was a problem hiding this comment.
@weizhouapache yes, VM details are updated by resetVMSSHKeyInternal and that is why I feel loadDetails at 859 can be removed as I don't see it being used anywhere.
|
@blueorangutan package |
|
@weizhouapache a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔️ el7 ✔️ el8 ✔️ debian ✔️ suse15. SL-JID 1147 |
|
@blueorangutan test |
|
@weizhouapache a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
Trillian test result (tid-1979)
|
|
Trillian test result (tid-1978)
|
Description
This PR fixes the issue that reset sshkey is broken in master/4.16 branch.
It is a regression issue of #4819
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?