Merge "Remove translation of log messages from ironic/drivers/modules/irmc"

This commit is contained in:
Jenkins 2017-04-25 19:55:40 +00:00 committed by Gerrit Code Review
commit fc85902c55
4 changed files with 38 additions and 41 deletions

View File

@ -28,7 +28,7 @@ from oslo_utils import importutils
from ironic.common import boot_devices from ironic.common import boot_devices
from ironic.common import exception from ironic.common import exception
from ironic.common.glance_service import service_utils from ironic.common.glance_service import service_utils
from ironic.common.i18n import _, _LE, _LI from ironic.common.i18n import _
from ironic.common import images from ironic.common import images
from ironic.common import states from ironic.common import states
from ironic.conductor import utils as manager_utils from ironic.conductor import utils as manager_utils
@ -350,7 +350,7 @@ def _setup_vmedia_for_boot(task, bootable_iso_filename, parameters=None):
:raises: ImageCreationFailed, if it failed while creating a floppy image. :raises: ImageCreationFailed, if it failed while creating a floppy image.
:raises: IRMCOperationError, if attaching a virtual media failed. :raises: IRMCOperationError, if attaching a virtual media failed.
""" """
LOG.info(_LI("Setting up node %s to boot from virtual media"), LOG.info("Setting up node %s to boot from virtual media",
task.node.uuid) task.node.uuid)
_detach_virtual_cd(task.node) _detach_virtual_cd(task.node)
@ -417,15 +417,15 @@ def _attach_virtual_cd(node, bootable_iso_filename):
irmc_client(scci.MOUNT_CD, async=False) irmc_client(scci.MOUNT_CD, async=False)
except scci.SCCIClientError as irmc_exception: except scci.SCCIClientError as irmc_exception:
LOG.exception(_LE("Error while inserting virtual cdrom " LOG.exception("Error while inserting virtual cdrom "
"into node %(uuid)s. Error: %(error)s"), "into node %(uuid)s. Error: %(error)s",
{'uuid': node.uuid, 'error': irmc_exception}) {'uuid': node.uuid, 'error': irmc_exception})
operation = _("Inserting virtual cdrom") operation = _("Inserting virtual cdrom")
raise exception.IRMCOperationError(operation=operation, raise exception.IRMCOperationError(operation=operation,
error=irmc_exception) error=irmc_exception)
LOG.info(_LI("Attached virtual cdrom successfully" LOG.info("Attached virtual cdrom successfully"
" for node %s"), node.uuid) " for node %s", node.uuid)
def _detach_virtual_cd(node): def _detach_virtual_cd(node):
@ -440,15 +440,15 @@ def _detach_virtual_cd(node):
irmc_client(scci.UNMOUNT_CD) irmc_client(scci.UNMOUNT_CD)
except scci.SCCIClientError as irmc_exception: except scci.SCCIClientError as irmc_exception:
LOG.exception(_LE("Error while ejecting virtual cdrom " LOG.exception("Error while ejecting virtual cdrom "
"from node %(uuid)s. Error: %(error)s"), "from node %(uuid)s. Error: %(error)s",
{'uuid': node.uuid, 'error': irmc_exception}) {'uuid': node.uuid, 'error': irmc_exception})
operation = _("Ejecting virtual cdrom") operation = _("Ejecting virtual cdrom")
raise exception.IRMCOperationError(operation=operation, raise exception.IRMCOperationError(operation=operation,
error=irmc_exception) error=irmc_exception)
LOG.info(_LI("Detached virtual cdrom successfully" LOG.info("Detached virtual cdrom successfully"
" for node %s"), node.uuid) " for node %s", node.uuid)
def _attach_virtual_fd(node, floppy_image_filename): def _attach_virtual_fd(node, floppy_image_filename):
@ -473,15 +473,15 @@ def _attach_virtual_fd(node, floppy_image_filename):
irmc_client(scci.MOUNT_FD, async=False) irmc_client(scci.MOUNT_FD, async=False)
except scci.SCCIClientError as irmc_exception: except scci.SCCIClientError as irmc_exception:
LOG.exception(_LE("Error while inserting virtual floppy " LOG.exception("Error while inserting virtual floppy "
"into node %(uuid)s. Error: %(error)s"), "into node %(uuid)s. Error: %(error)s",
{'uuid': node.uuid, 'error': irmc_exception}) {'uuid': node.uuid, 'error': irmc_exception})
operation = _("Inserting virtual floppy") operation = _("Inserting virtual floppy")
raise exception.IRMCOperationError(operation=operation, raise exception.IRMCOperationError(operation=operation,
error=irmc_exception) error=irmc_exception)
LOG.info(_LI("Attached virtual floppy successfully" LOG.info("Attached virtual floppy successfully"
" for node %s"), node.uuid) " for node %s", node.uuid)
def _detach_virtual_fd(node): def _detach_virtual_fd(node):
@ -496,15 +496,15 @@ def _detach_virtual_fd(node):
irmc_client(scci.UNMOUNT_FD) irmc_client(scci.UNMOUNT_FD)
except scci.SCCIClientError as irmc_exception: except scci.SCCIClientError as irmc_exception:
LOG.exception(_LE("Error while ejecting virtual floppy " LOG.exception("Error while ejecting virtual floppy "
"from node %(uuid)s. Error: %(error)s"), "from node %(uuid)s. Error: %(error)s",
{'uuid': node.uuid, 'error': irmc_exception}) {'uuid': node.uuid, 'error': irmc_exception})
operation = _("Ejecting virtual floppy") operation = _("Ejecting virtual floppy")
raise exception.IRMCOperationError(operation=operation, raise exception.IRMCOperationError(operation=operation,
error=irmc_exception) error=irmc_exception)
LOG.info(_LI("Detached virtual floppy successfully" LOG.info("Detached virtual floppy successfully"
" for node %s"), node.uuid) " for node %s", node.uuid)
def check_share_fs_mounted(): def check_share_fs_mounted():

