swauth bins should default to the right port if no port is given

Bug #702107 reported by Chuck Thier
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Object Storage (swift)
Fix Released
Low
gholt

Bug Description

If you don't specify the port for the auth url with the auth bins, it dies with a traceback.

If a port isn't specified, it should be port 80 for http, and 443 for https

Traceback:

~/swift# swauth-add-user -A http://AUTH_SERVER/auth/ -K swauthkey -a acct user key
Traceback (most recent call last):
  File "/usr/local/bin/swauth-add-user", line 5, in <module>
    pkg_resources.run_script('swift==1.1.0', 'swauth-add-user')
  File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 461, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 1194, in run_script
    execfile(script_filename, namespace, namespace)
  File "/usr/local/lib/python2.6/dist-packages/swift-1.1.0-py2.6.egg/EGG-INFO/scripts/swauth-add-user", line 75, in <module>
    ssl=(parsed.scheme == 'https'))
  File "/usr/local/lib/python2.6/dist-packages/swift-1.1.0-py2.6.egg/swift/common/bufferedhttp.py", line 156, in http_connect_raw
    conn = BufferedHTTPConnection('%s:%s' % (ipaddr, port))
  File "/usr/lib/python2.6/httplib.py", line 657, in __init__
    self._set_hostport(host, port)
  File "/usr/lib/python2.6/httplib.py", line 682, in _set_hostport
    raise InvalidURL("nonnumeric port: '%s'" % host[i+1:])
httplib.InvalidURL: nonnumeric port: 'None'

Related branches

Chuck Thier (cthier)
Changed in swift:
importance: Undecided → Low
assignee: nobody → gholt (gholt)
status: New → Triaged
Revision history for this message
FUJITA Tomonori (fujita-tomonori-deactivatedaccount) wrote :

Might be better to modify http_connect() and http_connect_raw(). I'm not sure.

Changed in swift:
status: Triaged → Fix Committed
Chuck Thier (cthier)
Changed in swift:
milestone: none → 1.2.0
Chuck Thier (cthier)
Changed in swift:
status: Fix Committed → 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.