Skip to content
Snippets Groups Projects
Commit 5ec4f706 authored by Joerg Stelzer's avatar Joerg Stelzer
Browse files

Fix path resolution in all config svc (ATR-20864)

* remove path resolution from one more place in python
* move path resolution in C++ to base class ConfigSvcBase to avoid
  modification of property and code duplication
parent 6a75d555
No related branches found
No related tags found
No related merge requests found
......@@ -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