summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorGiampaolo Lauria <lauria@us.ibm.com>2013-03-12 16:10:08 -0400
committerGiampaolo Lauria <lauria@us.ibm.com>2013-03-14 16:24:47 -0400
commit3971c4ee489fb3b059448eac173d76a87e202e66 (patch)
tree7d6dbfce1670d5189736d01dd72b8c7c3a7267eb /nova/api
parent46683d34db0045a45f8d16e2c255282f289c8901 (diff)
Fix exception message in Networks API extension
Raise exception indicating VLAN is disabled when trying to associate a network w/ a tenant in cases where VLAN is not the network manager Added unit test case Fixes bug 1075790 Change-Id: I3dcac09fbf06d9f64b18cc52d0b069dc9c0a7370
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/compute/contrib/os_networks.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/nova/api/openstack/compute/contrib/os_networks.py b/nova/api/openstack/compute/contrib/os_networks.py
index c6268f277..2cea0e081 100644
--- a/nova/api/openstack/compute/contrib/os_networks.py
+++ b/nova/api/openstack/compute/contrib/os_networks.py
@@ -139,6 +139,9 @@ class NetworkController(wsgi.Controller):
try:
self.network_api.add_network_to_project(
context, project_id, network_id)
+ except NotImplementedError:
+ msg = (_("VLAN support must be enabled"))
+ raise exc.HTTPNotImplemented(explanation=msg)
except Exception as ex:
msg = (_("Cannot associate network %(network)s"
" with project %(project)s: %(message)s") %