diff options
| author | Patrick Venture <venture@google.com> | 2019-02-08 14:59:44 -0800 |
|---|---|---|
| committer | Patrick Venture <venture@google.com> | 2019-02-08 15:02:12 -0800 |
| commit | 6f59cf254ce5ca7232cb4e7971e33e204f6e7374 (patch) | |
| tree | 8310dca1f68f954cf48c05aaa6ebb4c09910d279 | |
| parent | eeeb867de1fac2d524cd2d0c94d11194bfbfcebb (diff) | |
| download | phosphor-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.cpp | 3 |
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>(); |

