diff --git a/Tools/PathResolver/Root/PathResolver.cxx b/Tools/PathResolver/Root/PathResolver.cxx index 3f8361b21cf55f870544cd18cc31a7f9f6712626..e531ba8b46e0bdf586f95f1a266d52029b5cda8d 100644 --- a/Tools/PathResolver/Root/PathResolver.cxx +++ b/Tools/PathResolver/Root/PathResolver.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "PathResolver/PathResolver.h" @@ -203,6 +203,12 @@ PathResolver::find_file(const std::string& logical_file_name, System::getEnv(search_path, path_list); #endif +#ifndef XAOD_ANALYSIS + if (!logical_file_name.empty() && logical_file_name[0]=='/') { + msg(MSG::ERROR) << "Use of an absolute file name: " << logical_file_name << endmsg; + } +#endif + return (find_file_from_list (logical_file_name, path_list, search_type)); } diff --git a/Tools/PathResolver/test/PathResolver.xml b/Tools/PathResolver/test/PathResolver.xml deleted file mode 100644 index 87c9745b2369f70ce4dee30cc36dfb41a6f0bf73..0000000000000000000000000000000000000000 --- a/Tools/PathResolver/test/PathResolver.xml +++ /dev/null @@ -1,16 +0,0 @@ -<?xml version="1.0"?> -<atn> - <TEST name="PathResolverTest" type="makecheck" suite="Examples"> - <package>Tools/PathResolver</package> - <timelimit>40</timelimit> - <author> Paolo Calafiura </author> - <mailto> pcalafiura@lbl.gov, snyder@bnl.gov, binet@cern.ch</mailto> - <expectations> - <errorMessage>Athena exited abnormally</errorMessage> - <errorMessage>differ</errorMessage> - <warningMessage> # WARNING_MESSAGE : post.sh> ERROR</warningMessage> - <successMessage>check ok</successMessage> - <returnValue>0</returnValue> - </expectations> - </TEST> -</atn> diff --git a/Trigger/TrigConfiguration/TrigConfigSvc/python/TrigConfigSvcConfig.py b/Trigger/TrigConfiguration/TrigConfigSvc/python/TrigConfigSvcConfig.py index 2c91474e14c9f483ec7678b1f0baf3359bccba36..aa9e51a3481cb7d87dc6e387c9669d5721885f73 100755 --- a/Trigger/TrigConfiguration/TrigConfigSvc/python/TrigConfigSvcConfig.py +++ b/Trigger/TrigConfiguration/TrigConfigSvc/python/TrigConfigSvcConfig.py @@ -357,7 +357,7 @@ class SetupTrigConfigSvc(object): if TriggerFlags.doLVL2() or TriggerFlags.doEF() or TriggerFlags.doHLT() or TriggerFlags.configForStartup()=='HLToffline': self.mlog.info( "setup HLTConfigSvc and add instance to ServiceMgr (xml file="+self.hltXmlFile+")" ) hlt = HLTConfigSvc("HLTConfigSvc") - hlt.XMLMenuFile = findFileInXMLPATH(self.hltXmlFile) + hlt.XMLMenuFile = self.hltXmlFile hlt.doMergedHLT = TriggerFlags.doHLT() ServiceMgr += hlt else: @@ -366,12 +366,12 @@ class SetupTrigConfigSvc(object): self.mlog.info( "setup LVL1ConfigSvc and add instance to ServiceMgr (xml file="+self.l1XmlFile+")" ) l1 = LVL1ConfigSvc("LVL1ConfigSvc") - l1.XMLMenuFile = findFileInXMLPATH(self.l1XmlFile) + l1.XMLMenuFile = self.l1XmlFile ServiceMgr += l1 self.mlog.info( "setup L1TopoConfigSvc and add instance to ServiceMgr (xml file="+self.l1topoXmlFile+")" ) l1topo = L1TopoConfigSvc() - l1topo.XMLMenuFile = findFileInXMLPATH(self.l1topoXmlFile) + l1topo.XMLMenuFile = self.l1topoXmlFile ServiceMgr += l1topo diff --git a/Trigger/TrigConfiguration/TrigConfigSvc/src/ConfigSvcBase.cxx b/Trigger/TrigConfiguration/TrigConfigSvc/src/ConfigSvcBase.cxx index 0dc5122f8e3af9c49a5ccfaaccc7cf6f2a8ce345..e95800d08b30ce2391c00355127c0f9eaab05972 100644 --- a/Trigger/TrigConfiguration/TrigConfigSvc/src/ConfigSvcBase.cxx +++ b/Trigger/TrigConfiguration/TrigConfigSvc/src/ConfigSvcBase.cxx @@ -8,7 +8,9 @@ #include "TrigConfStorage/StorageMgr.h" #include "TrigConfStorage/XMLStorageMgr.h" -#include "boost/algorithm/string/case_conv.hpp" +#include "PathResolver/PathResolver.h" + +#include "boost/algorithm/string.hpp" #include "boost/lexical_cast.hpp" using namespace std; @@ -123,8 +125,13 @@ ConfigSvcBase::initStorageMgr() { ATH_MSG_ERROR("If you need the configuration and ConfigSource is 'XML', you need to specify a menu xml file"); return StatusCode::FAILURE; } - ATH_MSG_INFO("XML file: " << m_xmlFile); - m_storageMgr = new XMLStorageMgr( { m_xmlFile } ); + std::string resolvedXMLfile(m_xmlFile); + if( boost::algorithm::ends_with(m_xmlFile, ".xml") && ! boost::algorithm::starts_with(m_xmlFile, "./") ) { + resolvedXMLfile = PathResolver::find_file( m_xmlFile, "XMLPATH" ); + } + ATH_MSG_INFO("Unresolved XML file: " << m_xmlFile); + ATH_MSG_INFO("Resolved XML file: " << resolvedXMLfile); + m_storageMgr = new XMLStorageMgr( { resolvedXMLfile } ); } return StatusCode::SUCCESS; } diff --git a/Trigger/TrigConfiguration/TrigConfigSvc/src/LVL1ConfigSvc.cxx b/Trigger/TrigConfiguration/TrigConfigSvc/src/LVL1ConfigSvc.cxx index 929c33cd19452dd11dd335b1c5c9fc868e30c27b..3decc4264caa66a2ddee0957a917d80a5c0f701b 100644 --- a/Trigger/TrigConfiguration/TrigConfigSvc/src/LVL1ConfigSvc.cxx +++ b/Trigger/TrigConfiguration/TrigConfigSvc/src/LVL1ConfigSvc.cxx @@ -7,8 +7,6 @@ // Athena/Gaudi includes: -#include "PathResolver/PathResolver.h" - #include "GaudiKernel/ServiceHandle.h" #include "GaudiKernel/IIncidentSvc.h" #include "GaudiKernel/Incident.h" @@ -145,11 +143,7 @@ TrigConf::LVL1ConfigSvc::initializeRun2StyleMenu() { if ( m_configSourceString == "none" ) { ATH_MSG_INFO("Run 2 style menu has been disabled"); m_xmlFile = ""; - } else if( m_configSourceString == "xml") { - if( boost::algorithm::ends_with(m_xmlFile, ".xml") && ! boost::algorithm::starts_with(m_xmlFile, "./") ) { - m_xmlFile = PathResolver::find_file( m_xmlFile, "XMLPATH" ); - } - } else { + } else if( m_configSourceString != "xml") { TrigDBConnectionConfig::DBType dbtype(TrigDBConnectionConfig::DBLookup); if (m_configSourceString == "oracle") { dbtype = TrigDBConnectionConfig::Oracle; } else if (m_configSourceString == "mysql") { dbtype = TrigDBConnectionConfig::MySQL; }