File tree Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -80,10 +80,23 @@ def inner(options):
80
80
81
81
def wrap_init (func ):
82
82
def inner (options ):
83
- accounts = AccountManagementAPI ()
84
- certs = CertificatesAPI ()
83
+ if getattr (options , 'api_key' , None ):
84
+ api_key = options .api_key
85
+ else :
86
+ api_key = getenv ("MBED_CLOUD_SDK_API_KEY" )
87
+ if getattr (options , 'server_address' , None ):
88
+ host_addr = options .server_address
89
+ else :
90
+ host_addr = getenv ("MBED_CLOUD_SDK_HOST" ,
91
+ "https://api.us-east-1.mbedcloud.com/" )
92
+ config = {
93
+ "api_key" : api_key ,
94
+ "host" : host_addr ,
95
+ }
96
+ accounts = AccountManagementAPI (config )
97
+ certs = CertificatesAPI (config )
85
98
api_key = accounts .list_api_keys (filter = {
86
- 'key' : getenv ( "MBED_CLOUD_SDK_API_KEY" )
99
+ 'key' : api_key
87
100
}).next ()
88
101
certificates_owned = list (certs .list_certificates ())
89
102
dev_cert_info = None
You can’t perform that action at this time.
0 commit comments