LOG.warn() should support translation

Bug #1235088 reported by Kui Shi
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Sergio Cazzolato

Bug Description

$ grep 'LOG.warn([^_]' * -r

$ grep 'LOG.warn([^_]' * -r
nova/virt/xenapi/vm_utils.py: LOG.warn(msg % e)
nova/virt/libvirt/driver.py: LOG.warn(msg)
nova/virt/libvirt/volume.py: LOG.warn(msg)
nova/virt/libvirt/volume.py: LOG.warn(msg)
nova/virt/libvirt/volume.py: LOG.warn(msg)
nova/virt/libvirt/volume.py: LOG.warn(msg)
nova/tests/scheduler/test_host_manager.py: host_manager.LOG.warn("No service for compute ID 5")
nova/tests/image/fake.py: LOG.warn('Unable to find image id %s. Have images: %s',
nova/db/sqlalchemy/api.py: LOG.warn(msg)
nova/db/sqlalchemy/api.py: LOG.warn(msg)
nova/db/sqlalchemy/api.py: LOG.warn(msg)
nova/db/sqlalchemy/api.py: LOG.warn(msg)
nova/db/sqlalchemy/api.py: LOG.warn(msg)
nova/db/sqlalchemy/api.py: LOG.warn(msg)
nova/db/sqlalchemy/api.py: LOG.warn(msg)
nova/db/sqlalchemy/api.py: LOG.warn(msg)
nova/db/sqlalchemy/migrate_repo/versions/186_new_bdm_format.py: LOG.warn("Got an unexpected block device %s"
nova/openstack/common/db/sqlalchemy/session.py: LOG.warn(msg % remaining)
nova/openstack/common/rpc/impl_zmq.py: LOG.warn(emsg)
nova/compute/api.py: LOG.warn(msg)
nova/compute/api.py: LOG.warn(msg)
nova/compute/api.py: LOG.warn(msg)
nova/compute/manager.py: LOG.warn(err_str % exc, instance=instance)
nova/compute/manager.py: LOG.warn(e, instance=instance)
nova/network/linux_net.py: LOG.warn(msg % {'num': num_rules, 'float': floating_ip})
nova/network/manager.py: LOG.warn(oversize_msg)
nova/api/openstack/compute/plugins/v3/quota_sets.py: LOG.warn(msg)
nova/api/openstack/compute/contrib/quotas.py: LOG.warn(msg)
nova/api/metadata/vendordata_json.py: LOG.warn(logprefix + _("file does not exist"))
nova/api/metadata/vendordata_json.py: LOG.warn(logprefix + _("Unexpected IOError when reading"))
nova/api/metadata/vendordata_json.py: LOG.warn(logprefix + _("failed to load json"))

They shoud make use of "_" defined in nova/openstack/common/gettextutils.py, like this:

  LOG.warn(_("parent device '%s' not found"), dev)

Tags: i18n
Changed in nova:
status: New → Confirmed
importance: Undecided → Low
tags: added: i18n
Changed in nova:
assignee: nobody → Sergio Cazzolato (sergio-j-cazzolato)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/59828

Changed in nova:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/59828
Committed: http://github.com/openstack/nova/commit/ff56055a081a622e90b393b7f40dbe6b482abf65
Submitter: Jenkins
Branch: master

commit ff56055a081a622e90b393b7f40dbe6b482abf65
Author: Sergio Cazzolato <email address hidden>
Date: Fri Nov 29 23:15:15 2013 -0500

    LOG.warn() and LOG.error() should support translation

    Based on a search done in nova code,
    some logs have to be changed in order to support translation

    Change-Id: I371b714d004bcd0091ae569d4b82ae8d19fba708
    Closes-Bug: #1235088

Changed in nova:
status: In Progress → Fix Committed
Changed in nova:
milestone: none → icehouse-2
Thierry Carrez (ttx)
Changed in nova:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: icehouse-2 → 2014.1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.