From 0243b7be7c50ee606d8df220435b2453c390f971 Mon Sep 17 00:00:00 2001 From: Daniel Hokka Zakrisson Date: Tue, 29 Jan 2013 18:57:02 +0100 Subject: [PATCH] Fix get_url to work on Python 2.4 --- library/get_url | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/library/get_url b/library/get_url index 2db31c6d7c..a28656291e 100644 --- a/library/get_url +++ b/library/get_url @@ -101,11 +101,13 @@ def url_do_get(module, url, dest): info = dict(url=url, dest=dest) r = None parsed = urlparse.urlparse(url) - if '@' in parsed.netloc: - credentials = parsed.netloc.split('@')[0] + if '@' in parsed[1]: + credentials, netloc = parsed[1].split('@', 1) if ':' in credentials: - username, password = credentials.split(':') - netloc = parsed.netloc.split('@')[1] + username, password = credentials.split(':', 1) + else: + username = credentials + password = '' parsed = list(parsed) parsed[1] = netloc