diff options
author | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2013-03-18 09:10:50 -0400 |
---|---|---|
committer | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2013-03-18 09:10:50 -0400 |
commit | 931705be94167075267c928b21a96bf7e73ed039 (patch) | |
tree | 53e5125845efea7bfc2275cc9055357b5736b324 /src/lib/Bcfg2/Proxy.py | |
parent | a20e35a2b3453cf959020bb40e65b9f63967b8a9 (diff) | |
download | bcfg2-931705be94167075267c928b21a96bf7e73ed039.tar.gz bcfg2-931705be94167075267c928b21a96bf7e73ed039.tar.bz2 bcfg2-931705be94167075267c928b21a96bf7e73ed039.zip |
allow communication passwords with URL special chars (@, /, etc.) in them
Diffstat (limited to 'src/lib/Bcfg2/Proxy.py')
-rw-r--r-- | src/lib/Bcfg2/Proxy.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/lib/Bcfg2/Proxy.py b/src/lib/Bcfg2/Proxy.py index 3b406c78e..224028b6a 100644 --- a/src/lib/Bcfg2/Proxy.py +++ b/src/lib/Bcfg2/Proxy.py @@ -1,6 +1,6 @@ -import logging import re import socket +import logging # The ssl module is provided by either Python 2.6 or a separate ssl # package that works on older versions of Python (see @@ -20,7 +20,7 @@ import sys import time # Compatibility imports -from Bcfg2.Compat import httplib, xmlrpclib, urlparse +from Bcfg2.Compat import httplib, xmlrpclib, urlparse, quote_plus version = sys.version_info[:2] has_py26 = version >= (2, 6) @@ -349,7 +349,8 @@ def ComponentProxy(url, user=None, password=None, key=None, cert=None, ca=None, if user and password: method, path = urlparse(url)[:2] - newurl = "%s://%s:%s@%s" % (method, user, password, path) + newurl = "%s://%s:%s@%s" % (method, quote_plus(user, ''), + quote_plus(password, ''), path) else: newurl = url ssl_trans = XMLRPCTransport(key, cert, ca, |