From 7be0400365ef391d46d8b4181c05be5fef5b9639 Mon Sep 17 00:00:00 2001 From: Gary Kotton Date: Sun, 18 Oct 2015 05:19:25 -0700 Subject: [PATCH] Move 'locking_coordinator_url' to common configuration section The variable will now be in the 'DEFAULT' section. This is due to the fact that it is used by the NSX|V and NSX|V3 plugins. DocImpact Change-Id: I3238eafcf2fde0cb4fa6cd48099908980c28d39f --- etc/nsx.ini | 12 ++++++------ vmware_nsx/common/config.py | 7 ++++--- vmware_nsx/common/locking.py | 4 ++-- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/etc/nsx.ini b/etc/nsx.ini index 8914f6749f..a037d6e75f 100644 --- a/etc/nsx.ini +++ b/etc/nsx.ini @@ -48,6 +48,12 @@ # This field will be used when a L2 Gateway service plugin is configured. # nsx_l2gw_driver = +# (Optional) URL for distributed locking coordination resource for lock manager +# This value is passed as a parameter to tooz coordinator. +# By default, value is None and oslo_concurrency is used for single-node +# lock management. +# locking_coordinator_url = + [quotas] # number of network gateways allowed per tenant, -1 means unlimited # quota_network_gateway = 5 @@ -171,12 +177,6 @@ # (Optional) Password to configure for Edge appliance login # edge_appliance_password = -# (Optional) URL for distributed locking coordination resource for lock manager -# This value is passed as a parameter to tooz coordinator. -# By default, value is None and oslo_concurrency is used for single-node -# lock management. -# locking_coordinator_url = - # (Optional) DHCP lease time # dhcp_lease_time = 86400 diff --git a/vmware_nsx/common/config.py b/vmware_nsx/common/config.py index 0d10b1993f..67911a6f0e 100644 --- a/vmware_nsx/common/config.py +++ b/vmware_nsx/common/config.py @@ -160,7 +160,10 @@ cluster_opts = [ nsx_common_opts = [ cfg.StrOpt('nsx_l2gw_driver', - help=_("Class path for the L2 gateway backend driver")) + help=_("Class path for the L2 gateway backend driver")), + cfg.StrOpt('locking_coordinator_url', + deprecated_group='nsxv', + help=_('A URL to a locking mechanism coordinator')), ] nsx_v3_opts = [ @@ -322,8 +325,6 @@ nsxv_opts = [ cfg.IntOpt('dhcp_lease_time', default=86400, help=_('DHCP default lease time.')), - cfg.StrOpt('locking_coordinator_url', - help=_('A URL to a locking mechanism coordinator')), cfg.BoolOpt('metadata_initializer', default=True, help=_("If True, the server instance will attempt to " diff --git a/vmware_nsx/common/locking.py b/vmware_nsx/common/locking.py index 6b73431478..c6a63711c8 100644 --- a/vmware_nsx/common/locking.py +++ b/vmware_nsx/common/locking.py @@ -26,14 +26,14 @@ LOG = log.getLogger(__name__) class LockManager: _coordinator = None _coordinator_pid = None - _connect_string = cfg.CONF.nsxv.locking_coordinator_url + _connect_string = cfg.CONF.locking_coordinator_url def __init__(self): LOG.debug('LockManager initialized!') @staticmethod def get_lock(name, **kwargs): - if cfg.CONF.nsxv.locking_coordinator_url: + if cfg.CONF.locking_coordinator_url: return LockManager._get_lock_distributed(name) else: # Ensure that external=True