Skip to content
Snippets Groups Projects
Commit 57bd3fae authored by Adam Edward Barton's avatar Adam Edward Barton
Browse files

Merge branch 'master-ATR-20864-2' into 'master'

Fix path resolution in trigger menu services (ATR-20864)

See merge request atlas/athena!34972
parents 8591873f 5ec4f706
No related branches found
No related tags found
No related merge requests found
/*
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));
}
......
<?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>
......@@ -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
......
......@@ -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;
}
......
......@@ -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; }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment