From 1fbefa0b89eaafaa2345de989ebf3c410a34869b Mon Sep 17 00:00:00 2001 From: Giulio Eulisse <10544+ktf@users.noreply.github.com> Date: Tue, 8 Sep 2026 08:54:15 +0200 Subject: [PATCH] Remove hardcoded CCDB path --- DataFormats/Parameters/src/GRPTool.cxx | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/DataFormats/Parameters/src/GRPTool.cxx b/DataFormats/Parameters/src/GRPTool.cxx index e7561e6fc1ef6..49d9a68decc58 100644 --- a/DataFormats/Parameters/src/GRPTool.cxx +++ b/DataFormats/Parameters/src/GRPTool.cxx @@ -10,6 +10,7 @@ // or submit itself to any jurisdiction. #include +#include #include #include "DataFormatsParameters/GRPECSObject.h" #include "DataFormatsParameters/GRPMagField.h" @@ -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 readout; @@ -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 = "";