11import logging
22import os
33import platform as sysinfo
4+ from distutils .command .config import config
5+ from email .policy import default
46
57import requests
68
@@ -23,13 +25,13 @@ class Config:
2325 access_key = None
2426 secret_key = None
2527 auth_class = None
28+ auth = None
2629 _requests_auth = None
2730 _initialized = False
2831 base_url = None
2932 _hostname = f"api.{ STAX_REGION } "
3033 hostname = None
3134 org_id = None
32- auth = None
3335 expiration = None
3436 load_live_schema = True
3537
@@ -59,14 +61,16 @@ def get_api_config(cls, config_url):
5961 cls .cached_api_config ["caching" ] = config_url
6062 return config_response .json ()
6163
62- def init (self , hostname = None ):
63- if self ._initialized :
64- return
64+ def __init__ (self , hostname = None , access_key = None , secret_key = None ):
65+ self .hostname = hostname
6566 if self .hostname is None :
66- self .hostname = hostname
67- if self .hostname is None :
68- self .hostname = Config . _hostname
67+ self .hostname = Config . _hostname
68+ self .access_key = access_key
69+ self .secret_key = secret_key
6970
71+ def init (self ):
72+ if self ._initialized :
73+ return
7074 self .set_config ()
7175
7276 self ._initialized = True
@@ -81,7 +85,7 @@ def api_base_url(self):
8185
8286 @classmethod
8387 def GetDefaultConfig (cls ):
84- config = Config ()
88+ config = Config (Config . hostname , Config . access_key , Config . secret_key )
8589 return config
8690
8791 def branch (cls ):
0 commit comments