Only import Cheetah when needed, as we do already with libvirt and libxml2. This ensures that users of other virt backends don't need Cheetah to run nova-compute.
Resubmitted with pep8 violations fixed.
Change the argument parsing in run_tests.sh so that we explicitly gather
the arguments that aren't meant for run_tests.sh, and pass them on to
nosetests.
merge notes:
merge with trunk went well locally
unittests passed locally
testing of suspend succeeded locally
Notes for testing:
Suspending an instance requires PV drivers.
If using the cloudservers API, suspend and resume are not implemented. I tested by modifying in place nova.api.openstack.servers after pulling my branch. I made pause() and unpause() immediately return self.suspend() and self.resume(). Afterwards cloudserver pause (id) and cloudserver unpause (id) will perform the suspend/resume, and you can watch the compute worker log for info on what is happening.
SAMPLE LOG OUTPUT FOR PAUSE/UNPAUSE +++++++++++++++++++++
DEBUG:root:instance 1178831109: pausing
INFO:root:Task OpaqueRef:ba3b1595-0d70-574a-aaca-27442d04be87 status: success.
INFO:root:(VM_UTILS) xenserver vm state -> |Paused|
INFO:root:(VM_UTILS) xenapi power_state -> |3|
DEBUG:root:instance 1178831109: unpausing
INFO:root:Task OpaqueRef:2d9cb792-0ce5-be23-6c50-3dc52cf1535c status: success.
INFO:root:(VM_UTILS) xenserver vm state -> |Running|
INFO:root:(VM_UTILS) xenapi power_state -> |1|
SAMPLE LOG OUTPUT FOR SUSPEND/RESUME +++++++++++++++++++++
DEBUG:root:instance 1178831109: suspending
INFO:root:Task OpaqueRef:bc5d51da-922f-c9fb-f07c-aaa027fde601 status: success.
INFO:root:(VM_UTILS) xenserver vm state -> |Suspended|
INFO:root:(VM_UTILS) xenapi power_state -> |7|
DEBUG:root:instance 1178831109: resuming
INFO:root:Task OpaqueRef:4e5a3af8-baed-c144-30ea-63637390f6c8 status: success.
INFO:root:(VM_UTILS) xenserver vm state -> |Running|
INFO:root:(VM_UTILS) xenapi power_state -> |1|
Only import Cheetah when needed, as we do already with libvirt and libxml2.
This ensures that users of other virt backends don't need Cheetah to run
nova-compute.
Change the argument parsing in run_tests.sh so that we explicitly gather
the arguments that aren't meant for run_tests.sh, and pass them on to
nosetests.