image_manager: Create error on machine mismatch

Currently the image manager only logs a journal entry if the machine
does not match. Create an error log so that it is easier to the user to
determine what the error is since an error log is exposed via REST and
the web interface. Use the existing ImageFailure error, as it seems
relevant to the machine not matching.

Tested: Verified a new ImageFailure error was created:
$ curl -k -H "X-Auth-Token: $token" \
https://${bmc}/xyz/openbmc_project/logging/entry/2
{
  "data": {
    "AdditionalData": [
      "FAIL=Machine name does not match",
      "PATH=/tmp/images/imageL4OiKL/MANIFEST",
      "_PID=487"
    ],
    "Message": "xyz.openbmc_project.Software.Image.Error.ImageFailure",

$ curl -k -H "X-Auth-Token: $token"
https://${bmc}/xyz/openbmc_project/logging/entry/4
{
  "data": {
    "AdditionalData": [
      "FAIL=MANIFEST is missing machine name",
      "PATH=/tmp/images/imageqwT1cj/MANIFEST",
      "_PID=477"
    ],
    "Message": "xyz.openbmc_project.Software.Image.Error.ImageFailure",

Change-Id: Ie6681acea51e328c4bfe5bbd3af9aff32e8e539d
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
1 file changed