Skip to content

Commit bfdca19

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "trivial: Remove remaining '_LW' instances"
2 parents 301a5c6 + 3a28b0e commit bfdca19

File tree

10 files changed

+47
-45
lines changed

10 files changed

+47
-45
lines changed

nova/debugger.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ def init():
3737
if not (CONF.remote_debug.host and CONF.remote_debug.port):
3838
return
3939

40-
from nova.i18n import _LW
4140
from oslo_log import log as logging
4241
LOG = logging.getLogger(__name__)
4342

@@ -49,12 +48,13 @@ def init():
4948
from pydev import pydevd
5049
except ImportError:
5150
import pydevd
51+
5252
pydevd.settrace(host=CONF.remote_debug.host,
5353
port=CONF.remote_debug.port,
5454
stdoutToServer=False,
5555
stderrToServer=False)
5656

57-
LOG.warning(_LW('WARNING: Using the remote debug option changes how '
58-
'Nova uses the eventlet library to support async IO. This '
59-
'could result in failures that do not occur under normal '
60-
'operation. Use at your own risk.'))
57+
LOG.warning('WARNING: Using the remote debug option changes how '
58+
'Nova uses the eventlet library to support async IO. This '
59+
'could result in failures that do not occur under normal '
60+
'operation. Use at your own risk.')

nova/hooks.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
from oslo_log import log as logging
5151
import stevedore
5252

53-
from nova.i18n import _, _LW
53+
from nova.i18n import _
5454

5555
LOG = logging.getLogger(__name__)
5656
NS = 'nova.hooks'
@@ -86,8 +86,8 @@ def _run(self, name, method_type, args, kwargs, func=None):
8686
obj = e.obj
8787
hook_method = getattr(obj, method_type, None)
8888
if hook_method:
89-
LOG.warning(_LW("Hooks are deprecated as of Nova 13.0 and "
90-
"will be removed in a future release"))
89+
LOG.warning("Hooks are deprecated as of Nova 13.0 and "
90+
"will be removed in a future release")
9191
LOG.debug("Running %(name)s %(type)s-hook: %(obj)s",
9292
{'name': name, 'type': method_type, 'obj': obj})
9393
try:

nova/i18n.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
# name like '_'. The "L" is for "log" and the other letter comes from
3434
# the level.
3535
_LI = _translators.log_info
36-
_LW = _translators.log_warning
3736

3837

3938
def translate(value, user_locale):

nova/policy.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424

2525

2626
from nova import exception
27-
from nova.i18n import _LW
2827
from nova import policies
2928

3029

@@ -115,10 +114,12 @@ def _warning_for_deprecated_user_based_rules(rules):
115114
if resource in rule[0]]:
116115
continue
117116
if 'user_id' in KEY_EXPR.findall(rule[1]):
118-
LOG.warning(_LW("The user_id attribute isn't supported in the "
119-
"rule '%s'. All the user_id based policy "
120-
"enforcement will be removed in the "
121-
"future."), rule[0])
117+
LOG.warning(
118+
"The user_id attribute isn't supported in the rule '%s'. "
119+
"All the user_id based policy enforcement will be removed in "
120+
"the future.",
121+
rule[0]
122+
)
122123

123124

124125
def set_rules(rules, overwrite=True, use_conf=False):

nova/service.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
from nova import context
3535
from nova import debugger
3636
from nova import exception
37-
from nova.i18n import _, _LI, _LW
37+
from nova.i18n import _, _LI
3838
from nova import objects
3939
from nova.objects import base as objects_base
4040
from nova.objects import service as service_obj
@@ -282,7 +282,7 @@ def kill(self):
282282
try:
283283
self.service_ref.destroy()
284284
except exception.NotFound:
285-
LOG.warning(_LW('Service killed that has no database entry'))
285+
LOG.warning('Service killed that has no database entry')
286286

287287
def stop(self):
288288
"""stop the service and clean up."""

nova/servicegroup/api.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
from oslo_utils import importutils
2121

2222
import nova.conf
23-
from nova.i18n import _LW
2423

2524
LOG = logging.getLogger(__name__)
2625

