Host actions like enable/disable, maintenance mode and power management
are not implemented in most virt drivers.
In the case of set_host_enabled() in the libvirt driver, we have a no-op
implementation. In other cases we have an implementation which raises
NotImplementedError. Since the default implementation is to do this, we
should just remove the redundant methods from the drivers which don't
actually implement these actions. This ensures NotImplementedError is
consistently raised.
On the API side, rather than looking at the return value of these
methods to determine whether they're implemented, we should just catch
NotImplementedError and return a sensible error message.
In order to do this, we need to ensure the NotImplementedError is
properly deserialized from the RemoteError which will encapsualte
it. The fix for bug #1086798 ensures this happens.
Finally, add some tests to make sure we properly respond with 501
when the virt driver doesn't implement these actions.
Reviewed: https:/ /review. openstack. org/17565 github. com/openstack/ nova/commit/ 1dc6c806b320444 20bf17d3076dd71 2185b7ac07
Committed: http://
Submitter: Jenkins
Branch: master
commit 1dc6c806b320444 20bf17d3076dd71 2185b7ac07
Author: Mark McLoughlin <email address hidden>
Date: Wed Dec 5 23:13:37 2012 +0000
Fix handling of unimplemented host actions
Fixes bug #1060884
Host actions like enable/disable, maintenance mode and power management
are not implemented in most virt drivers.
In the case of set_host_enabled() in the libvirt driver, we have a no-op tedError. Since the default implementation is to do this, we
implementation. In other cases we have an implementation which raises
NotImplemen
should just remove the redundant methods from the drivers which don't
actually implement these actions. This ensures NotImplementedError is
consistently raised.
On the API side, rather than looking at the return value of these tedError and return a sensible error message.
methods to determine whether they're implemented, we should just catch
NotImplemen
In order to do this, we need to ensure the NotImplementedError is
properly deserialized from the RemoteError which will encapsualte
it. The fix for bug #1086798 ensures this happens.
Finally, add some tests to make sure we properly respond with 501
when the virt driver doesn't implement these actions.
Change-Id: I2d4fc51a4b16d5 230e61bde759151 42ea450557d