View File

@ -19,7 +19,7 @@ from oslo_log import log as logging
from oslo_utils import importutils from oslo_utils import importutils
from ironic.common import exception from ironic.common import exception
from ironic.common.i18n import _, _LI, _LW from ironic.common.i18n import _
from ironic.common import states from ironic.common import states
from ironic.drivers import base from ironic.drivers import base
from ironic.drivers.modules.irmc import common as irmc_common from ironic.drivers.modules.irmc import common as irmc_common
@ -179,14 +179,14 @@ class IRMCInspect(base.InspectInterface):
new_port = objects.Port(task.context, new_port = objects.Port(task.context,
address=mac, node_id=node.id) address=mac, node_id=node.id)
new_port.create() new_port.create()
LOG.info(_LI("Port created for MAC address %(address)s " LOG.info("Port created for MAC address %(address)s "
"for node %(node_uuid)s during inspection"), "for node %(node_uuid)s during inspection",
{'address': mac, 'node_uuid': node.uuid}) {'address': mac, 'node_uuid': node.uuid})
except exception.MACAlreadyExists: except exception.MACAlreadyExists:
LOG.warning(_LW("Port already existed for MAC address " LOG.warning("Port already existed for MAC address "
"%(address)s for node %(node_uuid)s " "%(address)s for node %(node_uuid)s "
"during inspection"), "during inspection",
{'address': mac, 'node_uuid': node.uuid}) {'address': mac, 'node_uuid': node.uuid})
LOG.info(_LI("Node %s inspected"), node.uuid) LOG.info("Node %s inspected", node.uuid)
return states.MANAGEABLE return states.MANAGEABLE

View File

@ -20,7 +20,7 @@ from oslo_utils import importutils
from ironic.common import boot_devices from ironic.common import boot_devices
from ironic.common import exception from ironic.common import exception
from ironic.common.i18n import _, _LE from ironic.common.i18n import _
from ironic.conductor import task_manager from ironic.conductor import task_manager
from ironic.drivers.modules import ipmitool from ironic.drivers.modules import ipmitool
from ironic.drivers.modules.irmc import common as irmc_common from ironic.drivers.modules.irmc import common as irmc_common
@ -67,8 +67,8 @@ def _get_sensors_data(task):
exception.MissingParameterValue, exception.MissingParameterValue,
scci.SCCIInvalidInputError, scci.SCCIInvalidInputError,
scci.SCCIClientError) as e: scci.SCCIClientError) as e:
LOG.error(_LE("SCCI get sensor data failed for node %(node_id)s " LOG.error("SCCI get sensor data failed for node %(node_id)s "
"with the following error: %(error)s"), "with the following error: %(error)s",
{'node_id': task.node.uuid, 'error': e}) {'node_id': task.node.uuid, 'error': e})
raise exception.FailedToGetSensorData( raise exception.FailedToGetSensorData(
node=task.node.uuid, error=e) node=task.node.uuid, error=e)
@ -251,8 +251,7 @@ class IRMCManagement(ipmitool.IPMIManagement):
try: try:
irmc_client(scci.POWER_RAISE_NMI) irmc_client(scci.POWER_RAISE_NMI)
except scci.SCCIClientError as err: except scci.SCCIClientError as err:
LOG.error( LOG.error('iRMC Inject NMI failed for node %(node)s: %(err)s.',
_LE('iRMC Inject NMI failed for node %(node)s: %(err)s.'), {'node': node.uuid, 'err': err})
{'node': node.uuid, 'err': err})
raise exception.IRMCOperationError( raise exception.IRMCOperationError(
operation=scci.POWER_RAISE_NMI, error=err) operation=scci.POWER_RAISE_NMI, error=err)

