Skip to content
Snippets Groups Projects
Commit ba6f7eec authored by Frank Winklmeier's avatar Frank Winklmeier
Browse files

TrigPSC: Suppress warning when running in partition

`PYTHONSETUPFILE` is not available when running in a partition. Suppress
the warning message.
parent 4412fa7e
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
*/
/**
......@@ -42,8 +42,9 @@ namespace psc {
/**
* Gets an option in a "safer" way
* @param quiet Print warning if option is not available
*/
std::string getOption(const std::string& key) const;
std::string getOption(const std::string& key, bool quiet=false) const;
/**
* Incredibly simple minded way to access this object from python.
......
......@@ -207,12 +207,14 @@ std::string psc::Config::dumpOptions() const
}
////////////////////////////////////////////////////////////////////////////////
std::string psc::Config::getOption(const std::string& key) const
std::string psc::Config::getOption(const std::string& key, bool quiet) const
{
std::map<std::string, std::string>::const_iterator it = optmap.find(key);
if (it == optmap.end()) {
ERS_PSC_WARNING("Could not find requested option = " << key) ;
ERS_DEBUG(1, " " << dumpOptions() ) ;
if (!quiet) {
ERS_PSC_WARNING("Could not find requested option = " << key);
ERS_DEBUG(1, " " << dumpOptions() );
}
return "";
}
return it->second;
......
......@@ -285,8 +285,8 @@ bool psc::Psc::configure(const ptree& config)
// Do the basic python setup if postcommand or logLevel was changed
if ( needPython ) {
// Normally this is TrigPSC/TrigPSCPythonDbSetup
std::string pyBasicFile = m_config->getOption("PYTHONSETUPFILE") ;
// only used in athenaHLT, but not in partition running
std::string pyBasicFile = m_config->getOption("PYTHONSETUPFILE", /*quiet*/true) ;
if ( pyBasicFile != "" ) {
if ( !psc::Utils::pyInclude(pyBasicFile) ) {
ERS_PSC_ERROR("Basic Python configuration failed.");
......
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