Further removal of localization to please py35

Change-Id: I5dad40e54b89c881984fa0c30f4748faabc4e4bd
This commit is contained in:
tengqm 2018-02-07 09:57:07 -05:00
parent b9161e5f38
commit 757bde1bde
2 changed files with 12 additions and 13 deletions

View File

@ -21,7 +21,6 @@ from oslo_utils import timeutils
from senlin.common import consts
from senlin.common import context as req_context
from senlin.common import exception
from senlin.common.i18n import _
from senlin.common import utils
from senlin.engine import dispatcher
from senlin.engine import event as EVENT
@ -336,8 +335,9 @@ class Action(object):
dispatcher.start_action(self.id)
else:
status = self.RES_ERROR
reason = reason or _('Exceeded maximum number of retries (%d)'
) % cfg.CONF.lock_retry_times
if not reason:
reason = ('Exceeded maximum number of retries (%d)'
'') % cfg.CONF.lock_retry_times
ao.Action.mark_failed(self.context, self.id, timestamp, reason)
if status == self.SUCCEEDED:
@ -391,8 +391,8 @@ class Action(object):
if self.data['status'] == policy_mod.CHECK_OK:
return True
self.data['reason'] = _("Failed policy '%(name)s': %(reason)s"
) % {'name': name, 'reason': reason}
self.data['reason'] = ("Failed policy '%(name)s': %(reason)s"
) % {'name': name, 'reason': reason}
return False
def policy_check(self, cluster_id, target):
@ -412,7 +412,7 @@ class Action(object):
filters={'enabled': True})
# default values
self.data['status'] = policy_mod.CHECK_OK
self.data['reason'] = _('Completed policy checking.')
self.data['reason'] = 'Completed policy checking.'
for pb in bindings:
policy = policy_mod.Policy.load(self.context, pb.policy_id)
@ -436,8 +436,8 @@ class Action(object):
if getattr(policy, 'cooldown', None):
if pb.cooldown_inprogress(policy.cooldown):
self.data['status'] = policy_mod.CHECK_ERROR
self.data['reason'] = _('Policy %s cooldown is still '
'in progress.') % policy.id
self.data['reason'] = ('Policy %s cooldown is still '
'in progress.') % policy.id
return
if method is not None:

View File

@ -19,7 +19,6 @@ from osprofiler import profiler
from senlin.common import consts
from senlin.common import exception
from senlin.common.i18n import _
from senlin.common import scaleutils
from senlin.common import utils
from senlin.engine.actions import base
@ -94,8 +93,8 @@ class ClusterAction(base.Action):
self.is_timeout(lifecycle_hook_timeout)):
# if lifecycle hook timeout is specified and Lifecycle hook
# timeout is reached, return
reason = _('%(action)s [%(id)s] lifecycle hook timeout') % {
'action': self.action, 'id': self.id[:8]}
reason = ('%(action)s [%(id)s] lifecycle hook timeout'
'') % {'action': self.action, 'id': self.id[:8]}
LOG.debug(reason)
return self.RES_LIFECYCLE_HOOK_TIMEOUT, reason
@ -328,8 +327,8 @@ class ClusterAction(base.Action):
lifecycle_hook_target = lifecycle_hook_params.get('queue')
else:
# lifecycle_hook_target = lifecycle_hook_params.get('url')
return self.RES_ERROR, _("Lifecycle hook type '%s' is not "
"implemented") % lifecycle_hook_type
return self.RES_ERROR, ("Lifecycle hook type '%s' is not "
"implemented") % lifecycle_hook_type
child = []
for node_id in node_ids: