diff options
author | Tristan Cacqueray <tristan.cacqueray@enovance.com> | 2014-01-24 17:40:16 +0100 |
---|---|---|
committer | Tristan Cacqueray <tristan.cacqueray@enovance.com> | 2014-02-12 13:21:26 +0100 |
commit | b182112719ab87942472e44aa3446ea0eb19a289 (patch) | |
tree | 8663d755145df6b64bc6b766866ebdb06639119a /bin | |
parent | 9b73547b7de004fe623e454c425e9deee5d3d0ca (diff) | |
download | python-swiftclient-b182112719ab87942472e44aa3446ea0eb19a289.tar.gz |
Port to python-requests
Currently, httplib implementation does not support SSL certificate
verification. This patch fixes this. Note that ssl compression parameter
and 100-continue thing is still missing from requests, though those are
lower priority.
Requests now takes care of:
* proxy configuration (get_environ_proxies),
* chunked encoding (with data generator),
* bulk uploading (with files dictionary),
* SSL certificate verification (with 'insecure' and 'cacert' parameter).
This patch have been tested with requests 1.1.0 (CentOS 6) and requests
2.2.1 (current version).
Change-Id: Ib5de962f4102d57c71ad85fd81a615362ef175dc
Closes-Bug: #1199783
DocImpact
SecurityImpact
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/swift | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -32,7 +32,7 @@ try: except ImportError: import json -from swiftclient import Connection, HTTPException +from swiftclient import Connection, RequestException from swiftclient import command_helpers from swiftclient.utils import config_true_value, prt_bytes from swiftclient.multithreading import MultiThreadingManager @@ -1388,16 +1388,16 @@ Examples: parser.add_option('--insecure', action="store_true", dest="insecure", default=default_val, - help='Allow swiftclient to access insecure keystone ' - 'server. The keystone\'s certificate will not ' - 'be verified. ' + help='Allow swiftclient to access servers without ' + 'having to verify the SSL certificate. ' 'Defaults to env[SWIFTCLIENT_INSECURE] ' '(set to \'true\' to enable).') parser.add_option('--no-ssl-compression', action='store_false', dest='ssl_compression', default=True, - help='Disable SSL compression when using https. ' - 'This may increase performance.') + help='This option is deprecated and not used anymore. ' + 'SSL compression should be disabled by default ' + 'by the system SSL library') parser.disable_interspersed_args() (options, args) = parse_args(parser, argv[1:], enforce_requires=False) parser.enable_interspersed_args() @@ -1425,7 +1425,7 @@ Examples: parser.usage = globals()['st_%s_help' % args[0]] try: globals()['st_%s' % args[0]](parser, argv[1:], thread_manager) - except (ClientException, HTTPException, socket.error) as err: + except (ClientException, RequestException, socket.error) as err: thread_manager.error(str(err)) had_error = thread_manager.error_count |