Skip to content

Commit 7e7e6f1

Browse files
author
tradel
committed
use banyan.conf if environment variables are not set
1 parent bad4852 commit 7e7e6f1

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# PyBanyan Change History
22

3+
## 0.21.0
4+
* use `banyan.conf` if environment variables `BANYAN_REFRESH_TOKEN` and `BANYAN_API_URL` are not set
5+
36
## 0.20.0
47
* send partial API results in progress callbacks
58

banyan/api/__init__.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from pathlib import Path
1010
from typing import Dict, Any, List, Union, Callable
1111

12+
import urllib3
1213
import requests
1314
from cement import init_defaults
1415
from requests.auth import AuthBase
@@ -153,9 +154,12 @@ def _request(self, method: str, url: str, params: Dict[str, Any] = None, data: A
153154
url = self._api_url + url
154155
if self._insecure_tls and not verify:
155156
verify = False
157+
urllib3.disable_warnings()
158+
else:
159+
urllib3.warnings.resetwarnings()
160+
156161
response = self._http.request(method, url, params, data, headers, cookies, files, auth or self._http.auth,
157162
timeout, allow_redirects, proxies, hooks, stream, verify, cert, json)
158-
# logging.debug(response.content)
159163
if response.status_code >= 400:
160164
try:
161165
content = response.json()
@@ -374,4 +378,3 @@ def audit(self) -> AuditAPI:
374378
refresh_token=os.getenv('BANYAN_REFRESH_TOKEN'), debug=True)
375379
print(c.get_access_token())
376380
print(c.services.list())
377-

banyan/core/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
from cement.utils.version import get_version as cement_get_version
33

4-
VERSION = (0, 20, 0, 'final', 1)
4+
VERSION = (0, 21, 0, 'final', 1)
55

66

77
def get_version(version=VERSION):

0 commit comments

Comments
 (0)