Merge branch '2015.8' into '2016.3'

Conflicts:
  - salt/utils/http.py
This commit is contained in:
rallytime 2016-11-04 13:37:06 -06:00
commit 3483a445f2
2 changed files with 24 additions and 40 deletions

View file

@ -243,6 +243,7 @@ class GitProvider(object):
if hasattr(self, 'mountpoint'):
self.mountpoint = salt.utils.url.strip_proto(self.mountpoint)
self.mountpoint = self.mountpoint.strip('/')
else:
# For providers which do not use a mountpoint, assume the
# filesystem is mounted at the root of the fileserver.

View file

@ -463,46 +463,29 @@ def query(url,
supports_max_body_size = 'max_body_size' in client_argspec.args
try:
if supports_max_body_size:
result = HTTPClient(max_body_size=max_body).fetch(
url_full,
method=method,
headers=header_dict,
auth_username=username,
auth_password=password,
body=data,
validate_cert=verify_ssl,
allow_nonstandard_methods=True,
streaming_callback=streaming_callback,
header_callback=header_callback,
request_timeout=timeout,
proxy_host=proxy_host,
proxy_port=proxy_port,
proxy_username=proxy_username,
proxy_password=proxy_password,
raise_error=raise_error,
**req_kwargs
)
else:
result = HTTPClient().fetch(
url_full,
method=method,
headers=header_dict,
auth_username=username,
auth_password=password,
body=data,
validate_cert=verify_ssl,
allow_nonstandard_methods=True,
streaming_callback=streaming_callback,
header_callback=header_callback,
request_timeout=timeout,
proxy_host=proxy_host,
proxy_port=proxy_port,
proxy_username=proxy_username,
proxy_password=proxy_password,
raise_error=raise_error,
**req_kwargs
)
download_client = HTTPClient(max_body_size=max_body) \
if supports_max_body_size \
else HTTPClient()
result = download_client.fetch(
url_full,
method=method,
headers=header_dict,
auth_username=username,
auth_password=password,
body=data,
validate_cert=verify_ssl,
allow_nonstandard_methods=True,
streaming_callback=streaming_callback,
header_callback=header_callback,
request_timeout=timeout,
proxy_host=proxy_host,
proxy_port=proxy_port,
proxy_username=proxy_username,
proxy_password=proxy_password,
raise_error=raise_error,
decompress_response=False,
**req_kwargs
)
except tornado.httpclient.HTTPError as exc:
ret['status'] = exc.code
ret['error'] = str(exc)