← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1265730] [NEW] glance client http.py string format error

 

Public bug reported:

Issue:
Found this coding defect when we ran into "TypeError: not all arguments converted during string formatting"

https://github.com/openstack/python-
glanceclient/blob/master/glanceclient/common/http.py#L438

                msg = 'Unable to load CA from "%s"' % (self.cacert, e)
 
proposed fix is 
msg = 'Unable to load CA from "%s" due to %s' % (self.cacert, e)

or use 
msg = 'Unable to load CA from "{0}" due to {1}'.format(self.cacert, e)

or if the original author intend to use tuple to format the msg
msg =  'Unable to load CA from "%s"' % ((self.cacert, e),)

I prefer the 2nd one, .format one.

** Affects: glance
     Importance: Undecided
         Status: New

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

Title:
  glance client http.py string format error

Status in OpenStack Image Registry and Delivery Service (Glance):
  New

Bug description:
  Issue:
  Found this coding defect when we ran into "TypeError: not all arguments converted during string formatting"

  https://github.com/openstack/python-
  glanceclient/blob/master/glanceclient/common/http.py#L438

                  msg = 'Unable to load CA from "%s"' % (self.cacert, e)
   
  proposed fix is 
  msg = 'Unable to load CA from "%s" due to %s' % (self.cacert, e)

  or use 
  msg = 'Unable to load CA from "{0}" due to {1}'.format(self.cacert, e)

  or if the original author intend to use tuple to format the msg
  msg =  'Unable to load CA from "%s"' % ((self.cacert, e),)

  I prefer the 2nd one, .format one.

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


Follow ups

References