From 3971c4ee489fb3b059448eac173d76a87e202e66 Mon Sep 17 00:00:00 2001 From: Giampaolo Lauria Date: Tue, 12 Mar 2013 16:10:08 -0400 Subject: 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 --- nova/api/openstack/compute/contrib/os_networks.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'nova/api') 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") % -- cgit