Drop meaningless translation marker

The translation marker _(..) wrapping a variable is meaningless
as no string is extracted and there is no way to translate them.
Only rare exception is the same string is defined in somewhere else
but I've never seen such situations so far.

In addition, we now only support translations in user-visible messages
used in API, so we can safely drop translation markers in exceptions
in the agent side.

Change-Id: Ie1d837d17bf50a4675bec4fe48ab13dde22ebdc2
Related-Bug: #1600788
This commit is contained in:
Akihiro Motoki
2021-02-04 15:37:23 +09:00
parent 07aa04b955
commit 257a51769b
2 changed files with 2 additions and 5 deletions

View File

@ -35,7 +35,6 @@ from oslo_utils import excutils
from oslo_utils import fileutils
import psutil
from neutron._i18n import _
from neutron.common import utils
from neutron.conf.agent import common as config
from neutron.privileged.agent.linux import utils as priv_utils
@ -142,7 +141,7 @@ def execute(cmd, process_input=None, addl_env=None,
if log_fail_as_error:
LOG.error(msg)
if check_exit_code:
raise exceptions.ProcessExecutionError(_(msg),
raise exceptions.ProcessExecutionError(msg,
returncode=returncode)
finally:
# NOTE(termie): this appears to be necessary to let the subprocess

View File

@ -25,8 +25,6 @@ from neutron_lib.utils import helpers
from oslo_log import log as logging
from oslo_utils import encodeutils
from neutron._i18n import _
if os.name == 'nt':
import wmi
@ -133,7 +131,7 @@ def execute(cmd, process_input=None, addl_env=None,
LOG.debug(log_msg)
if obj.returncode and check_exit_code:
raise exceptions.ProcessExecutionError(_(m), returncode=obj.returncode)
raise exceptions.ProcessExecutionError(m, returncode=obj.returncode)
return (_stdout, _stderr) if return_stderr else _stdout