Skip to content

Commit

Permalink
auto release for 0.7.0
Browse files Browse the repository at this point in the history
auto incr version
  • Loading branch information
ucloud-bot authored Nov 21, 2019
1 parent 8012682 commit a23bc4f
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 11 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
## 0.7.0 (2019-11-21)

FEATURES:

- Add ssl options of client (#37)

ENHANCEMENTS:

- Add testing report use ucloud test framework (#38)

## 0.6.2 (2019-10-25)

ENHANCEMENTS:
Expand Down
21 changes: 16 additions & 5 deletions ucloud/core/client/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@

from ucloud import version
from ucloud.core.client._cfg import Config
from ucloud.core.transport import Transport, RequestsTransport, Request, SSLOption
from ucloud.core.transport import (
Transport,
RequestsTransport,
Request,
SSLOption,
)
from ucloud.core.typesystem import encoder
from ucloud.core.utils import log
from ucloud.core.utils.middleware import Middleware
Expand Down Expand Up @@ -80,7 +85,7 @@ def logged_response_handler(self, resp):

@staticmethod
def _parse_dict_config(
config: dict
config: dict,
) -> typing.Tuple[Config, auth.Credential]:
return Config.from_dict(config), auth.Credential.from_dict(config)

Expand All @@ -94,9 +99,15 @@ def _send(self, action: str, args: dict, **options) -> dict:
timeout = options.get("timeout") or self.config.timeout

resp = self.transport.send(
req, ssl_option=SSLOption(self.config.ssl_verify, self.config.ssl_cacert,
self.config.ssl_cert, self.config.ssl_key),
timeout=timeout, max_retries=max_retries
req,
ssl_option=SSLOption(
self.config.ssl_verify,
self.config.ssl_cacert,
self.config.ssl_cert,
self.config.ssl_key,
),
timeout=timeout,
max_retries=max_retries,
).json()

for handler in self.middleware.response_handlers:
Expand Down
8 changes: 4 additions & 4 deletions ucloud/core/transport/_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def _send(self, req: Request, **options: typing.Any) -> requests.Response:
session.mount("http://", adapter=adapter)
session.mount("https://", adapter=adapter)

ssl_option = options.get('ssl_option')
ssl_option = options.get("ssl_option")
kwargs = self._build_ssl_option(ssl_option) if ssl_option else {}

req.request_time = time.time()
Expand All @@ -88,14 +88,14 @@ def _send(self, req: Request, **options: typing.Any) -> requests.Response:

@staticmethod
def _build_ssl_option(ssl_option):
kwargs = {'verify': ssl_option.ssl_verify and ssl_option.ssl_cacert}
kwargs = {"verify": ssl_option.ssl_verify and ssl_option.ssl_cacert}
if not ssl_option.ssl_cert:
return kwargs

if ssl_option.ssl_key:
kwargs['cert'] = (ssl_option.ssl_cert, ssl_option.ssl_key)
kwargs["cert"] = (ssl_option.ssl_cert, ssl_option.ssl_key)
else:
kwargs['cert'] = ssl_option.ssl_cert
kwargs["cert"] = ssl_option.ssl_cert
return kwargs

def _load_adapter(
Expand Down
2 changes: 1 addition & 1 deletion ucloud/core/transport/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def __init__(
ssl_verify: bool = True,
ssl_cacert: str = None,
ssl_cert: str = None,
ssl_key: str = None
ssl_key: str = None,
):
self.ssl_verify = ssl_verify
self.ssl_cacert = ssl_cacert
Expand Down
2 changes: 1 addition & 1 deletion ucloud/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version = "0.6.2"
version = "0.7.0"

0 comments on commit a23bc4f

Please sign in to comment.