diff --git a/senlin/drivers/openstack/lbaas.py b/senlin/drivers/openstack/lbaas.py index bc023de16..b1b711179 100644 --- a/senlin/drivers/openstack/lbaas.py +++ b/senlin/drivers/openstack/lbaas.py @@ -267,8 +267,8 @@ class LoadBalancerDriver(base.DriverBase): node_detail = node.get_details(oslo_context.get_current()) addresses = node_detail.get('addresses') if net_name not in addresses: - LOG.error(_LE('Node is not in subnet %(subnet)s'), - {'subnet': subnet}) + msg = _LE('Node is not in subnet %(subnet)s') + LOG.error(msg, {'subnet': subnet}) return None # Use the first IP address if more than one are found in target network diff --git a/senlin/engine/actions/cluster_action.py b/senlin/engine/actions/cluster_action.py index 25b6ef38c..dc1cd30d8 100644 --- a/senlin/engine/actions/cluster_action.py +++ b/senlin/engine/actions/cluster_action.py @@ -714,9 +714,9 @@ class ClusterAction(base.Action): # desired is checked when strict is True curr_size = len(self.cluster.nodes) if count > curr_size: - LOG.warning(_('Triming count (%(count)s) to current cluster size ' - '(%(curr)s) for scaling in'), - {'count': count, 'curr': curr_size}) + msg = _("Triming count (%(count)s) to current " + "cluster size (%(curr)s) for scaling in") + LOG.warning(msg, {'count': count, 'curr': curr_size}) count = curr_size new_size = curr_size - count diff --git a/senlin/engine/event.py b/senlin/engine/event.py index 0933c534a..1c73ff495 100644 --- a/senlin/engine/event.py +++ b/senlin/engine/event.py @@ -126,7 +126,8 @@ def error(context, entity, action, status=None, status_reason=None, action=action, status=status, status_reason=status_reason, user=context.user, project=context.project) event.store(context) - LOG.error(_LE('%(name)s [%(id)s] %(action)s - %(status)s: %(reason)s'), + msg = _LE('%(name)s [%(id)s] %(action)s - %(status)s: %(reason)s') + LOG.error(msg, {'name': event.oname, 'id': event.oid and event.oid[:8], 'action': action, @@ -141,7 +142,8 @@ def warning(context, entity, action, status=None, status_reason=None, action=action, status=status, status_reason=status_reason, user=context.user, project=context.project) event.store(context) - LOG.warning(_LW('%(name)s [%(id)s] %(action)s - %(status)s: %(reason)s'), + msg = _LW('%(name)s [%(id)s] %(action)s - %(status)s: %(reason)s') + LOG.warning(msg, {'name': event.oname, 'id': event.oid and event.oid[:8], 'action': action, diff --git a/senlin/engine/registry.py b/senlin/engine/registry.py index 15ef0566a..b2ee3b290 100644 --- a/senlin/engine/registry.py +++ b/senlin/engine/registry.py @@ -81,7 +81,8 @@ class Registry(object): registry = self._registry if info is None: # delete this entry. - LOG.warning(_LW('Removing %(item)s from registry'), {'item': name}) + msg = _LW("Removing %(item)s from registry") + LOG.warning(msg, {'item': name}) registry.pop(name, None) return @@ -96,8 +97,8 @@ class Registry(object): LOG.warning(_LW('Changing %(name)s from %(old)s to %(new)s'), details) else: - LOG.info(_LI('Registering %(name)s -> %(value)s'), { - 'name': name, 'value': str(info.plugin)}) + msg = _LI('Registering %(name)s -> %(value)s') + LOG.info(msg, {'name': name, 'value': str(info.plugin)}) info.user_provided = not self.is_global registry[name] = info