From 4e6b8347777ed50edd562a9660ab0faefc3d237f Mon Sep 17 00:00:00 2001 From: Ngo Quoc Cuong Date: Tue, 25 Apr 2017 19:00:25 +0700 Subject: [PATCH] Remove translation of log messages from ironic/drivers/modules/ucs i18n team has decided not to translate the logs because it seems like it's not very useful. Removed translation of log messages from ironic/drivers/modules/ucs Change-Id: I68cb6f1b91588d4facd8ffed3fc9612e13f529a2 Partial-Bug: #1674374 --- ironic/drivers/modules/ucs/helper.py | 6 +++--- ironic/drivers/modules/ucs/management.py | 10 +++++----- ironic/drivers/modules/ucs/power.py | 24 ++++++++++++------------ 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/ironic/drivers/modules/ucs/helper.py b/ironic/drivers/modules/ucs/helper.py index 90c4e47959..4a5d501f60 100644 --- a/ironic/drivers/modules/ucs/helper.py +++ b/ironic/drivers/modules/ucs/helper.py @@ -21,7 +21,7 @@ from oslo_utils import importutils import six from ironic.common import exception -from ironic.common.i18n import _, _LE +from ironic.common.i18n import _ from ironic.drivers.modules import deploy_utils ucs_helper = importutils.try_import('UcsSdk.utils.helper') @@ -114,8 +114,8 @@ class CiscoUcsHelper(object): self.username, self.password) except ucs_error.UcsConnectionError as ucs_exception: - LOG.error(_LE("Cisco client: service unavailable for node " - "%(uuid)s."), {'uuid': self.uuid}) + LOG.error("Cisco client: service unavailable for node " + "%(uuid)s.", {'uuid': self.uuid}) raise exception.UcsConnectionError(error=ucs_exception, node=self.uuid) diff --git a/ironic/drivers/modules/ucs/management.py b/ironic/drivers/modules/ucs/management.py index 8f6a45a27b..17f99b123f 100644 --- a/ironic/drivers/modules/ucs/management.py +++ b/ironic/drivers/modules/ucs/management.py @@ -23,7 +23,7 @@ from oslo_utils import importutils from ironic.common import boot_devices from ironic.common import exception -from ironic.common.i18n import _, _LE +from ironic.common.i18n import _ from ironic.drivers import base from ironic.drivers.modules.ucs import helper as ucs_helper @@ -92,8 +92,8 @@ class UcsManagement(base.ManagementInterface): mgmt_handle = ucs_mgmt.BootDeviceHelper(helper) mgmt_handle.set_boot_device(device, persistent) except ucs_error.UcsOperationError as ucs_exception: - LOG.error(_LE("%(driver)s: client failed to set boot device " - "%(device)s for node %(uuid)s."), + LOG.error("%(driver)s: client failed to set boot device " + "%(device)s for node %(uuid)s.", {'driver': task.node.driver, 'device': device, 'uuid': task.node.uuid}) operation = _('setting boot device') @@ -127,8 +127,8 @@ class UcsManagement(base.ManagementInterface): mgmt_handle = ucs_mgmt.BootDeviceHelper(helper) boot_device = mgmt_handle.get_boot_device() except ucs_error.UcsOperationError as ucs_exception: - LOG.error(_LE("%(driver)s: client failed to get boot device for " - "node %(uuid)s."), + LOG.error("%(driver)s: client failed to get boot device for " + "node %(uuid)s.", {'driver': task.node.driver, 'uuid': task.node.uuid}) operation = _('getting boot device') raise exception.UcsOperationError(operation=operation, diff --git a/ironic/drivers/modules/ucs/power.py b/ironic/drivers/modules/ucs/power.py index 2a18351695..44bf6d104e 100644 --- a/ironic/drivers/modules/ucs/power.py +++ b/ironic/drivers/modules/ucs/power.py @@ -22,7 +22,7 @@ from oslo_service import loopingcall from oslo_utils import importutils from ironic.common import exception -from ironic.common.i18n import _, _LE +from ironic.common.i18n import _ from ironic.common import states from ironic.conductor import task_manager from ironic.conf import CONF @@ -108,8 +108,8 @@ class Power(base.PowerInterface): power_handle = ucs_power.UcsPower(helper) power_status = power_handle.get_power_state() except ucs_error.UcsOperationError as ucs_exception: - LOG.error(_LE("%(driver)s: get_power_state operation failed for " - "node %(uuid)s with error: %(msg)s."), + LOG.error("%(driver)s: get_power_state operation failed for " + "node %(uuid)s with error: %(msg)s.", {'driver': task.node.driver, 'uuid': task.node.uuid, 'msg': ucs_exception}) operation = _('getting power status') @@ -150,8 +150,8 @@ class Power(base.PowerInterface): else: return except ucs_error.UcsOperationError as ucs_exception: - LOG.error(_LE("%(driver)s: set_power_state operation failed for " - "node %(uuid)s with error: %(msg)s."), + LOG.error("%(driver)s: set_power_state operation failed for " + "node %(uuid)s with error: %(msg)s.", {'driver': task.node.driver, 'uuid': task.node.uuid, 'msg': ucs_exception}) operation = _("setting power status") @@ -161,9 +161,9 @@ class Power(base.PowerInterface): state = _wait_for_state_change(pstate, ucs_power_handle) if state != pstate: timeout = CONF.cisco_ucs.action_interval * CONF.cisco_ucs.max_retry - LOG.error(_LE("%(driver)s: driver failed to change node %(uuid)s " - "power state to %(state)s within %(timeout)s " - "seconds."), + LOG.error("%(driver)s: driver failed to change node %(uuid)s " + "power state to %(state)s within %(timeout)s " + "seconds.", {'driver': task.node.driver, 'uuid': task.node.uuid, 'state': pstate, 'timeout': timeout}) raise exception.PowerStateFailure(pstate=pstate) @@ -183,8 +183,8 @@ class Power(base.PowerInterface): ucs_power_handle = ucs_power.UcsPower(helper) ucs_power_handle.reboot() except ucs_error.UcsOperationError as ucs_exception: - LOG.error(_LE("%(driver)s: driver failed to reset node %(uuid)s " - "power state."), + LOG.error("%(driver)s: driver failed to reset node %(uuid)s " + "power state.", {'driver': task.node.driver, 'uuid': task.node.uuid}) operation = _("rebooting") raise exception.UcsOperationError(operation=operation, @@ -194,8 +194,8 @@ class Power(base.PowerInterface): state = _wait_for_state_change(states.POWER_ON, ucs_power_handle) if state != states.POWER_ON: timeout = CONF.cisco_ucs.action_interval * CONF.cisco_ucs.max_retry - LOG.error(_LE("%(driver)s: driver failed to reboot node %(uuid)s " - "within %(timeout)s seconds."), + LOG.error("%(driver)s: driver failed to reboot node %(uuid)s " + "within %(timeout)s seconds.", {'driver': task.node.driver, 'uuid': task.node.uuid, 'timeout': timeout}) raise exception.PowerStateFailure(pstate=states.POWER_ON)