Remove translation of log messages Part-2

The i18n team has decided not to translate the logs because it seems
like it not very useful.

Change-Id: I46c1b0c3efa28c3f887b1a29dc77d47fe749be87
Closes-Bug: #1674374
This commit is contained in:
Annie Lezil 2017-03-21 18:14:57 +00:00
parent fec8c78600
commit 1e6b689286
7 changed files with 92 additions and 106 deletions

View File

@ -19,13 +19,3 @@ _translators = oslo_i18n.TranslatorFactory(domain='ironic_inspector')
# The primary translation function using the well-known name "_" # The primary translation function using the well-known name "_"
_ = _translators.primary _ = _translators.primary
# Translators for log levels.
#
# The abbreviated names are meant to reflect the usual use of a short
# name like '_'. The "L" is for "log" and the other letter comes from
# the level.
_LI = _translators.log_info
_LW = _translators.log_warning
_LE = _translators.log_error
_LC = _translators.log_critical

View File

@ -20,7 +20,6 @@ from eventlet import semaphore
from oslo_config import cfg from oslo_config import cfg
from oslo_log import log from oslo_log import log
from ironic_inspector.common.i18n import _LE, _LW
from ironic_inspector.common import ironic as ir_utils from ironic_inspector.common import ironic as ir_utils
from ironic_inspector import node_cache from ironic_inspector import node_cache
@ -51,7 +50,7 @@ def _iptables(*args, **kwargs):
LOG.debug('Ignoring failed iptables %(args)s: %(output)s', LOG.debug('Ignoring failed iptables %(args)s: %(output)s',
{'args': args, 'output': output}) {'args': args, 'output': output})
else: else:
LOG.error(_LE('iptables %(iptables)s failed: %(exc)s'), LOG.error('iptables %(iptables)s failed: %(exc)s',
{'iptables': args, 'exc': output}) {'iptables': args, 'exc': output})
raise raise
@ -79,8 +78,8 @@ def init():
subprocess.check_call(BASE_COMMAND + ('-w', '-h'), subprocess.check_call(BASE_COMMAND + ('-w', '-h'),
stderr=null, stdout=null) stderr=null, stdout=null)
except subprocess.CalledProcessError: except subprocess.CalledProcessError:
LOG.warning(_LW('iptables does not support -w flag, please update ' LOG.warning('iptables does not support -w flag, please update '
'it to at least version 1.4.21')) 'it to at least version 1.4.21')
else: else:
BASE_COMMAND += ('-w',) BASE_COMMAND += ('-w',)
@ -241,9 +240,8 @@ def _ib_mac_to_rmac_mapping(blacklist_macs, ports_active):
with open(neighs_file, 'r') as fd: with open(neighs_file, 'r') as fd:
data = fd.read() data = fd.read()
except IOError: except IOError:
LOG.error( LOG.error('Interface %s is not Ethernet Over InfiniBand; '
_LE('Interface %s is not Ethernet Over InfiniBand; ' 'Skipping ...', interface)
'Skipping ...'), interface)
continue continue
for port in ports_active: for port in ports_active:
if port.address in blacklist_macs: if port.address in blacklist_macs:

View File

