Skip to content
This repository has been archived by the owner on Jan 20, 2020. It is now read-only.

Commit

Permalink
Merge pull request #34 from docker/staging
Browse files Browse the repository at this point in the history
1.0.11
  • Loading branch information
Feng Honglin authored May 10, 2017
2 parents fa9a969 + 2176a7e commit 6d5813e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion dockercloud/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from dockercloud.api.events import Events
from dockercloud.api.nodeaz import AZ

__version__ = '1.0.10'
__version__ = '1.0.11'

dockercloud_auth = os.environ.get('DOCKERCLOUD_AUTH')
basic_auth = auth.load_from_file("~/.docker/config.json")
Expand Down
9 changes: 3 additions & 6 deletions dockercloud/api/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import time

from requests import Request, Session
from requests import utils
from urllib.parse import urljoin

import dockercloud
Expand Down Expand Up @@ -55,18 +54,16 @@ def send_request(method, path, inject_header=True, **kwargs):
# construct request
s = get_session()
request = Request(method, url, headers=headers, **kwargs)
# get environment proxies
env_proxies = utils.get_environ_proxies(url) or {}
kw_args = {'proxies': env_proxies}

# make the request
req = s.prepare_request(request)
proxy = s.rebuild_proxies(req, None)
logger.info("Prepared Request: %s, %s, %s, %s" % (req.method, req.url, req.headers, kwargs))

if dockercloud.api_timeout:
response = s.send(req, timeout=dockercloud.api_timeout, **kw_args)
response = s.send(req, timeout=dockercloud.api_timeout, proxies=proxy)
else:
response = s.send(req, **kw_args)
response = s.send(req, proxies=proxy)

status_code = getattr(response, 'status_code', None)
logger.info("Response: Status %s, %s, %s" % (str(status_code), response.headers, response.text))
Expand Down
2 changes: 1 addition & 1 deletion dockercloud/api/stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ def redeploy(self, reuse_volumes=True):
def export(self):
if not self.resource_uri:
raise ApiError("You must save the object before performing this operation")
url = "/".join([self.resource_uri, "export"])
url = "/".join([self.resource_uri.rstrip("/"), "export"])
return send_request("GET", url, inject_header=False)

0 comments on commit 6d5813e

Please sign in to comment.