summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2023-09-07 12:40:16 +0200
committerPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2023-09-07 12:40:19 +0200
commitfe80e31b2e1ad871509681ea978ce679177493f5 (patch)
tree8eb39bc7b52ae9cfcee0f3555e21db8af3c9a42f /src
parent52f2e3801e9bb2583e8fc9c56d7e4fccd965dd02 (diff)
downloadjustbuild-fe80e31b2e1ad871509681ea978ce679177493f5.tar.gz
just-mr: allow subkeys to be skipped in RC file
If a key has a map value, do not force all its subkeys to be present. Fixes changes brought in with supporting remote execution and authentication options in just-mr.
Diffstat (limited to 'src')
-rw-r--r--src/other_tools/just_mr/main.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/other_tools/just_mr/main.cpp b/src/other_tools/just_mr/main.cpp
index 29e53048..6ca10205 100644
--- a/src/other_tools/just_mr/main.cpp
+++ b/src/other_tools/just_mr/main.cpp
@@ -504,9 +504,8 @@ void SetupLogging(MultiRepoLogArguments const& clargs) {
remote->ToString());
std::exit(kExitConfigError);
}
- auto const& remote_map = remote->Map();
if (not clargs->common.remote_execution_address) {
- auto addr = remote_map.at("address");
+ auto addr = remote->Get("address", Expression::none_t{});
if (addr.IsNotNull()) {
if (not addr->IsString()) {
Logger::Log(LogLevel::Error,
@@ -519,7 +518,7 @@ void SetupLogging(MultiRepoLogArguments const& clargs) {
}
}
if (not clargs->common.compatible) {
- auto compat = remote_map.at("compatible");
+ auto compat = remote->Get("compatible", Expression::none_t{});
if (compat.IsNotNull()) {
if (not compat->IsBool()) {
Logger::Log(LogLevel::Error,
@@ -542,24 +541,26 @@ void SetupLogging(MultiRepoLogArguments const& clargs) {
auth_args->ToString());
std::exit(kExitConfigError);
}
- auto const& auth_map = auth_args->Map();
if (not clargs->auth.tls_ca_cert) {
- auto v = ReadLocation(auth_map.at("ca cert"),
- clargs->common.just_mr_paths->workspace_root);
+ auto v =
+ ReadLocation(auth_args->Get("ca cert", Expression::none_t{}),
+ clargs->common.just_mr_paths->workspace_root);
if (v) {
clargs->auth.tls_ca_cert = v->first;
}
}
if (not clargs->auth.tls_client_cert) {
- auto v = ReadLocation(auth_map.at("client cert"),
- clargs->common.just_mr_paths->workspace_root);
+ auto v = ReadLocation(
+ auth_args->Get("client cert", Expression::none_t{}),
+ clargs->common.just_mr_paths->workspace_root);
if (v) {
clargs->auth.tls_client_cert = v->first;
}
}
if (not clargs->auth.tls_client_key) {
- auto v = ReadLocation(auth_map.at("client key"),
- clargs->common.just_mr_paths->workspace_root);
+ auto v =
+ ReadLocation(auth_args->Get("client key", Expression::none_t{}),
+ clargs->common.just_mr_paths->workspace_root);
if (v) {
clargs->auth.tls_client_key = v->first;
}