Skip to content

Commit b1cf6f8

Browse files
committed
Fix ordering of token detection
1 parent 9d84f66 commit b1cf6f8

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

stashcp.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,14 +120,14 @@ def getToken():
120120
if 'TOKEN' in os.environ:
121121
scitoken_file = os.environ['TOKEN']
122122

123+
if not scitoken_file or not os.path.exists(scitoken_file):
124+
logging.info("Unable to find token file")
125+
return None
126+
123127
# If the scitoken file is relative, then assume it's relative
124128
# to the _CONDOR_CREDS directory.
125129
if not os.path.isabs(scitoken_file) and "_CONDOR_CREDS" in os.environ:
126130
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
131131

132132
# Read in the JSON
133133
with open(scitoken_file, 'r') as scitoken_obj:

0 commit comments

Comments
 (0)