Merge "Translate info-level log messages for LOG.info"
This commit is contained in:
commit
03250b0a82
|
@ -18,7 +18,7 @@ import six
|
||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
from bilean.common.i18n import _
|
from bilean.common.i18n import _
|
||||||
|
from bilean.common.i18n import _LI
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
from oslo_utils import timeutils
|
from oslo_utils import timeutils
|
||||||
|
@ -80,7 +80,7 @@ def setup_resources():
|
||||||
" Using default config."))
|
" Using default config."))
|
||||||
resources_config = []
|
resources_config = []
|
||||||
|
|
||||||
LOG.info(_("Resource Definitions: %s"), resources_config)
|
LOG.info(_LI("Resource Definitions: %s"), resources_config)
|
||||||
|
|
||||||
allow_drop = cfg.CONF.resource_definition.drop_unmatched_notifications
|
allow_drop = cfg.CONF.resource_definition.drop_unmatched_notifications
|
||||||
return NotificationResourcesConverter(resources_config,
|
return NotificationResourcesConverter(resources_config,
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
from bilean.common import context
|
from bilean.common import context
|
||||||
from bilean.common.i18n import _
|
from bilean.common.i18n import _
|
||||||
from bilean.common.i18n import _LE
|
from bilean.common.i18n import _LE
|
||||||
|
from bilean.common.i18n import _LI
|
||||||
from bilean.notification import action as notify_action
|
from bilean.notification import action as notify_action
|
||||||
from bilean.notification import converter
|
from bilean.notification import converter
|
||||||
|
|
||||||
|
@ -59,7 +60,7 @@ class EventsNotificationEndpoint(object):
|
||||||
action = self._get_action(notification['event_type'])
|
action = self._get_action(notification['event_type'])
|
||||||
if action:
|
if action:
|
||||||
act = notify_action.UserAction(self.cnxt, action, user_id)
|
act = notify_action.UserAction(self.cnxt, action, user_id)
|
||||||
LOG.info(_("Notify engine to %(action)s user: %(user)s") %
|
LOG.info(_LI("Notify engine to %(action)s user: %(user)s") %
|
||||||
{'action': action, 'user': user_id})
|
{'action': action, 'user': user_id})
|
||||||
act.execute()
|
act.execute()
|
||||||
|
|
||||||
|
@ -78,9 +79,9 @@ class EventsNotificationEndpoint(object):
|
||||||
for resource in resources:
|
for resource in resources:
|
||||||
act = notify_action.ResourceAction(
|
act = notify_action.ResourceAction(
|
||||||
self.cnxt, action, resource)
|
self.cnxt, action, resource)
|
||||||
LOG.info(_("Notify engine to %(action)s resource: "
|
LOG.info(_LI("Notify engine to %(action)s resource: "
|
||||||
"%(resource)s") % {'action': action,
|
"%(resource)s") % {'action': action,
|
||||||
'resource': resource})
|
'resource': resource})
|
||||||
act.execute()
|
act.execute()
|
||||||
|
|
||||||
return oslo_messaging.NotificationResult.HANDLED
|
return oslo_messaging.NotificationResult.HANDLED
|
||||||
|
@ -90,5 +91,5 @@ class EventsNotificationEndpoint(object):
|
||||||
for action in available_actions:
|
for action in available_actions:
|
||||||
if action in event_type:
|
if action in event_type:
|
||||||
return action
|
return action
|
||||||
LOG.info(_("Can not get action info in event_type: %s") % event_type)
|
LOG.info(_LI("Can not get action info in event_type: %s") % event_type)
|
||||||
return None
|
return None
|
||||||
|
|
Loading…
Reference in New Issue