blob: 7ad79b36ecda2b3d791c344cdc173b58dae9c708 [file] [log] [blame]
Matt Spinlerebf69892024-05-17 14:56:16 -05001#include "manager.hpp"
2
3#include "role_determination.hpp"
4
5#include <phosphor-logging/lg2.hpp>
6
7namespace bmc::redundancy
8{
9
10Manager::Manager(sdbusplus::async::context& ctx) :
11 ctx(ctx),
12 redundancyInterface(ctx.get_bus(), RedundancyInterface::instance_path)
13{
14 ctx.spawn(startup());
15}
16
17sdbusplus::async::task<> Manager::startup()
18{
19 determineRole();
20 co_return;
21}
22
23void Manager::determineRole()
24{
25 auto role = role_determination::run();
26
27 lg2::info("Role Determined: {ROLE}", "ROLE", role);
28
29 redundancyInterface.role(role);
30}
31
32} // namespace bmc::redundancy