Skip to content

Commit effb881

Browse files
committed
Add accidentally removed function to check x509
1 parent ca93b48 commit effb881

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

coffea_casa/coffea_casa.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,17 @@ def check_token_path(path, suffix=''):
6969

7070
return None
7171

72+
def x509_user_proxy_path():
73+
"""Return the path to the user's X.509 proxy or raise FileNotFoundError if it doesn't exist on disk
74+
"""
75+
try:
76+
path = os.environ['X509_USER_PROXY']
77+
except KeyError:
78+
path = f'/tmp/x509up_u{os.geteuid()}'
79+
80+
if open(path):
81+
return path
82+
return None # we shouldn't get here; failure to open should raise OSError
7283

7384
def merge_dicts(*dict_args):
7485
"""

0 commit comments

Comments
 (0)