Skip to content

Commit

Permalink
Merge "Deprecate local conductor mode"
Browse files Browse the repository at this point in the history
  • Loading branch information
Jenkins authored and openstack-gerrit committed Nov 7, 2015
2 parents 5483ee9 + a698871 commit 0da0971
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 6 deletions.
7 changes: 5 additions & 2 deletions nova/cmd/compute.py
Expand Up @@ -27,7 +27,7 @@
from nova import config
import nova.db.api
from nova import exception
from nova.i18n import _LE
from nova.i18n import _LE, _LW
from nova import objects
from nova.objects import base as objects_base
from nova import service
Expand All @@ -37,6 +37,7 @@
CONF = cfg.CONF
CONF.import_opt('compute_topic', 'nova.compute.rpcapi')
CONF.import_opt('use_local', 'nova.conductor.api', group='conductor')
LOG = logging.getLogger('nova.compute')


def block_db_access():
Expand All @@ -46,7 +47,6 @@ def __getattr__(self, attr):

def __call__(self, *args, **kwargs):
stacktrace = "".join(traceback.format_stack())
LOG = logging.getLogger('nova.compute')
LOG.error(_LE('No db access allowed in nova-compute: %s'),
stacktrace)
raise exception.DBNotAllowed('nova-compute')
Expand All @@ -66,6 +66,9 @@ def main():
block_db_access()
objects_base.NovaObject.indirection_api = \
conductor_rpcapi.ConductorAPI()
else:
LOG.warning(_LW('Conductor local mode is deprecated and will '
'be removed in a subsequent release'))

server = service.Service.create(binary='nova-compute',
topic=CONF.compute_topic,
Expand Down
5 changes: 4 additions & 1 deletion nova/cmd/dhcpbridge.py
Expand Up @@ -34,7 +34,7 @@
from nova import context
import nova.db.api
from nova import exception
from nova.i18n import _LE
from nova.i18n import _LE, _LW
from nova.network import rpcapi as network_rpcapi
from nova import objects
from nova.objects import base as objects_base
Expand Down Expand Up @@ -126,6 +126,9 @@ def main():
block_db_access()
objects_base.NovaObject.indirection_api = \
conductor_rpcapi.ConductorAPI()
else:
LOG.warning(_LW('Conductor local mode is deprecated and will '
'be removed in a subsequent release'))

if CONF.action.name in ['add', 'del', 'old']:
LOG.debug("Called '%(action)s' for mac '%(mac)s' with ip '%(ip)s'",
Expand Down
7 changes: 5 additions & 2 deletions nova/cmd/network.py
Expand Up @@ -27,7 +27,7 @@
from nova import config
import nova.db.api
from nova import exception
from nova.i18n import _LE
from nova.i18n import _LE, _LW
from nova import objects
from nova.objects import base as objects_base
from nova import service
Expand All @@ -37,6 +37,7 @@
CONF = cfg.CONF
CONF.import_opt('network_topic', 'nova.network.rpcapi')
CONF.import_opt('use_local', 'nova.conductor.api', group='conductor')
LOG = logging.getLogger('nova.network')


def block_db_access():
Expand All @@ -46,7 +47,6 @@ def __getattr__(self, attr):

def __call__(self, *args, **kwargs):
stacktrace = "".join(traceback.format_stack())
LOG = logging.getLogger('nova.network')
LOG.error(_LE('No db access allowed in nova-network: %s'),
stacktrace)
raise exception.DBNotAllowed('nova-network')
Expand All @@ -66,6 +66,9 @@ def main():
block_db_access()
objects_base.NovaObject.indirection_api = \
conductor_rpcapi.ConductorAPI()
else:
LOG.warning(_LW('Conductor local mode is deprecated and will '
'be removed in a subsequent release'))

server = service.Service.create(binary='nova-network',
topic=CONF.network_topic,
Expand Down
7 changes: 6 additions & 1 deletion nova/conductor/api.py
Expand Up @@ -28,7 +28,12 @@
conductor_opts = [
cfg.BoolOpt('use_local',
default=False,
help='Perform nova-conductor operations locally'),
help='DEPRECATED: Perform nova-conductor operations locally. '
'This legacy mode was introduced to bridge a gap during '
'the transition to the conductor service. It no longer '
'represents a reasonable alternative for deployers. '
'Removal may be as early as 14.0',
deprecated_for_removal=True),
cfg.StrOpt('topic',
default='conductor',
help='The topic on which conductor nodes listen'),
Expand Down

0 comments on commit 0da0971

Please sign in to comment.