File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 21
21
import tempfile
22
22
import time
23
23
24
- import adal
25
24
import google .auth
26
25
import google .auth .transport .requests
27
26
import oauthlib .oauth2
36
35
from .config_exception import ConfigException
37
36
from .dateutil import UTC , format_rfc3339 , parse_rfc3339
38
37
38
+ try :
39
+ import adal
40
+ except ImportError :
41
+ pass
42
+
39
43
EXPIRY_SKEW_PREVENTION_DELAY = datetime .timedelta (minutes = 5 )
40
44
KUBE_CONFIG_DEFAULT_LOCATION = os .environ .get ('KUBECONFIG' , '~/.kube/config' )
41
45
_temp_files = {}
@@ -218,6 +222,9 @@ def _load_azure_token(self, provider):
218
222
return self .token
219
223
220
224
def _refresh_azure_token (self , config ):
225
+ if 'adal' not in globals ():
226
+ raise ImportError ('refresh token error, adal library not imported' )
227
+
221
228
tenant = config ['tenant-id' ]
222
229
authority = 'https://login.microsoftonline.com/{}' .format (tenant )
223
230
context = adal .AuthenticationContext (
You can’t perform that action at this time.
0 commit comments