From b741e6b9d7c27be23dd122c14b5992eefc715831 Mon Sep 17 00:00:00 2001 From: Matt Spinler Date: Tue, 10 Dec 2024 11:44:09 -0600 Subject: [PATCH] RBMC: Add no-redundancy reasons to rbmctool Display the reasons preventing redundancy from being enabled in the rbmctool on the active BMC by getting them from the persistent data file. Tested: Reasons are added to the bottom of the rbmtool output: Local BMC ----------------------------- Role: Active BMC Position: 0 Redundancy Enabled: false BMC State: Ready Failovers Paused: false FW version hash: 804C5074 Provisioned: true Role reason: BMC is position 0 No redundancy reasons: Firmware version mismatch Signed-off-by: Matt Spinler --- redundant-bmc/src/rbmc_tool.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/redundant-bmc/src/rbmc_tool.cpp b/redundant-bmc/src/rbmc_tool.cpp index 6113eed..019e936 100644 --- a/redundant-bmc/src/rbmc_tool.cpp +++ b/redundant-bmc/src/rbmc_tool.cpp @@ -1,6 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 #include "persistent_data.hpp" +#include "redundancy.hpp" #include "services_impl.hpp" #include @@ -99,6 +100,22 @@ sdbusplus::async::task<> "Role Reason: {}\n", data::read(data::key::roleReason) .value_or("No reason found")); + + if ((role == "Active") && !enabled) + { + using NoRedDetails = + std::map; + auto details = data::read(data::key::noRedDetails) + .value_or(NoRedDetails{}); + if (!details.empty()) + { + std::cout << std::format("No redundancy reasons:\n"); + for (const auto& d : std::views::values(details)) + { + std::cout << std::format(" {}\n", d); + } + } + } } } catch (const std::exception& e)