1010
1111
1212class PoolXMLSlice :
13- def __init__ (self , catalogName ):
13+ def __init__ (self , catalogName , jobID_path : os . PathLike ):
1414 """Standard constructor"""
1515 self .fileName = catalogName
16+ self .jobID_path = jobID_path
1617 self .log = gLogger .getSubLogger (self .__class__ .__name__ )
1718
1819 def execute (self , dataDict ):
1920 """Given a dictionary of resolved input data, this will creates a POOL XML slice."""
20- poolXMLCatName = self .fileName
2121 try :
2222 poolXMLCat = PoolXMLCatalog ()
2323 self .log .verbose ("Creating POOL XML slice" )
@@ -41,18 +41,19 @@ def execute(self, dataDict):
4141 xmlSlice = poolXMLCat .toXML ()
4242 self .log .verbose ("POOL XML Slice is: " )
4343 self .log .verbose (xmlSlice )
44- with open (poolXMLCatName , "w" ) as poolSlice :
44+ with open (self . jobID_path / self . fileName , "w" ) as poolSlice :
4545 poolSlice .write (xmlSlice )
46- self .log .info (f"POOL XML Catalogue slice written to { poolXMLCatName } " )
46+ self .log .info (f"POOL XML Catalogue slice written to { self . jobID_path / self . fileName } " )
4747 try :
4848 # Temporary solution to the problem of storing the SE in the Pool XML slice
49- with open (f" { poolXMLCatName } .temp" , "w" ) as poolSlice_temp :
49+ with open (self . jobID_path / ( self . fileName + " .temp") , "w" ) as poolSlice_temp :
5050 xmlSlice = poolXMLCat .toXML (True )
5151 poolSlice_temp .write (xmlSlice )
52- except Exception as x :
53- self .log .warn (f"Attempted to write catalog also to { poolXMLCatName } .temp but this failed" )
54- except Exception as x :
55- self .log .error (str (x ))
52+ except Exception :
53+ self .log .warn (f"Attempted to write catalog also to { self .fileName } .temp but this failed" )
54+ self .log .exception ()
55+ except Exception :
56+ self .log .exception ()
5657 return S_ERROR ("Exception during construction of POOL XML slice" )
5758
5859 return S_OK ("POOL XML Slice created" )
0 commit comments