@ -20,7 +20,7 @@ import time
from eventlet import semaphore from eventlet import semaphore
from oslo_config import cfg from oslo_config import cfg
from ironic_inspector.common.i18n import _, _LI, _LW from ironic_inspector.common.i18n import _
from ironic_inspector.common import ironic as ir_utils from ironic_inspector.common import ironic as ir_utils
from ironic_inspector import firewall from ironic_inspector import firewall
from ironic_inspector import introspection_state as istate from ironic_inspector import introspection_state as istate
@ -136,7 +136,7 @@ def _background_introspect_locked(node_info, ironic):
macs = list(node_info.ports()) macs = list(node_info.ports())
if macs: if macs:
node_info.add_attribute(node_cache.MACS_ATTRIBUTE, macs) node_info.add_attribute(node_cache.MACS_ATTRIBUTE, macs)
LOG.info(_LI('Whitelisting MAC\'s %s on the firewall'), macs, LOG.info('Whitelisting MAC\'s %s on the firewall', macs,
node_info=node_info) node_info=node_info)
firewall.update_filters(ironic) firewall.update_filters(ironic)
@ -148,7 +148,7 @@ def _background_introspect_locked(node_info, ironic):
'ironic ports or providing an IPMI address'), 'ironic ports or providing an IPMI address'),
node_info=node_info) node_info=node_info)
LOG.info(_LI('The following attributes will be used for look up: %s'), LOG.info('The following attributes will be used for look up: %s',
attrs, node_info=node_info) attrs, node_info=node_info)
if not node_info.options.get('new_ipmi_credentials'): if not node_info.options.get('new_ipmi_credentials'):
@ -156,7 +156,7 @@ def _background_introspect_locked(node_info, ironic):
ironic.node.set_boot_device(node_info.uuid, 'pxe', ironic.node.set_boot_device(node_info.uuid, 'pxe',
persistent=False) persistent=False)
except Exception as exc: except Exception as exc:
LOG.warning(_LW('Failed to set boot device to PXE: %s'), LOG.warning('Failed to set boot device to PXE: %s',
exc, node_info=node_info) exc, node_info=node_info)
try: try:
@ -165,11 +165,11 @@ def _background_introspect_locked(node_info, ironic):
raise utils.Error(_('Failed to power on the node, check it\'s ' raise utils.Error(_('Failed to power on the node, check it\'s '
'power management configuration: %s'), 'power management configuration: %s'),
exc, node_info=node_info) exc, node_info=node_info)
LOG.info(_LI('Introspection started successfully'), LOG.info('Introspection started successfully',
node_info=node_info) node_info=node_info)
else: else:
LOG.info(_LI('Introspection environment is ready, manual power on is ' LOG.info('Introspection environment is ready, manual power on is '
'required within %d seconds'), CONF.timeout, 'required within %d seconds', CONF.timeout,
node_info=node_info) node_info=node_info)
@ -200,8 +200,8 @@ def _abort(node_info, ironic):
# runs in background # runs in background
if node_info.finished_at is not None: if node_info.finished_at is not None:
# introspection already finished; nothing to do # introspection already finished; nothing to do
LOG.info(_LI('Cannot abort introspection as it is already ' LOG.info('Cannot abort introspection as it is already '
'finished'), node_info=node_info) 'finished', node_info=node_info)
node_info.release_lock() node_info.release_lock()
return return
@ -210,7 +210,7 @@ def _abort(node_info, ironic):
try: try:
ironic.node.set_power_state(node_info.uuid, 'off') ironic.node.set_power_state(node_info.uuid, 'off')
except Exception as exc: except Exception as exc:
LOG.warning(_LW('Failed to power off node: %s'), exc, LOG.warning('Failed to power off node: %s', exc,
node_info=node_info) node_info=node_info)
node_info.finished(error=_('Canceled by operator')) node_info.finished(error=_('Canceled by operator'))
@ -221,6 +221,6 @@ def _abort(node_info, ironic):
except Exception as exc: except Exception as exc:
# Note(mkovacik): this will be retried in firewall update # Note(mkovacik): this will be retried in firewall update
# periodic task; we continue aborting # periodic task; we continue aborting
LOG.warning(_LW('Failed to update firewall filters: %s'), exc, LOG.warning('Failed to update firewall filters: %s', exc,
node_info=node_info) node_info=node_info)
LOG.info(_LI('Introspection aborted'), node_info=node_info) LOG.info('Introspection aborted', node_info=node_info)

View File

