AttributeError: 'TranslatorFactory' object has no attribute 'contextual_form'

Bug #1525992 reported by Saad Zaher
18
This bug affects 4 people
Affects Status Importance Assigned to Milestone
oslo.i18n
Fix Released
Undecided
ChangBo Guo(gcb)
oslo.service
Fix Released
Undecided
ChangBo Guo(gcb)

Bug Description

I was testing oslo.service

__author__ = 'saad'
from oslo_service import service
from oslo_config import cfg

CONF = cfg.CONF

class SaadService(service.ServiceBase):

    def start(self):
        pass

    def stop(self):
        pass

    def wait(self):
        pass

    def reset(self):
        pass

launcher = service.launch(CONF, SaadService, workers=1)

and I got the following error:

Traceback (most recent call last):
  File "testsrv.py", line 4, in <module>
    from oslo_service import service
  File "/home/saad/Desktop/dev/projects/kvmha/local/lib/python2.7/site-packages/oslo_service/service.py", line 37, in <module>
    from oslo_service import eventlet_backdoor
  File "/home/saad/Desktop/dev/projects/kvmha/local/lib/python2.7/site-packages/oslo_service/eventlet_backdoor.py", line 31, in <module>
    from oslo_service._i18n import _LI
  File "/home/saad/Desktop/dev/projects/kvmha/local/lib/python2.7/site-packages/oslo_service/_i18n.py", line 28, in <module>
    _C = _translators.contextual_form
AttributeError: 'TranslatorFactory' object has no attribute 'contextual_form'

Revision history for this message
ChangBo Guo(gcb) (glongwave) wrote :

The root cause is we add two new method in oslo.i18n in https://github.com/openstack/oslo.i18n/commit/9e3132bc2f06da87b5c78257a267c5431f433e74 . need bump oslo.i18n version to fix this issue.

Changed in oslo.service:
status: New → Confirmed
assignee: nobody → ChangBo Guo(gcb) (glongwave)
Revision history for this message
ChangBo Guo(gcb) (glongwave) wrote :
Changed in oslo.service:
status: Confirmed → In Progress
Revision history for this message
Saad Zaher (szaher) wrote :

Thanks ChangBo

Revision history for this message
ChangBo Guo(gcb) (glongwave) wrote :

Add declare of contextual/plural translation requires oslo.i18n >=2.1.0 in https://review.openstack.org/#/c/260872/

Changed in oslo.i18n:
status: New → Incomplete
status: Incomplete → In Progress
assignee: nobody → ChangBo Guo(gcb) (glongwave)
Revision history for this message
ChangBo Guo(gcb) (glongwave) wrote :

 we update the g-r , so fix this issue.

Changed in oslo.i18n:
status: In Progress → Fix Released
Changed in oslo.service:
status: In Progress → Fix Released
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.