config-file: search multiple directories
Restricting the config file to `/usr/share` makes testing difficult
and prevents the config file from being present on a, typically for
the BMC, read-write volume. Change the config loading code to search:
1. pwd
2. /var/lib/phosphor-virtual-sensor
3. /usr/share/phosphor-virtual-sensor
Tested:
Ran strace on the changes and observed the expected file search.
```
getcwd("pwd/phosphor-virtual-sensor/builddir", 4096) = 75
newfstatat(AT_FDCWD, "pwd/phosphor-virtual-sensor/builddir/virtual_sensor_config.json", 0x7fff60a0af90, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/var/lib/phosphor-virtual-sensor/virtual_sensor_config.json", 0x7fff60a0af90, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/usr/share/phosphor-virtual-sensor/virtual_sensor_config.json", 0x7fff60a0af90, 0) = -1 ENOENT (No such file or directory)
```
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I70854d565a3b13cd48c27a80da84de54c00a0603
diff --git a/virtualSensor.hpp b/virtualSensor.hpp
index d85303a..921aee2 100644
--- a/virtualSensor.hpp
+++ b/virtualSensor.hpp
@@ -281,7 +281,7 @@
/** @brief Get virual sensor config from DBus**/
ManagedObjectType getObjectsFromDBus();
/** @brief Parsing virtual sensor config JSON file */
- Json parseConfigFile(const std::string& configFile);
+ Json parseConfigFile();
/** @brief Matches for virtual sensors */
std::vector<std::unique_ptr<sdbusplus::bus::match_t>> matches;