Skip to content

Commit 39726a3

Browse files
committed
initialize creds env vars to support using creds file
1 parent 93731cc commit 39726a3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

netfoundry/organization.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ def __init__(self,
5656
expiry = claim['exp']
5757
epoch = time.time()
5858

59+
client_id = None
60+
password = None
61+
token_endpoint = None
62+
5963
# persist the credentials filename in instances so that it may be used to refresh the token
6064
if credentials is not None:
6165
self.credentials = credentials
@@ -80,7 +84,7 @@ def __init__(self,
8084
# if no token or near expiry (30 min) then use env vars or credentials file to obtain a token
8185
if epoch is None or epoch > (expiry - 600):
8286
# if not creds as env vars then look for creds file
83-
if not client_id and password and token_endpoint:
87+
if not client_id and not password and not token_endpoint:
8488
# unless a valid path assume relative and search the default chain
8589
if not os.path.exists(self.credentials):
8690
default_creds_chain = [

0 commit comments

Comments
 (0)