Skip to content

Commit

Permalink
Ensure swift auth URL includes trailing slash
Browse files Browse the repository at this point in the history
Fixes bug 979745

Image objects in swift were previously leaked post-deletion
due to a silent auth failure caused by the absense of the
trailing forward slash on the swift connection auth URL.

Change-Id: I9c73a2f75a6466e73801ababdd81db77701ccb20
  • Loading branch information
Eoghan Glynn committed Apr 12, 2012
1 parent f8766a8 commit fa82103
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions glance/store/swift.py
Expand Up @@ -303,12 +303,14 @@ def _make_swift_connection(self, auth_url, user, key):
"""
snet = self.snet
auth_version = self.auth_version
full_auth_url = (auth_url if not auth_url or auth_url.endswith('/')
else auth_url + '/')
logger.debug(_("Creating Swift connection with "
"(auth_address=%(auth_url)s, user=%(user)s, "
"(auth_address=%(full_auth_url)s, user=%(user)s, "
"snet=%(snet)s, auth_version=%(auth_version)s)") %
locals())
return swift_client.Connection(
authurl=auth_url, user=user, key=key, snet=snet,
authurl=full_auth_url, user=user, key=key, snet=snet,
auth_version=auth_version)

def _option_get(self, param):
Expand Down

0 comments on commit fa82103

Please sign in to comment.