From 2d8dfd2d4257fe7d89205f7dc593a38f1b9bf89e Mon Sep 17 00:00:00 2001 From: Rick Harris Date: Tue, 12 Oct 2010 14:47:38 -0500 Subject: [PATCH] Workaround for bug in Python 2.6.1 urlparse library --- glance/teller/backends/swift.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/glance/teller/backends/swift.py b/glance/teller/backends/swift.py index 1ec29e95ed..1e970aa970 100644 --- a/glance/teller/backends/swift.py +++ b/glance/teller/backends/swift.py @@ -70,7 +70,13 @@ class SwiftBackend(Backend): netloc = parsed_uri.netloc try: - creds, netloc = netloc.split('@') + try: + creds, netloc = netloc.split('@') + except ValueError: + # Python 2.6.1 compat + # see lp659445 and Python issue7904 + creds, path = path.split('@') + user, api_key = creds.split(':') path_parts = path.split('/') file = path_parts.pop()