@ -28,11 +28,11 @@ from oslo_utils import uuidutils
import werkzeug import werkzeug
from ironic_inspector import api_tools from ironic_inspector import api_tools
from ironic_inspector import db from ironic_inspector.common.i18n import _
from ironic_inspector.common.i18n import _, _LC, _LE, _LI, _LW
from ironic_inspector.common import ironic as ir_utils from ironic_inspector.common import ironic as ir_utils
from ironic_inspector.common import swift from ironic_inspector.common import swift
from ironic_inspector import conf # noqa from ironic_inspector import conf # noqa
from ironic_inspector import db
from ironic_inspector import firewall from ironic_inspector import firewall
from ironic_inspector import introspect from ironic_inspector import introspect
from ironic_inspector import node_cache from ironic_inspector import node_cache
@ -90,7 +90,7 @@ def convert_exceptions(func):
except werkzeug.exceptions.HTTPException as exc: except werkzeug.exceptions.HTTPException as exc:
return error_response(exc, exc.code or 400) return error_response(exc, exc.code or 400)
except Exception as exc: except Exception as exc:
LOG.exception(_LE('Internal server error')) LOG.exception('Internal server error')
msg = _('Internal server error') msg = _('Internal server error')
if CONF.debug: if CONF.debug:
msg += ' (%s): %s' % (exc.__class__.__name__, exc) msg += ' (%s): %s' % (exc.__class__.__name__, exc)
@ -355,7 +355,7 @@ def periodic_update(): # pragma: no cover
try: try:
firewall.update_filters() firewall.update_filters()
except Exception: except Exception:
LOG.exception(_LE('Periodic update of firewall rules failed')) LOG.exception('Periodic update of firewall rules failed')
def periodic_clean_up(): # pragma: no cover def periodic_clean_up(): # pragma: no cover
@ -364,7 +364,7 @@ def periodic_clean_up(): # pragma: no cover
firewall.update_filters() firewall.update_filters()
sync_with_ironic() sync_with_ironic()
except Exception: except Exception:
LOG.exception(_LE('Periodic clean up of node cache failed')) LOG.exception('Periodic clean up of node cache failed')
def sync_with_ironic(): def sync_with_ironic():
@ -382,9 +382,9 @@ def create_ssl_context():
MIN_VERSION = (2, 7, 9) MIN_VERSION = (2, 7, 9)
if sys.version_info < MIN_VERSION: if sys.version_info < MIN_VERSION:
LOG.warning(_LW('Unable to use SSL in this version of Python: ' LOG.warning('Unable to use SSL in this version of Python: '
'%(current)s, please ensure your version of Python is ' '%(current)s, please ensure your version of Python is '
'greater than %(min)s to enable this feature.'), 'greater than %(min)s to enable this feature.',
{'current': '.'.join(map(str, sys.version_info[:3])), {'current': '.'.join(map(str, sys.version_info[:3])),
'min': '.'.join(map(str, MIN_VERSION))}) 'min': '.'.join(map(str, MIN_VERSION))})
return return
@ -394,15 +394,15 @@ def create_ssl_context():
try: try:
context.load_cert_chain(CONF.ssl_cert_path, CONF.ssl_key_path) context.load_cert_chain(CONF.ssl_cert_path, CONF.ssl_key_path)
except IOError as exc: except IOError as exc:
LOG.warning(_LW('Failed to load certificate or key from defined ' LOG.warning('Failed to load certificate or key from defined '
'locations: %(cert)s and %(key)s, will continue ' 'locations: %(cert)s and %(key)s, will continue '
'to run with the default settings: %(exc)s'), 'to run with the default settings: %(exc)s',
{'cert': CONF.ssl_cert_path, 'key': CONF.ssl_key_path, {'cert': CONF.ssl_cert_path, 'key': CONF.ssl_key_path,
'exc': exc}) 'exc': exc})
except ssl.SSLError as exc: except ssl.SSLError as exc:
LOG.warning(_LW('There was a problem with the loaded certificate ' LOG.warning('There was a problem with the loaded certificate '
'and key, will continue to run with the default ' 'and key, will continue to run with the default '
'settings: %s'), exc) 'settings: %s', exc)
return context return context
@ -432,16 +432,16 @@ class Service(object):
if CONF.auth_strategy != 'noauth': if CONF.auth_strategy != 'noauth':
utils.add_auth_middleware(app) utils.add_auth_middleware(app)
else: else:
LOG.warning(_LW('Starting unauthenticated, please check' LOG.warning('Starting unauthenticated, please check'
' configuration')) ' configuration')
if CONF.processing.store_data == 'none': if CONF.processing.store_data == 'none':
LOG.warning(_LW('Introspection data will not be stored. Change ' LOG.warning('Introspection data will not be stored. Change '
'"[processing] store_data" option if this is not ' '"[processing] store_data" option if this is not '
'the desired behavior')) 'the desired behavior')
elif CONF.processing.store_data == 'swift': elif CONF.processing.store_data == 'swift':
LOG.info(_LI('Introspection data will be stored in Swift in the ' LOG.info('Introspection data will be stored in Swift in the '
'container %s'), CONF.swift.container) 'container %s', CONF.swift.container)
utils.add_cors_middleware(app) utils.add_cors_middleware(app)
@ -453,11 +453,11 @@ class Service(object):
except KeyError as exc: except KeyError as exc:
# callback function raises MissingHookError derived from KeyError # callback function raises MissingHookError derived from KeyError
# on missing hook # on missing hook
LOG.critical(_LC('Hook(s) %s failed to load or was not found'), LOG.critical('Hook(s) %s failed to load or was not found',
str(exc)) str(exc))
sys.exit(1) sys.exit(1)
LOG.info(_LI('Enabled processing hooks: %s'), hooks) LOG.info('Enabled processing hooks: %s', hooks)
if CONF.firewall.manage_firewall: if CONF.firewall.manage_firewall:
firewall.init() firewall.init()
@ -489,7 +489,7 @@ class Service(object):
if utils.executor().alive: if utils.executor().alive:
utils.executor().shutdown(wait=True) utils.executor().shutdown(wait=True)
LOG.info(_LI('Shut down successfully')) LOG.info('Shut down successfully')
def run(self, args, application): def run(self, args, application):
self.setup_logging(args) self.setup_logging(args)

