Skip to content

Commit

Permalink
Adição de protocolo de configuração para SL
Browse files Browse the repository at this point in the history
  • Loading branch information
Felipe Biaggi Carvalho committed Dec 28, 2021
1 parent 6b9e2e7 commit b1efc0f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cpqdtrd/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def __init__(
retry_period: float = 2,
sl_host=None,
sl_port=None,
sl_protocol="https",
sl_token=None,
sl_username=None,
sl_password=None,
Expand All @@ -42,6 +43,7 @@ def __init__(
self._url = url
self._sl_host = sl_host
self._sl_port = sl_port
self._sl_protocol = sl_protocol
self._sl_username = sl_username
self._sl_password = sl_password

Expand Down Expand Up @@ -249,9 +251,10 @@ def create_token(self):
self._sl_port,
self._sl_username,
self._sl_password,
self._sl_protocol
):
request = requests.post(
url="http://{}:{}/auth/token".format(self._sl_host, self._sl_port),
url="{}://{}:{}/auth/token".format(self._sl_protocol, self._sl_host, self._sl_port),
auth=(self._sl_username, self._sl_password),
timeout=10,
)
Expand Down
2 changes: 2 additions & 0 deletions cpqdtrd/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def __init__(
key_path=None,
sl_host=None,
sl_port=None,
sl_protocol="https",
sl_token=None,
sl_username=None,
sl_password=None,
Expand All @@ -52,6 +53,7 @@ def __init__(
password=password,
sl_host=sl_host,
sl_port=sl_port,
sl_protocol=sl_protocol,
sl_token=sl_token,
sl_username=sl_username,
sl_password=sl_password,
Expand Down

0 comments on commit b1efc0f

Please sign in to comment.