def initialiseSiteConf(self): """ _initialiseSiteConf_ Extract required information from site conf and TFC """ implName = self.siteCfg.localStageOut.get("command", None) if implName == None: msg = "Unable to retrieve local stage out command\n" msg += "From site config file.\n" msg += "Unable to perform StageOut operation" raise StageOutInitError( msg) msg = "Local Stage Out Implementation to be used is: " msg += "%s\n" % implName seName = self.siteCfg.localStageOut.get("se-name", None) if seName == None: msg = "Unable to retrieve local stage out se-name\n" msg += "From site config file.\n" msg += "Unable to perform StageOut operation" raise StageOutInitError( msg) msg += "Local Stage Out SE Name to be used is %s\n" % seName pnn = self.siteCfg.localStageOut.get("phedex-node", None) if pnn == None: msg = "Unable to retrieve local stage out phedex-node\n" msg += "From site config file.\n" msg += "Unable to perform StageOut operation" raise StageOutInitError( msg) msg += "Local Stage Out PNN to be used is %s\n" % pnn catalog = self.siteCfg.localStageOut.get("catalog", None) if catalog == None: msg = "Unable to retrieve local stage out catalog\n" msg += "From site config file.\n" msg += "Unable to perform StageOut operation" raise StageOutInitError( msg) msg += "Local Stage Out Catalog to be used is %s\n" % catalog try: self.tfc = self.siteCfg.trivialFileCatalog() msg += "Trivial File Catalog has been loaded:\n" msg += str(self.tfc) except Exception as ex: msg = "Unable to load Trivial File Catalog:\n" msg += "Local stage out will not be attempted\n" msg += str(ex) raise StageOutInitError( msg ) self.fallbacks = self.siteCfg.fallbackStageOut msg += "There are %s fallback stage out definitions.\n" % len(self.fallbacks) for item in self.fallbacks: msg += "\tFallback to : %s using: %s \n" % (item['se-name'], item['command']) print "==== Stageout configuration start ====" print msg print "==== Stageout configuration finish ====" return
def initialiseSiteConf(self): """ _initialiseSiteConf_ Extract required information from site conf and TFC """ implName = self.siteCfg.localStageOut.get("command", None) if implName == None: msg = "Unable to retrieve local stage out command\n" msg += "From site config file.\n" msg += "Unable to perform StageOut operation" raise StageOutInitError(msg) msg = "Local Stage Out Implementation to be used is:" msg += "%s\n" % implName seName = self.siteCfg.localStageOut.get("se-name", None) if seName == None: msg = "Unable to retrieve local stage out se-name\n" msg += "From site config file.\n" msg += "Unable to perform StageOut operation" raise StageOutInitError(msg) msg += "Local Stage Out SE Name to be used is %s\n" % seName pnn = self.siteCfg.localStageOut.get("phedex-node", None) if pnn == None: msg = "Unable to retrieve local stage out phedex-node\n" msg += "From site config file.\n" msg += "Unable to perform StageOut operation" raise StageOutInitError(msg) msg += "Local Stage Out PNN to be used is %s\n" % pnn catalog = self.siteCfg.localStageOut.get("catalog", None) if catalog == None: msg = "Unable to retrieve local stage out catalog\n" msg += "From site config file.\n" msg += "Unable to perform StageOut operation" raise StageOutInitError(msg) msg += "Local Stage Out Catalog to be used is %s\n" % catalog try: self.tfc = self.siteCfg.trivialFileCatalog() msg += "Trivial File Catalog has been loaded:\n" msg += str(self.tfc) except Exception as ex: msg = "Unable to load Trivial File Catalog:\n" msg += "Local stage out will not be attempted\n" msg += str(ex) raise StageOutInitError(msg) print msg self.seName = seName self.pnn = pnn return
def initialiseOverride(self): """ _initialiseOverride_ Extract and verify that the Override parameters are all present """ overrideConf = self.overrideConf overrideParams = { "command": None, "option": None, "se-name": None, "phedex-node": None, "lfn-prefix": None, } try: overrideParams['command'] = overrideConf['command'] overrideParams['se-name'] = overrideConf['se-name'] overrideParams['phedex-node'] = overrideConf['phedex-node'] overrideParams['lfn-prefix'] = overrideConf['lfn-prefix'] except Exception as ex: msg = "Unable to extract Override parameters from config:\n" msg += str(overrideConf) raise StageOutInitError(msg) if 'option' in overrideConf: if len(overrideConf['option']) > 0: overrideParams['option'] = overrideConf['option'] else: overrideParams['option'] = "" msg = "=======Delete Override Initialised:================\n" for key, val in overrideParams.items(): msg += " %s : %s\n" % (key, val) msg += "=====================================================\n" print msg self.fallbacks.append(overrideParams) self.seName = overrideParams['se-name'] self.pnn = overrideParams['phedex-node'] return
def initialiseOverride(self): """ _initialiseOverride_ Extract and verify that the Override parameters are all present """ overrideConf = self.overrideConf overrideParams = { "command": None, "option": None, "se-name": None, "lfn-prefix": None, } try: overrideParams['command'] = overrideConf['command'] overrideParams['se-name'] = overrideConf['se-name'] overrideParams['lfn-prefix'] = overrideConf['lfn-prefix'] except StandardError, ex: msg = "Unable to extract Override parameters from config:\n" msg += str(ex) raise StageOutInitError(msg)