View File

@ -32,9 +32,9 @@ import six
from sqlalchemy.orm import exc as orm_errors from sqlalchemy.orm import exc as orm_errors
from sqlalchemy import text from sqlalchemy import text
from ironic_inspector import db from ironic_inspector.common.i18n import _
from ironic_inspector.common.i18n import _, _LE, _LW, _LI
from ironic_inspector.common import ironic as ir_utils from ironic_inspector.common import ironic as ir_utils
from ironic_inspector import db
from ironic_inspector import introspection_state as istate from ironic_inspector import introspection_state as istate
from ironic_inspector import utils from ironic_inspector import utils
@ -93,8 +93,8 @@ class NodeInfo(object):
def __del__(self): def __del__(self):
if self._locked: if self._locked:
LOG.warning(_LW('BUG: node lock was not released by the moment ' LOG.warning('BUG: node lock was not released by the moment '
'node info object is deleted')) 'node info object is deleted')
self._lock.release() self._lock.release()
def __str__(self): def __str__(self):
@ -202,7 +202,7 @@ class NodeInfo(object):
yield fsm yield fsm
finally: finally:
if fsm.current_state != self.state: if fsm.current_state != self.state:
LOG.info(_LI('Updating node state: %(current)s --> %(new)s'), LOG.info('Updating node state: %(current)s --> %(new)s',
{'current': self.state, 'new': fsm.current_state}, {'current': self.state, 'new': fsm.current_state},
node_info=self) node_info=self)
self._set_state(fsm.current_state) self._set_state(fsm.current_state)
@ -361,7 +361,7 @@ class NodeInfo(object):
existing_macs.append(mac) existing_macs.append(mac)
if existing_macs: if existing_macs:
LOG.warning(_LW('Did not create ports %s as they already exist'), LOG.warning('Did not create ports %s as they already exist',
existing_macs, node_info=self) existing_macs, node_info=self)
def ports(self, ironic=None): def ports(self, ironic=None):
@ -383,7 +383,7 @@ class NodeInfo(object):
port = ironic.port.create( port = ironic.port.create(
node_uuid=self.uuid, address=mac, extra=extra) node_uuid=self.uuid, address=mac, extra=extra)
except exceptions.Conflict: except exceptions.Conflict:
LOG.warning(_LW('Port %s already exists, skipping'), LOG.warning('Port %s already exists, skipping',
mac, node_info=self) mac, node_info=self)
# NOTE(dtantsur): we didn't get port object back, so we have to # NOTE(dtantsur): we didn't get port object back, so we have to
# reload ports on next access # reload ports on next access
@ -537,9 +537,9 @@ def triggers_fsm_error_transition(errors=(Exception,),
node_info=node_info) node_info=node_info)
except errors as exc: except errors as exc:
with excutils.save_and_reraise_exception(): with excutils.save_and_reraise_exception():
LOG.error(_LE('Processing the error event because of an ' LOG.error('Processing the error event because of an '
'exception %(exc_type)s: %(exc)s raised by ' 'exception %(exc_type)s: %(exc)s raised by '
'%(func)s'), '%(func)s',
{'exc_type': type(exc), 'exc': exc, {'exc_type': type(exc), 'exc': exc,
'func': reflection.get_callable_name(func)}, 'func': reflection.get_callable_name(func)},
node_info=node_info) node_info=node_info)
@ -696,9 +696,8 @@ def delete_nodes_not_in_list(uuids):
""" """
inspector_uuids = _list_node_uuids() inspector_uuids = _list_node_uuids()
for uuid in inspector_uuids - uuids: for uuid in inspector_uuids - uuids:
LOG.warning( LOG.warning('Node %s was deleted from Ironic, dropping from Ironic '
_LW('Node %s was deleted from Ironic, dropping from Ironic ' 'Inspector database', uuid)
'Inspector database'), uuid)
with _get_lock_ctx(uuid): with _get_lock_ctx(uuid):
_delete_node(uuid) _delete_node(uuid)
@ -876,7 +875,7 @@ def clean_up():
if not uuids: if not uuids:
return [] return []
LOG.error(_LE('Introspection for nodes %s has timed out'), uuids) LOG.error('Introspection for nodes %s has timed out', uuids)
for u in uuids: for u in uuids:
node_info = get_node(u, locked=True) node_info = get_node(u, locked=True)
try: try:
@ -908,9 +907,9 @@ def create_node(driver, ironic=None, **attributes):
try: try:
node = ironic.node.create(driver=driver, **attributes) node = ironic.node.create(driver=driver, **attributes)
except exceptions.InvalidAttribute as e: except exceptions.InvalidAttribute as e:
LOG.error(_LE('Failed to create new node: %s'), e) LOG.error('Failed to create new node: %s', e)
else: else:
LOG.info(_LI('Node %s was created successfully'), node.uuid) LOG.info('Node %s was created successfully', node.uuid)
return add_node(node.uuid, istate.States.enrolling, ironic=ironic) return add_node(node.uuid, istate.States.enrolling, ironic=ironic)