@@ -47,11 +46,11 @@ def __init__(self, *args, **kwargs):
4746
report_interval = CONF.report_interval
4847
if CONF.service_down_time <= report_interval:
4948
new_service_down_time = int(report_interval * 2.5)
50-
LOG.warning(_LW("Report interval must be less than service down "
51-
"time. Current config: <service_down_time: "
52-
"%(service_down_time)s, report_interval: "
53-
"%(report_interval)s>. Setting service_down_time "
54-
"to: %(new_service_down_time)s"),
49+
LOG.warning("Report interval must be less than service down "
50+
"time. Current config: <service_down_time: "
51+
"%(service_down_time)s, report_interval: "
52+
"%(report_interval)s>. Setting service_down_time "
53+
"to: %(new_service_down_time)s",
5554
{'service_down_time': CONF.service_down_time,
5655
'report_interval': report_interval,
5756
'new_service_down_time': new_service_down_time})

nova/servicegroup/drivers/db.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
import nova.conf
2222
from nova import exception
23-
from nova.i18n import _, _LI, _LW
23+
from nova.i18n import _, _LI
2424
from nova.servicegroup import api
2525
from nova.servicegroup.drivers import base
2626

@@ -102,8 +102,10 @@ def _report_state(self, service):
102102
# as nova-conductor is restarted, so only log this error once.
103103
if not getattr(service, 'model_disconnected', False):
104104
service.model_disconnected = True
105-
LOG.warning(_LW('Lost connection to nova-conductor '
106-
'for reporting service status.'))
105+
LOG.warning(
106+
'Lost connection to nova-conductor for reporting service '
107+
'status.'
108+
)
107109
except exception.ServiceNotFound:
108110
# The service may have been deleted via the API but the actual
109111
# process is still running. Provide a useful error message rather

nova/servicegroup/drivers/mc.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
from nova import cache_utils
2525
import nova.conf
26-
from nova.i18n import _, _LI, _LW
26+
from nova.i18n import _, _LI
2727
from nova.servicegroup import api
2828
from nova.servicegroup.drivers import base
2929

@@ -108,5 +108,7 @@ def _report_state(self, service):
108108
except Exception:
109109
if not getattr(service, 'model_disconnected', False):
110110
service.model_disconnected = True
111-
LOG.warning(_LW('Lost connection to memcache server '
112-
'for reporting service status.'))
111+
LOG.warning(
112+
'Lost connection to memcache server for reporting service '
113+
'status.'
114+
)

nova/utils.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
from nova import block_device
5454
import nova.conf
5555
from nova import exception
56-
from nova.i18n import _, _LW
56+
from nova.i18n import _
5757
from nova import safe_utils
5858

5959
profiler = importutils.try_import('osprofiler.profiler')
@@ -372,9 +372,9 @@ def sanitize_hostname(hostname, default_name=None):
372372

373373
def truncate_hostname(name):
374374
if len(name) > 63:
375-
LOG.warning(_LW("Hostname %(hostname)s is longer than 63, "
376-
"truncate it to %(truncated_name)s"),
377-
{'hostname': name, 'truncated_name': name[:63]})
375+
LOG.warning("Hostname %(hostname)s is longer than 63, "
376+
"truncate it to %(truncated_name)s",
377+
{'hostname': name, 'truncated_name': name[:63]})
378378
return name[:63]
379379

380380
if isinstance(hostname, six.text_type):

nova/volume/cinder.py

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
import nova.conf
4343
from nova import exception
4444
from nova.i18n import _
45-
from nova.i18n import _LW
4645
from nova import service_auth
4746

4847

@@ -581,21 +580,21 @@ def detach(self, context, volume_id, instance_uuid=None,
581580
attachment_id = attachments.get(instance_uuid, {}).\
582581
get('attachment_id')
583582
if not attachment_id:
584-
LOG.warning(_LW("attachment_id couldn't be retrieved "
585-
"for volume %(volume_id)s with "
586-
"instance_uuid %(instance_id)s. The "
587-
"volume has the 'multiattach' flag "
588-
"enabled, without the attachment_id "
589-
"Cinder most probably cannot perform "
590-
"the detach."),
583+
LOG.warning("attachment_id couldn't be retrieved "
584+
"for volume %(volume_id)s with "
585+
"instance_uuid %(instance_id)s. The "
586+
"volume has the 'multiattach' flag "
587+
"enabled, without the attachment_id "
588+
"Cinder most probably cannot perform "
589+
"the detach.",
591590
{'volume_id': volume_id,
592591
'instance_id': instance_uuid})
593592
else:
594-
LOG.warning(_LW("attachment_id couldn't be retrieved for "
595-
"volume %(volume_id)s. The volume has the "
596-
"'multiattach' flag enabled, without the "
597-
"attachment_id Cinder most probably "
598-
"cannot perform the detach."),
593+
LOG.warning("attachment_id couldn't be retrieved for "
594+
"volume %(volume_id)s. The volume has the "
595+
"'multiattach' flag enabled, without the "
596+
"attachment_id Cinder most probably "
597+
"cannot perform the detach.",
599598
{'volume_id': volume_id})
600599

601600
client.volumes.detach(volume_id, attachment_id)

0 commit comments

Comments
 (0)