From bc83b42ae2b8c8246e6387731910842a12ebee90 Mon Sep 17 00:00:00 2001 From: Andrew Battat <113942931+andrewbattat@users.noreply.github.com> Date: Mon, 23 Dec 2024 15:55:58 -0600 Subject: [PATCH] fix(node): fix update-config when reward.conf does not exist (#3290) [NODE-1541](https://dfinity.atlassian.net/browse/NODE-1541) Handle the update-config case where reward.conf does not exist on the config partition. [NODE-1541]: https://dfinity.atlassian.net/browse/NODE-1541?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ --- rs/ic_os/config/src/update_config.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/rs/ic_os/config/src/update_config.rs b/rs/ic_os/config/src/update_config.rs index 6f7d3971e40..197c3d974ee 100644 --- a/rs/ic_os/config/src/update_config.rs +++ b/rs/ic_os/config/src/update_config.rs @@ -189,10 +189,12 @@ fn read_nns_conf(config_dir: &Path) -> Result> { fn read_reward_conf(config_dir: &Path) -> Result> { let reward_conf_path = config_dir.join("reward.conf"); - let conf_map = read_conf_file(&reward_conf_path)?; + if !reward_conf_path.exists() { + return Ok(None); + } + let conf_map = read_conf_file(&reward_conf_path)?; let node_reward_type = conf_map.get("node_reward_type").cloned(); - Ok(node_reward_type) }