View File

@ -19,7 +19,6 @@ from ironicclient import exc as client_exc
import netaddr import netaddr
from oslo_config import cfg from oslo_config import cfg
from ironic_inspector.common.i18n import _LW, _LE
from ironic_inspector.common import ironic from ironic_inspector.common import ironic
from ironic_inspector.plugins import base from ironic_inspector.plugins import base
from ironic_inspector import utils from ironic_inspector import utils
@ -54,10 +53,10 @@ class GenericLocalLinkConnectionHook(base.ProcessingHook):
try: try:
data = bytearray(binascii.unhexlify(tlv_value)) data = bytearray(binascii.unhexlify(tlv_value))
except TypeError: except TypeError:
LOG.warning(_LW("TLV value for TLV type %d not in correct" LOG.warning("TLV value for TLV type %d not in correct"
"format, ensure TLV value is in " "format, ensure TLV value is in "
"hexidecimal format when sent to " "hexidecimal format when sent to "
"inspector"), tlv_type) "inspector", tlv_type)
return return
item = value = None item = value = None
@ -106,7 +105,7 @@ class GenericLocalLinkConnectionHook(base.ProcessingHook):
lldp_data = iface.get('lldp') lldp_data = iface.get('lldp')
if lldp_data is None: if lldp_data is None:
LOG.warning(_LW("No LLDP Data found for interface %s"), LOG.warning("No LLDP Data found for interface %s",
mac_address, node_info=node_info, mac_address, node_info=node_info,
data=introspection_data) data=introspection_data)
continue continue
@ -124,9 +123,9 @@ class GenericLocalLinkConnectionHook(base.ProcessingHook):
cli = ironic.get_client(api_version=REQUIRED_IRONIC_VERSION) cli = ironic.get_client(api_version=REQUIRED_IRONIC_VERSION)
node_info.patch_port(port, patches, ironic=cli) node_info.patch_port(port, patches, ironic=cli)
except client_exc.NotAcceptable: except client_exc.NotAcceptable:
LOG.error(_LE("Unable to set Ironic port local link " LOG.error("Unable to set Ironic port local link "
"connection information because Ironic does not " "connection information because Ironic does not "
"support the required version"), "support the required version",
node_info=node_info, data=introspection_data) node_info=node_info, data=introspection_data)
# NOTE(sambetts) May as well break out out of the loop here # NOTE(sambetts) May as well break out out of the loop here
# because Ironic version is not going to change for the other # because Ironic version is not going to change for the other

