Public bug reported:

I was trying keystone integration with Tivoli directoy server, in the course of 
playing around several times I got an error message.
The file was 
/usr/lib/python2.6/site-packages/keystone/openstack/common/gettextutils.py
Instead of raising exception, I modified the __str__ method to instead call 
translate. And I started getting proper error logs.
I am not a python expert and may be __str__ is not suppose to return double 
byte chars, I wish I could provide the exact setting that gives this error, but 
I am not getting it anymore, even after I have reverted my change.

 def __str__(self):
        # NOTE(luisg): Logging in python 2.6 tries to str() log records,
        # and it expects specifically a UnicodeError in order to proceed.
        msg = _('Message objects do not support str() because they may '
                'contain non-ascii characters. '
                'Please use unicode() or translate() instead.')
        #mahesh commented out the code below
        return translate(self)
        #raise UnicodeError(msg)

** Affects: keystone
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to Keystone.
https://bugs.launchpad.net/bugs/1318487

Title:
  Got error Message objects do not support str() because they may..

Status in OpenStack Identity (Keystone):
  New

Bug description:
  I was trying keystone integration with Tivoli directoy server, in the course 
of playing around several times I got an error message.
  The file was 
/usr/lib/python2.6/site-packages/keystone/openstack/common/gettextutils.py
  Instead of raising exception, I modified the __str__ method to instead call 
translate. And I started getting proper error logs.
  I am not a python expert and may be __str__ is not suppose to return double 
byte chars, I wish I could provide the exact setting that gives this error, but 
I am not getting it anymore, even after I have reverted my change.

   def __str__(self):
          # NOTE(luisg): Logging in python 2.6 tries to str() log records,
          # and it expects specifically a UnicodeError in order to proceed.
          msg = _('Message objects do not support str() because they may '
                  'contain non-ascii characters. '
                  'Please use unicode() or translate() instead.')
          #mahesh commented out the code below
          return translate(self)
          #raise UnicodeError(msg)

To manage notifications about this bug go to:
https://bugs.launchpad.net/keystone/+bug/1318487/+subscriptions

-- 
Mailing list: https://launchpad.net/~yahoo-eng-team
Post to     : yahoo-eng-team@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yahoo-eng-team
More help   : https://help.launchpad.net/ListHelp

Reply via email to