Merge "remove log translation tags from nova.cells"

This commit is contained in:
Jenkins 2017-04-21 15:24:58 +00:00 committed by Gerrit Code Review
commit ddc807f85a
8 changed files with 43 additions and 50 deletions

View File

@ -20,7 +20,7 @@ from oslo_cache import core as cache
from oslo_log import log as logging
import nova.conf
from nova.i18n import _, _LW
from nova.i18n import _
CONF = nova.conf.CONF
@ -31,7 +31,7 @@ WEEK = 604800
def _warn_if_null_backend():
if CONF.cache.backend == 'dogpile.cache.null':
LOG.warning(_LW("Cache enabled with backend dogpile.cache.null."))
LOG.warning("Cache enabled with backend dogpile.cache.null.")
def get_memcached_client(expiration_time=0):

View File

@ -24,7 +24,6 @@ done as there's no way to know whether the full path is a valid.
from oslo_log import log as logging
from nova.cells import filters
from nova.i18n import _LI
LOG = logging.getLogger(__name__)
@ -56,8 +55,8 @@ class TargetCellFilter(filters.BaseCellFilter):
# No filtering, if not authorized.
return cells
LOG.info(_LI("Forcing direct route to %(cell_name)s because "
"of 'target_cell' scheduler hint"),
LOG.info("Forcing direct route to %(cell_name)s because "
"of 'target_cell' scheduler hint",
{'cell_name': cell_name})
scheduler = filter_properties['scheduler']

View File

@ -33,7 +33,6 @@ from nova.cells import utils as cells_utils
import nova.conf
from nova import context
from nova import exception
from nova.i18n import _LW
from nova import manager
from nova import objects
from nova.objects import base as base_obj
@ -64,15 +63,15 @@ class CellsManager(manager.Manager):
target = oslo_messaging.Target(version='1.37')
def __init__(self, *args, **kwargs):
LOG.warning(_LW('The cells feature of Nova is considered experimental '
'by the OpenStack project because it receives much '
'less testing than the rest of Nova. This may change '
'in the future, but current deployers should be aware '
'that the use of it in production right now may be '
'risky. Also note that cells does not currently '
'support rolling upgrades, it is assumed that cells '
'deployments are upgraded lockstep so n-1 cells '
'compatibility does not work.'))
LOG.warning('The cells feature of Nova is considered experimental '
'by the OpenStack project because it receives much '
'less testing than the rest of Nova. This may change '
'in the future, but current deployers should be aware '
'that the use of it in production right now may be '
'risky. Also note that cells does not currently '
'support rolling upgrades, it is assumed that cells '
'deployments are upgraded lockstep so n-1 cells '
'compatibility does not work.')
# Mostly for tests.
cell_state_manager = kwargs.pop('cell_state_manager', None)
super(CellsManager, self).__init__(service_name='cells',
@ -578,9 +577,9 @@ class CellsManager(manager.Manager):
elif len(keypairs) > 1:
cell_names = ', '.join([resp.cell_name for resp in responses
if resp.value is not None])
LOG.warning(_LW("The same keypair name '%(name)s' exists in the "
"following cells: %(cell_names)s. The keypair "
"value from the first cell is returned."),
LOG.warning("The same keypair name '%(name)s' exists in the "
"following cells: %(cell_names)s. The keypair "
"value from the first cell is returned.",
{'name': name, 'cell_names': cell_names})
return keypairs[0]

View File

@ -52,7 +52,7 @@ from nova.consoleauth import rpcapi as consoleauth_rpcapi
from nova import context
from nova.db import base
from nova import exception
from nova.i18n import _, _LE, _LI, _LW
from nova.i18n import _
from nova import objects
from nova.objects import base as objects_base
from nova import rpc
@ -190,7 +190,7 @@ class _BaseMessage(object):
except Exception:
resp_value = sys.exc_info()
failure = True
LOG.exception(_LE("Error processing message locally"))
LOG.exception("Error processing message locally")
return Response(self.ctxt, self.routing_path, resp_value, failure)
def _setup_response_queue(self):
@ -399,7 +399,7 @@ class _TargetedMessage(_BaseMessage):
next_hop = self._get_next_hop()
except Exception:
exc_info = sys.exc_info()
LOG.exception(_LE("Error locating next hop for message"))
LOG.exception("Error locating next hop for message")
return self._send_response_from_exception(exc_info)
if next_hop.is_me:
@ -425,7 +425,7 @@ class _TargetedMessage(_BaseMessage):
next_hop.send_message(self)
except Exception:
exc_info = sys.exc_info()
err_str = _LE("Failed to send message to cell: %(next_hop)s")
err_str = "Failed to send message to cell: %(next_hop)s"
LOG.exception(err_str, {'next_hop': next_hop})
self._cleanup_response_queue()
return self._send_response_from_exception(exc_info)
@ -503,7 +503,7 @@ class _BroadcastMessage(_BaseMessage):
next_hops = self._get_next_hops()
except Exception:
exc_info = sys.exc_info()
LOG.exception(_LE("Error locating next hops for message"))
LOG.exception("Error locating next hops for message")
return self._send_response_from_exception(exc_info)
# Short circuit if we don't need to respond
@ -522,7 +522,7 @@ class _BroadcastMessage(_BaseMessage):
# Error just trying to send to cells. Send a single response
# with the failure.
exc_info = sys.exc_info()
LOG.exception(_LE("Error sending message to next hops."))
LOG.exception("Error sending message to next hops.")
self._cleanup_response_queue()
return self._send_response_from_exception(exc_info)
@ -539,8 +539,7 @@ class _BroadcastMessage(_BaseMessage):
# Error waiting for responses, most likely a timeout.
# Send a single response back with the failure.
exc_info = sys.exc_info()
LOG.exception(_LE("Error waiting for responses from"
" neighbor cells"))
LOG.exception("Error waiting for responses from neighbor cells")
return self._send_response_from_exception(exc_info)
if local_response:
@ -1098,8 +1097,8 @@ class _BroadcastMessageMethods(_BaseMessageMethods):
**kwargs):
projid_str = project_id is None and "<all>" or project_id
since_str = updated_since is None and "<all>" or updated_since
LOG.info(_LI("Forcing a sync of instances, project_id="
"%(projid_str)s, updated_since=%(since_str)s"),
LOG.info("Forcing a sync of instances, project_id="
"%(projid_str)s, updated_since=%(since_str)s",
{'projid_str': projid_str, 'since_str': since_str})
if updated_since is not None:
updated_since = timeutils.parse_isotime(updated_since)
@ -1178,7 +1177,7 @@ class _BroadcastMessageMethods(_BaseMessageMethods):
if vol_id and instance_bdm['volume_id'] == vol_id:
break
else:
LOG.warning(_LW("No match when trying to update BDM: %(bdm)s"),
LOG.warning("No match when trying to update BDM: %(bdm)s",
dict(bdm=bdm))
return
LOG.debug('Calling db.block_device_mapping_update from API cell with '
@ -1672,7 +1671,7 @@ class MessageRunner(object):
"""Call instance_<method> in correct cell for instance."""
cell_name = instance.cell_name
if not cell_name:
LOG.warning(_LW("No cell_name for %(method)s() from API"),
LOG.warning("No cell_name for %(method)s() from API",
dict(method=method), instance=instance)
return
method_kwargs = {'instance': instance}
@ -1689,7 +1688,7 @@ class MessageRunner(object):
"""Update an instance object in its cell."""
cell_name = instance.cell_name
if not cell_name:
LOG.warning(_LW("No cell_name for instance update from API"),
LOG.warning("No cell_name for instance update from API",
instance=instance)
return
method_kwargs = {'instance': instance,
@ -1877,7 +1876,7 @@ def serialize_remote_exception(failure_info, log_failure=True):
tb = traceback.format_exception(*failure_info)
failure = failure_info[1]
if log_failure:
LOG.error(_LE("Returning exception %s to caller"),
LOG.error("Returning exception %s to caller",
six.text_type(failure))
LOG.error(tb)

View File

@ -29,7 +29,6 @@ from oslo_serialization import jsonutils
import nova.conf
from nova import exception
from nova.i18n import _LE
from nova import objects
from nova.objects import base as objects_base
from nova import profiler
@ -419,7 +418,7 @@ class CellsAPI(object):
cctxt.cast(ctxt, 'bdm_update_or_create_at_top',
bdm=bdm, create=create)
except Exception:
LOG.exception(_LE("Failed to notify cells of BDM update/create."))
LOG.exception("Failed to notify cells of BDM update/create.")
def bdm_destroy_at_top(self, ctxt, instance_uuid, device_name=None,
volume_id=None):
@ -433,7 +432,7 @@ class CellsAPI(object):
device_name=device_name,
volume_id=volume_id)
except Exception:
LOG.exception(_LE("Failed to notify cells of BDM destroy."))
LOG.exception("Failed to notify cells of BDM destroy.")
def get_migrations(self, ctxt, filters):
"""Get all migrations applying the filters."""

View File

@ -31,7 +31,6 @@ from nova import conductor
import nova.conf
from nova.db import base
from nova import exception
from nova.i18n import _LE, _LI
from nova import objects
from nova.objects import base as obj_base
from nova.scheduler import utils as scheduler_utils
@ -187,11 +186,11 @@ class CellsScheduler(base.Base):
build_inst_kwargs)
return
except Exception:
LOG.exception(_LE("Couldn't communicate with cell '%s'"),
LOG.exception("Couldn't communicate with cell '%s'",
target_cell.name)
# FIXME(comstud): Would be nice to kick this back up so that
# the parent cell could retry, if we had a parent.
LOG.error(_LE("Couldn't communicate with any cells"))
LOG.error("Couldn't communicate with any cells")
raise exception.NoCellsAvailable()
def build_instances(self, message, build_inst_kwargs):
@ -228,13 +227,13 @@ class CellsScheduler(base.Base):
if i == max(0, CONF.cells.scheduler_retries):
raise
sleep_time = max(1, CONF.cells.scheduler_retry_delay)
LOG.info(_LI("No cells available when scheduling. Will "
"retry in %(sleep_time)s second(s)"),
LOG.info("No cells available when scheduling. Will "
"retry in %(sleep_time)s second(s)",
{'sleep_time': sleep_time})
time.sleep(sleep_time)
continue
except Exception:
LOG.exception(_LE("Error scheduling instances %(instance_uuids)s"),
LOG.exception("Error scheduling instances %(instance_uuids)s",
{'instance_uuids': instance_uuids})
ctxt = message.ctxt
for instance_uuid in instance_uuids:

View File

@ -35,7 +35,6 @@ import nova.conf
from nova import context
from nova.db import base
from nova import exception
from nova.i18n import _LE
from nova import objects
from nova import rpc
from nova import servicegroup
@ -165,7 +164,7 @@ class CellStateManager(base.Base):
attempts += 1
if attempts > 120:
raise
LOG.exception(_LE('DB error'))
LOG.exception('DB error')
time.sleep(30)
my_cell_capabs = {}
@ -363,8 +362,8 @@ class CellStateManager(base.Base):
cell = (self.child_cells.get(cell_name) or
self.parent_cells.get(cell_name))
if not cell:
LOG.error(_LE("Unknown cell '%(cell_name)s' when trying to "
"update capabilities"),
LOG.error("Unknown cell '%(cell_name)s' when trying to "
"update capabilities",
{'cell_name': cell_name})
return
# Make sure capabilities are sets.
@ -378,8 +377,8 @@ class CellStateManager(base.Base):
cell = (self.child_cells.get(cell_name) or
self.parent_cells.get(cell_name))
if not cell:
LOG.error(_LE("Unknown cell '%(cell_name)s' when trying to "
"update capacities"),
LOG.error("Unknown cell '%(cell_name)s' when trying to "
"update capacities",
{'cell_name': cell_name})
return
cell.update_capacities(capacities)

View File

@ -23,7 +23,6 @@ from oslo_utils import timeutils
from nova.cells import weights
import nova.conf
from nova.i18n import _LW
LOG = logging.getLogger(__name__)
@ -52,8 +51,8 @@ class MuteChildWeigher(weights.BaseCellWeigher):
if timeutils.is_older_than(last_seen, secs):
# yep, that's a mute child; recommend highly that it be skipped!
LOG.warning(_LW("%(cell)s has not been seen since %(last_seen)s "
"and is being treated as mute."),
LOG.warning("%(cell)s has not been seen since %(last_seen)s "
"and is being treated as mute.",
{'cell': cell, 'last_seen': last_seen})
return self.MUTE_WEIGH_VALUE
else: