File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -32,7 +32,20 @@ def doWriteBack(source, destination):
3232
3333 # Get the scitoken content
3434 if 'KRB5CCNAME' in os .environ :
35- scitoken_file = os .environ ['KRB5CCNAME' ]
35+ # First, try to split the environment variable:
36+ # Format: KRB5CCNAME=FILE:/var/lib/condor/execute/dir_24688/nobody.cc
37+ if ':' in os .environ ['KRB5CCNAME' ]:
38+ # Try splitting
39+ scitoken_file = os .environ ['KRB5CCNAME' ].split (':' , 1 )
40+ if not os .path .exists (scitoken_file ):
41+ scitoken_file = None
42+ if scitoken_file == None :
43+ # Splitting failed, now try just looking at the os.environ:
44+ scitoken_file = os .environ ['KRB5CCNAME' ]
45+ if not os .path .exists (scitoken_file ):
46+ scitoken_file = None
47+ logging .error ("Unable to find SciToken file, environment variable KRB5CCNAME=%s, but file not found" % (os .environ ['KRB5CCNAME' ]))
48+ return 1
3649 else :
3750 logging .error ("Unable to find SciToken file, environment variable \" KRB5CCNAME\" not found." )
3851 return 1
You can’t perform that action at this time.
0 commit comments