We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 989156a commit 9d84f66Copy full SHA for 9d84f66
1 file changed
stashcp.py
@@ -119,13 +119,20 @@ def getToken():
119
120
if 'TOKEN' in os.environ:
121
scitoken_file = os.environ['TOKEN']
122
+
123
+ # If the scitoken file is relative, then assume it's relative
124
+ # to the _CONDOR_CREDS directory.
125
+ if not os.path.isabs(scitoken_file) and "_CONDOR_CREDS" in os.environ:
126
+ os.path.join(os.environ['_CONDOR_CREDS'], scitoken_file)
127
128
if not scitoken_file or not os.path.exists(scitoken_file):
129
logging.info("Unable to find token file")
130
return None
131
132
+ # Read in the JSON
133
with open(scitoken_file, 'r') as scitoken_obj:
- scitoken_contents = scitoken_obj.read().strip()
134
+ token_json = json.load(scitoken_obj)
135
+ scitoken_contents = token_json['access_token']
136
137
return scitoken_contents
138
0 commit comments