summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Venture <venture@google.com>2019-02-08 14:59:44 -0800
committerPatrick Venture <venture@google.com>2019-02-08 15:02:12 -0800
commit6f59cf254ce5ca7232cb4e7971e33e204f6e7374 (patch)
tree8310dca1f68f954cf48c05aaa6ebb4c09910d279
parenteeeb867de1fac2d524cd2d0c94d11194bfbfcebb (diff)
downloadphosphor-pid-control-6f59cf254ce5ca7232cb4e7971e33e204f6e7374.tar.gz
phosphor-pid-control-6f59cf254ce5ca7232cb4e7971e33e204f6e7374.zip
sensors: buildjson: add todo for failure
The daemon needs to validate the json configuration, either immediately after it's parsed or when objects are built from it. Change-Id: I52b5a558657ba1420bc4589de793cc496392f318 Signed-off-by: Patrick Venture <venture@google.com>
-rw-r--r--sensors/buildjson.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/sensors/buildjson.cpp b/sensors/buildjson.cpp
index 7c4c7d6..4bf5ea7 100644
--- a/sensors/buildjson.cpp
+++ b/sensors/buildjson.cpp
@@ -79,6 +79,9 @@ std::map<std::string, struct SensorConfig>
std::map<std::string, struct SensorConfig> config;
auto sensors = data["sensors"];
+ /* TODO: If no sensors, this is invalid, and we should except here or during
+ * parsing.
+ */
for (const auto& sensor : sensors)
{
config[sensor["name"]] = sensor.get<struct SensorConfig>();
OpenPOWER on IntegriCloud