View File

@ -24,7 +24,7 @@ from oslo_serialization import base64
from oslo_utils import excutils from oslo_utils import excutils
from oslo_utils import timeutils from oslo_utils import timeutils
from ironic_inspector.common.i18n import _, _LE, _LI, _LW from ironic_inspector.common.i18n import _
from ironic_inspector.common import ironic as ir_utils from ironic_inspector.common import ironic as ir_utils
from ironic_inspector.common import swift from ironic_inspector.common import swift
from ironic_inspector import firewall from ironic_inspector import firewall
@ -47,14 +47,14 @@ _UNPROCESSED_DATA_STORE_SUFFIX = 'UNPROCESSED'
def _store_logs(introspection_data, node_info): def _store_logs(introspection_data, node_info):
logs = introspection_data.get('logs') logs = introspection_data.get('logs')
if not logs: if not logs:
LOG.warning(_LW('No logs were passed by the ramdisk'), LOG.warning('No logs were passed by the ramdisk',
data=introspection_data, node_info=node_info) data=introspection_data, node_info=node_info)
return return
if not CONF.processing.ramdisk_logs_dir: if not CONF.processing.ramdisk_logs_dir:
LOG.warning(_LW('Failed to store logs received from the ramdisk ' LOG.warning('Failed to store logs received from the ramdisk '
'because ramdisk_logs_dir configuration option ' 'because ramdisk_logs_dir configuration option '
'is not set'), 'is not set',
data=introspection_data, node_info=node_info) data=introspection_data, node_info=node_info)
return return
@ -76,10 +76,10 @@ def _store_logs(introspection_data, node_info):
'wb') as fp: 'wb') as fp:
fp.write(base64.decode_as_bytes(logs)) fp.write(base64.decode_as_bytes(logs))
except EnvironmentError: except EnvironmentError:
LOG.exception(_LE('Could not store the ramdisk logs'), LOG.exception('Could not store the ramdisk logs',
data=introspection_data, node_info=node_info) data=introspection_data, node_info=node_info)
else: else:
LOG.info(_LI('Ramdisk logs were stored in file %s'), file_name, LOG.info('Ramdisk logs were stored in file %s', file_name,
data=introspection_data, node_info=node_info) data=introspection_data, node_info=node_info)
@ -123,15 +123,15 @@ def _run_pre_hooks(introspection_data, failures):
try: try:
hook_ext.obj.before_processing(introspection_data) hook_ext.obj.before_processing(introspection_data)
except utils.Error as exc: except utils.Error as exc:
LOG.error(_LE('Hook %(hook)s failed, delaying error report ' LOG.error('Hook %(hook)s failed, delaying error report '
'until node look up: %(error)s'), 'until node look up: %(error)s',
{'hook': hook_ext.name, 'error': exc}, {'hook': hook_ext.name, 'error': exc},
data=introspection_data) data=introspection_data)
failures.append('Preprocessing hook %(hook)s: %(error)s' % failures.append('Preprocessing hook %(hook)s: %(error)s' %
{'hook': hook_ext.name, 'error': exc}) {'hook': hook_ext.name, 'error': exc})
except Exception as exc: except Exception as exc:
LOG.exception(_LE('Hook %(hook)s failed, delaying error report ' LOG.exception('Hook %(hook)s failed, delaying error report '
'until node look up: %(error)s'), 'until node look up: %(error)s',
{'hook': hook_ext.name, 'error': exc}, {'hook': hook_ext.name, 'error': exc},
data=introspection_data) data=introspection_data)
failures.append(_('Unexpected exception %(exc_class)s during ' failures.append(_('Unexpected exception %(exc_class)s during '
@ -157,8 +157,8 @@ def _store_data(node_info, data, suffix=None):
node_info.uuid, node_info.uuid,
suffix=suffix suffix=suffix
) )
LOG.info(_LI('Introspection data was stored in Swift in object ' LOG.info('Introspection data was stored in Swift in object '
'%s'), swift_object_name, node_info=node_info) '%s', swift_object_name, node_info=node_info)
if CONF.processing.store_data_location: if CONF.processing.store_data_location:
node_info.patch([{'op': 'add', 'path': '/extra/%s' % node_info.patch([{'op': 'add', 'path': '/extra/%s' %
CONF.processing.store_data_location, CONF.processing.store_data_location,
@ -171,8 +171,8 @@ def _store_unprocessed_data(node_info, data):
_store_data(node_info, data, _store_data(node_info, data,
suffix=_UNPROCESSED_DATA_STORE_SUFFIX) suffix=_UNPROCESSED_DATA_STORE_SUFFIX)
except Exception: except Exception:
LOG.exception(_LE('Encountered exception saving unprocessed ' LOG.exception('Encountered exception saving unprocessed '
'introspection data'), node_info=node_info, 'introspection data', node_info=node_info,
data=data) data=data)
@ -212,7 +212,7 @@ def process(introspection_data):
_store_logs(introspection_data, node_info) _store_logs(introspection_data, node_info)
raise utils.Error(msg, node_info=node_info, data=introspection_data) raise utils.Error(msg, node_info=node_info, data=introspection_data)
LOG.info(_LI('Matching node is %s'), node_info.uuid, LOG.info('Matching node is %s', node_info.uuid,
node_info=node_info, data=introspection_data) node_info=node_info, data=introspection_data)
if node_info.finished_at is not None: if node_info.finished_at is not None:
@ -241,7 +241,7 @@ def process(introspection_data):
with excutils.save_and_reraise_exception(): with excutils.save_and_reraise_exception():
_store_logs(introspection_data, node_info) _store_logs(introspection_data, node_info)
except Exception as exc: except Exception as exc:
LOG.exception(_LE('Unexpected exception during processing')) LOG.exception('Unexpected exception during processing')
msg = _('Unexpected exception %(exc_class)s during processing: ' msg = _('Unexpected exception %(exc_class)s during processing: '
'%(error)s') % {'exc_class': exc.__class__.__name__, '%(error)s') % {'exc_class': exc.__class__.__name__,
'error': exc} 'error': exc}
@ -316,8 +316,8 @@ def _finish_set_ipmi_credentials(node_info, ironic, node, introspection_data,
# We don't care about boot device, obviously. # We don't care about boot device, obviously.
ironic.node.get_boot_device(node_info.uuid) ironic.node.get_boot_device(node_info.uuid)
except Exception as exc: except Exception as exc:
LOG.info(_LI('Waiting for credentials update, attempt %(attempt)d ' LOG.info('Waiting for credentials update, attempt %(attempt)d '
'current error is %(exc)s'), 'current error is %(exc)s',
{'attempt': attempt, 'exc': exc}, {'attempt': attempt, 'exc': exc},
node_info=node_info, data=introspection_data) node_info=node_info, data=introspection_data)
eventlet.greenthread.sleep(_CREDENTIALS_WAIT_PERIOD) eventlet.greenthread.sleep(_CREDENTIALS_WAIT_PERIOD)
@ -338,9 +338,9 @@ def _finish_common(node_info, ironic, introspection_data, power_off=True):
ironic.node.set_power_state(node_info.uuid, 'off') ironic.node.set_power_state(node_info.uuid, 'off')
except Exception as exc: except Exception as exc:
if node_info.node().provision_state == 'enroll': if node_info.node().provision_state == 'enroll':
LOG.info(_LI("Failed to power off the node in" LOG.info("Failed to power off the node in"
"'enroll' state, ignoring; error was " "'enroll' state, ignoring; error was "
"%s"), exc, node_info=node_info, "%s", exc, node_info=node_info,
data=introspection_data) data=introspection_data)
else: else:
msg = (_('Failed to power off node %(node)s, check ' msg = (_('Failed to power off node %(node)s, check '
@ -350,11 +350,11 @@ def _finish_common(node_info, ironic, introspection_data, power_off=True):
node_info.finished(error=msg) node_info.finished(error=msg)
raise utils.Error(msg, node_info=node_info, raise utils.Error(msg, node_info=node_info,
data=introspection_data) data=introspection_data)
LOG.info(_LI('Node powered-off'), node_info=node_info, LOG.info('Node powered-off', node_info=node_info,
data=introspection_data) data=introspection_data)
node_info.finished() node_info.finished()
LOG.info(_LI('Introspection finished successfully'), LOG.info('Introspection finished successfully',
node_info=node_info, data=introspection_data) node_info=node_info, data=introspection_data)
@ -393,8 +393,8 @@ def _reapply(node_info):
node_info.commit() node_info.commit()
introspection_data = _get_unprocessed_data(node_info.uuid) introspection_data = _get_unprocessed_data(node_info.uuid)
except Exception as exc: except Exception as exc:
LOG.exception(_LE('Encountered exception while fetching ' LOG.exception('Encountered exception while fetching '
'stored introspection data'), 'stored introspection data',
node_info=node_info) node_info=node_info)
msg = (_('Unexpected exception %(exc_class)s while fetching ' msg = (_('Unexpected exception %(exc_class)s while fetching '
'unprocessed introspection data from Swift: %(error)s') % 'unprocessed introspection data from Swift: %(error)s') %
@ -421,8 +421,8 @@ def _reapply(node_info):
_finish(node_info, ironic, introspection_data, _finish(node_info, ironic, introspection_data,
power_off=False) power_off=False)
LOG.info(_LI('Successfully reapplied introspection on stored ' LOG.info('Successfully reapplied introspection on stored '
'data'), node_info=node_info, data=introspection_data) 'data', node_info=node_info, data=introspection_data)
@node_cache.fsm_event_before(istate.Events.reapply) @node_cache.fsm_event_before(istate.Events.reapply)