summaryrefslogtreecommitdiffstats
path: root/nova/openstack
diff options
context:
space:
mode:
authorMark McLoughlin <markmc@redhat.com>2012-12-05 23:13:37 +0000
committerMark McLoughlin <markmc@redhat.com>2012-12-05 23:13:37 +0000
commit1dc6c806b32044420bf17d3076dd712185b7ac07 (patch)
tree9eea9c6755ea2fee73616fd21eebcdd6e088d01b /nova/openstack
parent2a33f8d8cefdbde50f89e6d4084d513eadf3a97a (diff)
downloadnova-1dc6c806b32044420bf17d3076dd712185b7ac07.tar.gz
nova-1dc6c806b32044420bf17d3076dd712185b7ac07.tar.xz
nova-1dc6c806b32044420bf17d3076dd712185b7ac07.zip
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 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. Change-Id: I2d4fc51a4b16d5230e61bde75915142ea450557d
Diffstat (limited to 'nova/openstack')
-rw-r--r--nova/openstack/common/rpc/__init__.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/nova/openstack/common/rpc/__init__.py b/nova/openstack/common/rpc/__init__.py
index bf2b2e9e0..a223e8fde 100644
--- a/nova/openstack/common/rpc/__init__.py
+++ b/nova/openstack/common/rpc/__init__.py
@@ -50,6 +50,7 @@ rpc_opts = [
default=['nova.openstack.common.exception',
'nova.exception',
'cinder.exception',
+ 'exceptions',
],
help='Modules of exceptions that are permitted to be recreated'
'upon receiving exception data from an rpc call.'),