Closed justinc1 closed 1 year ago
Unit test problems with TestManageVMDisks - I didn't check why I have problems with TestManageVMNics, but not with TestManageVMDisks. At first look, those two tests are not that much different.
One more note, there is problem in VM.str() implementation. It will push branch problem-with-power-state-mapping, to show this. It seems to me that we store in VM.power_state both VM power_state as retrieved from HyperCore, and sometimes also power_state as set in ansible module. But ansible power_state is actually a command describing transition to HyperCore power_state, not HyperCore power_state (e.g. you can get into SHUTOFF state by nice shutdown or by force shutdown - two different actions, same end state).
I noticed this only because I added debug module.warn. Module was not misbehaving.
It would be a bit of extra work and testing, so I just added a small workaround to not throw this error to module users.
Integration test is added to show that renaming VM a second time (idempotence test) does fail in current main. Problem is (in most places) we search for VM by
vm_name
only, but we should byvm_name
xorvm_name_new
. A helper functionVM.get_by_old_or_new_name
does this, and is used in VM module.PR was draft:
vm_name_new
paramVM.get_by_name
- I'm not sure, need to check all affected modules.But there is enough code for first review and comments