Skip to content

Commit

Permalink
Fix in the parsing of ccdb-run-dependent options
Browse files Browse the repository at this point in the history
  • Loading branch information
shahor02 committed Nov 25, 2024
1 parent 756634d commit c7c9f54
Showing 1 changed file with 9 additions and 18 deletions.
27 changes: 9 additions & 18 deletions Framework/Core/src/DataDescriptorQueryBuilder.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -319,12 +319,9 @@ std::vector<InputSpec> DataDescriptorQueryBuilder::parse(char const* config)
if (*currentKey == "lifetime" && currentValue == "condition") {
currentLifetime = Lifetime::Condition;
}
if (*currentKey == "ccdb-run-dependent" && (currentValue != "false" && currentValue != "0")) {
attributes.push_back(ConfigParamSpec{*currentKey, VariantType::Bool, true, {}});
} else if (*currentKey == "ccdb-run-dependent" && (currentValue == "false" || currentValue == "0")) {
attributes.push_back(ConfigParamSpec{*currentKey, VariantType::Bool, false, {}});
} else if (*currentKey == "ccdb-run-dependent") {
error("ccdb-run-dependent can only be true or false");
if (*currentKey == "ccdb-run-dependent") {
int val = currentValue == "false" ? 0 : (currentValue == "true" ? 1 : std::stoi(*currentValue));
attributes.push_back(ConfigParamSpec{*currentKey, VariantType::Int, val, {}});
} else {
attributes.push_back(ConfigParamSpec{*currentKey, VariantType::String, *currentValue, {}});
}
Expand All @@ -333,12 +330,9 @@ std::vector<InputSpec> DataDescriptorQueryBuilder::parse(char const* config)
if (*currentKey == "lifetime" && currentValue == "condition") {
currentLifetime = Lifetime::Condition;
}
if (*currentKey == "ccdb-run-dependent" && (currentValue != "false" && currentValue != "0")) {
attributes.push_back(ConfigParamSpec{*currentKey, VariantType::Bool, true, {}});
} else if (*currentKey == "ccdb-run-dependent" && (currentValue == "false" || currentValue == "0")) {
attributes.push_back(ConfigParamSpec{*currentKey, VariantType::Bool, false, {}});
} else if (*currentKey == "ccdb-run-dependent") {
error("ccdb-run-dependent can only be true or false");
if (*currentKey == "ccdb-run-dependent") {
int val = currentValue == "false" ? 0 : (currentValue == "true" ? 1 : std::stoi(*currentValue));
attributes.push_back(ConfigParamSpec{*currentKey, VariantType::Int, val, {}});
} else {
attributes.push_back(ConfigParamSpec{*currentKey, VariantType::String, *currentValue, {}});
}
Expand All @@ -347,12 +341,9 @@ std::vector<InputSpec> DataDescriptorQueryBuilder::parse(char const* config)
if (*currentKey == "lifetime" && currentValue == "condition") {
currentLifetime = Lifetime::Condition;
}
if (*currentKey == "ccdb-run-dependent" && (currentValue != "false" && currentValue != "0")) {
attributes.push_back(ConfigParamSpec{*currentKey, VariantType::Bool, true, {}});
} else if (*currentKey == "ccdb-run-dependent" && (currentValue == "false" || currentValue == "0")) {
attributes.push_back(ConfigParamSpec{*currentKey, VariantType::Bool, false, {}});
} else if (*currentKey == "ccdb-run-dependent") {
error("ccdb-run-dependent can only be true or false");
if (*currentKey == "ccdb-run-dependent") {
int val = currentValue == "false" ? 0 : (currentValue == "true" ? 1 : std::stoi(*currentValue));
attributes.push_back(ConfigParamSpec{*currentKey, VariantType::Int, val, {}});
} else {
attributes.push_back(ConfigParamSpec{*currentKey, VariantType::String, *currentValue, {}});
}
Expand Down

0 comments on commit c7c9f54

Please sign in to comment.