summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Spinler <spinler@us.ibm.com>2018-09-07 15:04:16 -0500
committerMatt Spinler <spinler@us.ibm.com>2018-09-07 15:06:57 -0500
commit14e14cddf60e9858d5f3de8f46adfc42bc880cfa (patch)
tree719579c5bdf23a703f7a7695cad24b25470eb296
parenta965cf06a6bb6b130a2e4f1202978aac9124be68 (diff)
downloadphosphor-state-manager-14e14cddf60e9858d5f3de8f46adfc42bc880cfa.tar.gz
phosphor-state-manager-14e14cddf60e9858d5f3de8f46adfc42bc880cfa.zip
Traverse full GetSubTree output
It isn't safe to assume that the interface passed in to GetSubtree will be the first one in the output, so need to traverse the whole structure. Tested: phosphor-discover-system-state was failing with the C++ mapper, but works with this fix. Change-Id: Ibc29280f9d51d8067e764da1745d30378bf7068d Signed-off-by: Matt Spinler <spinler@us.ibm.com>
-rw-r--r--settings.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/settings.cpp b/settings.cpp
index e0600dc..70bf04e 100644
--- a/settings.cpp
+++ b/settings.cpp
@@ -43,15 +43,20 @@ Objects::Objects(sdbusplus::bus::bus& bus) : bus(bus)
for (const auto& iter : result)
{
const Path& path = iter.first;
- const Interface& interface = iter.second.begin()->second[0];
- if (autoRebootIntf == interface)
+ for (const auto& serviceIter : iter.second)
{
- autoReboot = path;
- }
- else if (powerRestoreIntf == interface)
- {
- powerRestorePolicy = path;
+ for (const auto& interface : serviceIter.second)
+ {
+ if (autoRebootIntf == interface)
+ {
+ autoReboot = path;
+ }
+ else if (powerRestoreIntf == interface)
+ {
+ powerRestorePolicy = path;
+ }
+ }
}
}
}
OpenPOWER on IntegriCloud