control: Be more lenient toward missing sensors
In the cases where the service name of a sensor (i.e. group member) is
known ahead of time, but that service isn't actually running, the code
will try to make a get property call on it anyway and crash. Fix that
by catching the exception and continuing on.
Also, if the same type of service isn't running but is used in an action
that runs on a timer with 'preload_groups' set in the config to have the
code try to get all properties in the groups after each timer
expiration, there will be an exception thrown there too. In that case,
the exception is caught by the sdeventplus handler so the app doesn't
crash, but it prevents the run() call from completing. Catch that
exception as well in Manager::addGroups() so the actions can complete.
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: Ifb56333508c3ceb6027e1e004d946c330dbd8634
2 files changed