diff options
| author | Mark McClain <mark.mcclain@dreamhost.com> | 2012-10-22 18:15:24 -0400 |
|---|---|---|
| committer | Mark McClain <mark.mcclain@dreamhost.com> | 2012-10-22 18:25:29 -0400 |
| commit | 83a84182cd5dbd4571291f176f421d3fec572f5f (patch) | |
| tree | 6373812a7a9d949b937fe3282d8afed2aa8c7543 /nova/api | |
| parent | 16d653a3067332dc06f5138d2b842a79d65803a6 (diff) | |
add port support when QuantumV2 subclass is used
fixes bug 1070045
Fix the current implementation by checking if FLAGS.network_api_class is a
subclass of nova.network.quantumv2.api.API. Previously, the API would
not accept port references unless the network_api_class string was
anything other than the QuantumV2 class. This limitation prevented
subclassing.
This changeset includes additional API unit tests focused on QuantumV2
and requested networks.
Change-Id: I6b7b7389e127ff8b084ac379cb9aebccc102620c
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/openstack/compute/servers.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/nova/api/openstack/compute/servers.py b/nova/api/openstack/compute/servers.py index 89eac8bfd..c5e829d52 100644 --- a/nova/api/openstack/compute/servers.py +++ b/nova/api/openstack/compute/servers.py @@ -32,6 +32,8 @@ from nova import compute from nova.compute import instance_types from nova import exception from nova import flags +from nova.network.quantumv2 import api as quantum_api +from nova.openstack.common import importutils from nova.openstack.common import log as logging from nova.openstack.common.rpc import common as rpc_common from nova.openstack.common import timeutils @@ -597,8 +599,10 @@ class Controller(wsgi.Controller): return injected_files def _is_quantum_v2(self): - return FLAGS.network_api_class ==\ - "nova.network.quantumv2.api.API" + return issubclass( + importutils.import_class(FLAGS.network_api_class), + quantum_api.API + ) def _get_requested_networks(self, requested_networks): """Create a list of requested networks from the networks attribute.""" |
