File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -114,12 +114,22 @@ def getToken():
114114 """
115115 # Get the scitoken content
116116 scitoken_file = None
117+
118+ # Command line
117119 if token_location :
118120 scitoken_file = token_location
119-
121+ # Environ
120122 if 'TOKEN' in os .environ :
121123 scitoken_file = os .environ ['TOKEN' ]
122124
125+ # Backwards compatibility for getting scitokens
126+ if not scitoken_file and "_CONDOR_CREDS" in os .environ :
127+ # Token wasn't specified on the command line, try the default scitokens.use
128+ if os .path .exists (os .path .join (os .environ ["_CONDOR_CREDS" ], "scitokens.use" )):
129+ scitoken_file = os .path .join (os .environ ["_CONDOR_CREDS" ], "scitokens.use" )
130+ elif os .path .exists (".condor_creds/scitokens.use" ):
131+ scitoken_file = os .path .join (os .path .abspath (".condor_creds/scitokens.use" ))
132+
123133 if not scitoken_file or not os .path .exists (scitoken_file ):
124134 logging .info ("Unable to find token file" )
125135 return None
You can’t perform that action at this time.
0 commit comments