Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion DataFormats/Parameters/src/GRPTool.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
// or submit itself to any jurisdiction.

#include <boost/program_options.hpp>
#include <cstdlib>
#include <string>
#include "DataFormatsParameters/GRPECSObject.h"
#include "DataFormatsParameters/GRPMagField.h"
Expand Down Expand Up @@ -43,6 +44,19 @@ enum class GRPCommand {
kPRINTMAG
};

// CCDB host, overridable via ALICEO2_CCDB_HOST as the CCDB test suites do.
// Without it this tool always contacts alice-ccdb.cern.ch, which CcdbApi flags
// as needing an alien token -- fatal in CI, where CCDB is reached through a
// local proxy instead.
namespace
{
std::string defaultCCDBHost()
{
const char* host = std::getenv("ALICEO2_CCDB_HOST");
return (host && *host) ? std::string(host) : std::string("http://alice-ccdb.cern.ch");
}
} // namespace

// options struct filled from command line
struct Options {
std::vector<std::string> readout;
Expand All @@ -60,7 +74,7 @@ struct Options {
bool print = false; // whether to print outcome of GRP operation
bool lhciffromccdb = false; // whether only to take GRPLHCIF from CCDB
std::string publishto = "";
std::string ccdbhost = "http://alice-ccdb.cern.ch";
std::string ccdbhost = defaultCCDBHost();
bool isRun5 = false; // whether or not this is supposed to be a Run5 detector configuration
std::string vertex = "ccdb";
std::string configKeyValues = "";
Expand Down