View File

@ -22,8 +22,6 @@ from oslo_utils import importutils
from ironic.common import exception from ironic.common import exception
from ironic.common.i18n import _ from ironic.common.i18n import _
from ironic.common.i18n import _LE
from ironic.common.i18n import _LI
from ironic.common import states from ironic.common import states
from ironic.conductor import task_manager from ironic.conductor import task_manager
from ironic.conf import CONF from ironic.conf import CONF
@ -135,8 +133,8 @@ def _wait_power_state(task, target_state, timeout=None):
else states.POWER_ON) else states.POWER_ON)
node.target_power_state = states.NOSTATE node.target_power_state = states.NOSTATE
node.save() node.save()
LOG.info(_LI('iRMC successfully set node %(node_id)s ' LOG.info('iRMC successfully set node %(node_id)s '
'power state to %(bootstatus)s.'), 'power state to %(bootstatus)s.',
{'node_id': node.uuid, {'node_id': node.uuid,
'bootstatus': BOOT_STATUS[store['boot_status_value']]}) 'bootstatus': BOOT_STATUS[store['boot_status_value']]})
else: else:
@ -147,8 +145,8 @@ def _wait_power_state(task, target_state, timeout=None):
node.power_state = states.ERROR node.power_state = states.ERROR
node.target_power_state = states.NOSTATE node.target_power_state = states.NOSTATE
node.save() node.save()
LOG.error(_LE('iRMC failed to acknowledge the target state for node ' LOG.error('iRMC failed to acknowledge the target state for node '
'%(node_id)s. Error: %(last_error)s'), '%(node_id)s. Error: %(last_error)s',
{'node_id': node.uuid, 'last_error': last_error}) {'node_id': node.uuid, 'last_error': last_error})
error = _('unexpected boot status value') error = _('unexpected boot status value')
raise exception.IRMCOperationError(operation=target_state, raise exception.IRMCOperationError(operation=target_state,
@ -182,8 +180,8 @@ def _set_power_state(task, target_state, timeout=None):
raise exception.InvalidParameterValue(msg) raise exception.InvalidParameterValue(msg)
except scci.SCCIClientError as irmc_exception: except scci.SCCIClientError as irmc_exception:
LOG.error(_LE("iRMC set_power_state failed to set state to %(tstate)s " LOG.error("iRMC set_power_state failed to set state to %(tstate)s "
" for node %(node_id)s with error: %(error)s"), " for node %(node_id)s with error: %(error)s",
{'tstate': target_state, 'node_id': node.uuid, {'tstate': target_state, 'node_id': node.uuid,
'error': irmc_exception}) 'error': irmc_exception})
operation = _('iRMC set_power_state') operation = _('iRMC set_power_state')
@ -200,8 +198,8 @@ def _set_power_state(task, target_state, timeout=None):
_wait_power_state(task, states.SOFT_REBOOT, timeout=timeout) _wait_power_state(task, states.SOFT_REBOOT, timeout=timeout)
except exception.SNMPFailure as snmp_exception: except exception.SNMPFailure as snmp_exception:
LOG.error(_LE("iRMC failed to acknowledge the target state " LOG.error("iRMC failed to acknowledge the target state "
"for node %(node_id)s. Error: %(error)s"), "for node %(node_id)s. Error: %(error)s",
{'node_id': node.uuid, 'error': snmp_exception}) {'node_id': node.uuid, 'error': snmp_exception})
raise exception.IRMCOperationError(operation=target_state, raise exception.IRMCOperationError(operation=target_state,
error=snmp_exception) error=snmp_exception)