apphandler: catch exceptions in getting bmc state

If the xyz.openbmc_project.State.BMC interface is not provided by
anything in the inventory, provide a mechanism for specifying a default
state with regards to the BMC state.  The dev_id.json file now can have
a boolean field, availability, that sets the default that the Get Device
Id command should use in the event the interface is unavailable or that
there is a dbus error.

The default value for the state of the BMC is true.  Currently, the
service in OpenBMC providing the real value via the dbus interface
simply checks that a systemd target is Active.  The systemd target
checked is the one that starts all the OpenBmc default services,
including ipmid.

Signed-off-by: Patrick Venture <venture@google.com>
Change-Id: Iba2c8308544337490905b0b48ba95785e0d775d4
1 file changed