If a common message is not being used, they should each be treated separately with respect to choosing a marker function

Bug #1600788 reported by jingtao liang
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Fix Released
Low
weiweigu
Magnum
Fix Released
Undecided
weiweigu
OpenStack Dashboard (Horizon)
Won't Fix
Undecided
Unassigned
Solum
New
Undecided
YaoZheng_ZTE
glance_store
Fix Released
Undecided
jingtao liang
neutron
Fix Released
Undecided
Mitya Eremeev
oslo.log
Fix Released
Undecided
jingtao liang

Bug Description

Follow the http://docs.openstack.org/developer/oslo.i18n/guidelines.html

For example, do not do this:

# WRONG
LOG.exception(_('There was an error.'))
raise LocalExceptionClass(_('An error occured.'))
Instead, use this style:

# RIGHT
LOG.exception(_LE('There was an error.'))
raise LocalExceptionClass(_('An error occured.'))

And oslo.log has the problem,we shuld correct it.

Changed in oslo.log:
assignee: nobody → jingtao liang (liang-jingtao)
Changed in glance-store:
assignee: nobody → jingtao liang (liang-jingtao)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to glance_store (master)

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

Changed in glance-store:
status: New → In Progress
Changed in oslo.log:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to oslo.log (master)

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to oslo.log (master)

Reviewed: https://review.openstack.org/340330
Committed: https://git.openstack.org/cgit/openstack/oslo.log/commit/?id=c426a42ccd9cab3a7c657684b025475b78f8c330
Submitter: Jenkins
Branch: master

commit c426a42ccd9cab3a7c657684b025475b78f8c330
Author: liangjingtao <email address hidden>
Date: Mon Jul 11 20:12:36 2016 +0800

    Replace "LOG.exception(_" with "LOG.exception(_LE"

    Follow http://docs.openstack.org/developer/oslo.i18n/guidelines.html:
    If a common message is not being used, they should each betreated
    separately with respect to choosing a marker function.So this patch
    is to fix it.

    Change-Id: I07945d82320d9faf6dc452d49722af610330b441
    Closes-Bug: #1600788

Changed in oslo.log:
status: In Progress → Fix Released
weiweigu (gu-weiwei)
Changed in oslo.i18n:
assignee: nobody → weiweigu (gu-weiwei)
Changed in ceilometer:
assignee: nobody → weiweigu (gu-weiwei)
weiweigu (gu-weiwei)
Changed in oslo.i18n:
status: New → Invalid
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ceilometer (master)

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

Changed in ceilometer:
status: New → In Progress
weiweigu (gu-weiwei)
Changed in cinder:
assignee: nobody → weiweigu (gu-weiwei)
Changed in solum:
assignee: nobody → YaoZheng_ZTE (zheng-yao1)
weiweigu (gu-weiwei)
Changed in cinder:
status: New → Invalid
weiweigu (gu-weiwei)
Changed in glance:
assignee: nobody → weiweigu (gu-weiwei)
Changed in horizon:
assignee: nobody → weiweigu (gu-weiwei)
Changed in keystone:
assignee: nobody → weiweigu (gu-weiwei)
weiweigu (gu-weiwei)
no longer affects: cinder
no longer affects: oslo.i18n
Changed in neutron:
assignee: nobody → weiweigu (gu-weiwei)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to glance (master)

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

Changed in glance:
status: New → In Progress
Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/oslo.log 3.12.0

This issue was fixed in the openstack/oslo.log 3.12.0 release.

Revision history for this message
Brandon Logan (brandon-logan) wrote :

for neutron, using the following grep does not return any violations:
$ grep -PRn --exclude-dir=.tox --exclude-dir=.testrepository 'LOG.exception\(_\(' .

