Skip to content

Commit

Permalink
make default transport type configurable nvp
Browse files Browse the repository at this point in the history
Fixes bug 1179759

Change-Id: I8f644f2bc0d5d144f52e5ed0bd2e991503581ad2
  • Loading branch information
aaronorosen committed May 14, 2013
1 parent 2a0e7f2 commit 531f8d8
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
3 changes: 3 additions & 0 deletions etc/quantum/plugins/nicira/nvp.ini
Expand Up @@ -113,3 +113,6 @@ sql_connection = sqlite://
# This option is only useful if running on a host that does not support
# namespaces otherwise access_network should be used.
# metadata_mode = access_network

# The default network transport type to use (stt, gre, bridge, ipsec_gre, or ipsec_stt)
# default_transport_type = stt
3 changes: 3 additions & 0 deletions quantum/plugins/nicira/common/config.py
Expand Up @@ -41,6 +41,9 @@
cfg.BoolOpt('enable_metadata_access_network', default=True,
help=_("Enables dedicated connection to the metadata proxy "
"for metadata server access via Quantum router")),
cfg.StrOpt('default_transport_type', default='stt',
help=_("The default network tranport type to use (stt, gre, "
"bridge, ipsec_gre, or ipsec_stt)")),
]

connection_opts = [
Expand Down
13 changes: 7 additions & 6 deletions quantum/plugins/nicira/nvplib.py
Expand Up @@ -26,6 +26,8 @@
import json
import logging

from oslo.config import cfg

#FIXME(danwent): I'd like this file to get to the point where it has
# no quantum-specific logic in it
from quantum.common import constants
Expand All @@ -40,8 +42,6 @@
HTTP_POST = "POST"
HTTP_DELETE = "DELETE"
HTTP_PUT = "PUT"
# Default transport type for logical switches
DEF_TRANSPORT_TYPE = "stt"
# Prefix to be used for all NVP API calls
URI_PREFIX = "/ws.v1"
# Resources exposed by NVP API
Expand Down Expand Up @@ -296,10 +296,11 @@ def create_lswitch(cluster, tenant_id, display_name,
nvp_binding_type = transport_type
if transport_type in ('flat', 'vlan'):
nvp_binding_type = 'bridge'
transport_zone_config = {"zone_uuid": (transport_zone_uuid or
cluster.default_tz_uuid),
"transport_type": (nvp_binding_type or
DEF_TRANSPORT_TYPE)}
transport_zone_config = (
{"zone_uuid": (transport_zone_uuid or
cluster.default_tz_uuid),
"transport_type": (nvp_binding_type or
cfg.CONF.NVP.default_transport_type)})
lswitch_obj = {"display_name": _check_and_truncate_name(display_name),
"transport_zones": [transport_zone_config],
"tags": [{"tag": tenant_id, "scope": "os_tid"},
Expand Down
1 change: 1 addition & 0 deletions quantum/tests/unit/nicira/test_nvpopts.py
Expand Up @@ -120,6 +120,7 @@ def test_defaults(self):
self.assertEqual(64, cfg.CONF.NVP.max_lp_per_bridged_ls)
self.assertEqual(256, cfg.CONF.NVP.max_lp_per_overlay_ls)
self.assertEqual(5, cfg.CONF.NVP.concurrent_connections)
self.assertEqual('stt', cfg.CONF.NVP.default_transport_type)

self.assertIsNone(cfg.CONF.default_tz_uuid)
self.assertIsNone(cfg.CONF.nvp_cluster_uuid)
Expand Down

0 comments on commit 531f8d8

Please sign in to comment.