Skip to content

Commit

Permalink
RBMC: Add no-redundancy reasons to rbmctool
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
spinler committed Jan 8, 2025
1 parent 5ed70d9 commit b741e6b
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions redundant-bmc/src/rbmc_tool.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// SPDX-License-Identifier: Apache-2.0

#include "persistent_data.hpp"
#include "redundancy.hpp"
#include "services_impl.hpp"

#include <CLI/CLI.hpp>
Expand Down Expand Up @@ -99,6 +100,22 @@ sdbusplus::async::task<>
"Role Reason: {}\n",
data::read<std::string>(data::key::roleReason)
.value_or("No reason found"));

if ((role == "Active") && !enabled)
{
using NoRedDetails =
std::map<rbmc::redundancy::NoRedundancyReason, std::string>;
auto details = data::read<NoRedDetails>(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)
Expand Down

0 comments on commit b741e6b

Please sign in to comment.