Howver, there are some that create the message before doing the LOG.exception call and looks like some of those do the _(.

$ grep -PRn --exclude-dir=.tox --exclude-dir=.testrepository 'LOG.exception\([a-z]' .
./neutron/agent/linux/ip_lib.py:993: LOG.exception(msg, {'addr': address,
./neutron/agent/linux/iptables_manager.py:417: LOG.exception(msg)
./neutron/agent/l3/router_info.py:258: LOG.exception(msg)
./neutron/agent/l3/router_info.py:336: LOG.exception(msg)
./neutron/agent/l3/namespaces.py:83: LOG.exception(msg, self.name)
./neutron/agent/l3/dvr_local_router.py:319: LOG.exception(exc)
./neutron/agent/l3/agent.py:461: LOG.exception(msg, update.id)
./neutron/agent/l3/agent.py:484: LOG.exception(e.msg)
./neutron/agent/l3/agent.py:492: LOG.exception(msg, update.id)
./neutron/policy.py:207: LOG.exception(err_reason)

Changed in neutron:
status: New → Triaged
tags: added: low-hanging-fruit
Changed in glance:
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to glance (master)

Reviewed: https://review.openstack.org/340894
Committed: https://git.openstack.org/cgit/openstack/glance/commit/?id=14ccf5986e0423a2835c2c5be8c9a1246f0db2f3
Submitter: Jenkins
Branch: master

commit 14ccf5986e0423a2835c2c5be8c9a1246f0db2f3
Author: weiweigu <email address hidden>
Date: Tue Jul 12 21:12:04 2016 +0800

    Replace "LOG.warn(_" with "LOG.(_LW"

    Follow http://docs.openstack.org/developer/oslo.i18n/guidelines.html:
    If a common message is not being used, they should each betreated
    separately with respect to choosing a marker function.So this patch
    is to fix it.

    Change-Id: Id122aa6395c534bee5287264c8951181f08d6f19
    Closes-Bug: #1600788

Changed in glance:
status: In Progress → Fix Released
weiweigu (gu-weiwei)
no longer affects: keystone
weiweigu (gu-weiwei)
Changed in congress:
assignee: nobody → weiweigu (gu-weiwei)
Changed in magnum:
assignee: nobody → weiweigu (gu-weiwei)
weiweigu (gu-weiwei)
no longer affects: congress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to magnum (master)

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

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

Reviewed: https://review.openstack.org/342616
Committed: https://git.openstack.org/cgit/openstack/magnum/commit/?id=ec729d6cc686f0af5c79cfd24cac99fc3de215fd
Submitter: Jenkins
Branch: master

commit ec729d6cc686f0af5c79cfd24cac99fc3de215fd
Author: weiweigu <email address hidden>
Date: Fri Jul 15 15:26:02 2016 +0800

    Replace "LOG.info(_" with "LOG.info(_LI"

    Follow http://docs.openstack.org/developer/oslo.i18n/guidelines.html:
    If a common message is not being used, they should each betreated
    separately with respect to choosing a marker function.So this patch
    is to fix it.

    Change-Id: If7a74ce983ad0c7f4cab057cadd7d20ef3067fcd
    Closes-Bug: #1600788

Changed in magnum:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on glance_store (master)

Change abandoned by Nikhil Komawar (<email address hidden>) on branch: master
Review: https://review.openstack.org/340329
Reason: as per agreement

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/magnum 3.0.0

This issue was fixed in the openstack/magnum 3.0.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/glance 13.0.0.0b3

This issue was fixed in the openstack/glance 13.0.0.0b3 development milestone.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on ceilometer (master)

Change abandoned by gordon chung (<email address hidden>) on branch: master
Review: https://review.openstack.org/340693
Reason: stale

gordon chung (chungg)
no longer affects: ceilometer
Ian Cordasco (icordasc)
Changed in glance-store:
status: In Progress → Fix Released
Changed in horizon:
status: New → Confirmed
importance: Undecided → Low
milestone: none → next
Revision history for this message
Akihiro Motoki (amotoki) wrote :

Horizon does not use oslo.log for logging. Horizon depends on Django and logging is also handled via django and python standard logging. In the horizon messaging policy, logging messages are not translated and other user visible message are translated via django translation marker. (Note that _ has a different meaning in horizon.)

There were similar situation in horizon, but it was clean up as bug 1406333.

Marking this as Won't Fix in horizon. In horizon there is nothing to do more.

Changed in horizon:
status: Confirmed → Won't Fix
assignee: weiweigu (gu-weiwei) → nobody
milestone: next → none
importance: Low → Undecided
Revision history for this message
Mitya Eremeev (mitos) wrote :

At the moment documentation is controversial.
I submitted a bug regarding the issue:
https://bugs.launchpad.net/oslo.i18n/+bug/1910526

Mitya Eremeev (mitos)
Changed in neutron:
assignee: weiweigu (gu-weiwei) → Mitya Eremeev (mitos)
status: Triaged → In Progress
Mitya Eremeev (mitos)
Changed in neutron:
status: In Progress → Fix Committed
Revision history for this message
Akihiro Motoki (amotoki) wrote :

Mitya, could you add a URL you submitted to neutron? "Fix Committed" means it has been fixed in the master branch, but I am not sure what you mean.

Revision history for this message
Akihiro Motoki (amotoki) wrote :
Changed in neutron:
status: Fix Committed → Fix Released
Revision history for this message
Mitya Eremeev (mitos) wrote :

Hello, Akihiro,

you're right.

Revision history for this message
Mitya Eremeev (mitos) wrote :
tags: added: neutron-proactive-backport-potential
tags: removed: neutron-proactive-backport-potential
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.