Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Nilsson committed Jul 24, 2024
1 parent b09f10d commit b7de6a8
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions pilot/util/https.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,13 +385,11 @@ def locate_token(auth_token: str) -> str:
:return: path to token (str).
"""
# special case for the token key used for refreshing the token
logger.debug(f"auth_token={auth_token}")
path = os.environ.get("PANDA_AUTH_TOKEN_KEY")
if auth_token in path and os.path.exists(path):
logger.debug(f"using path to token key for refreshing the token: {path}")
return path

logger.debug('continuing')
primary_basedir = os.path.dirname(os.environ.get('OIDC_AUTH_DIR', os.environ.get('PANDA_AUTH_DIR', os.environ.get('X509_USER_PROXY', ''))))
paths = [os.path.join(primary_basedir, auth_token),
os.path.join(os.environ.get('PILOT_SOURCE_DIR', ''), auth_token),
Expand All @@ -405,12 +403,10 @@ def locate_token(auth_token: str) -> str:
# remove duplicates
paths = list(set(paths))

logger.debug(f"looking for token in paths: {paths}")

path = ""
for _path in paths:
logger.debug(f'looking for {_path}')
if os.path.exists(_path):
logger.debug(f'found {_path}')
path = _path
break

Expand Down

0 comments on commit b7de6a8

Please sign in to comment.