Don't return a 500 error for entries without priority metadata
This change makes an entry with no priority metadata default to
"OK" instead of returning a 500 error.
Tested:
Logged an entry without priority and confirmed that getting the
Entries returns 200.
Passed the Redfish Service Validator.
Change-Id: I5a4633ef8542da6eaacad28953e5c99d992576fa
Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
diff --git a/redfish-core/lib/log_services.hpp b/redfish-core/lib/log_services.hpp
index 578e673..9fd35a9 100644
--- a/redfish-core/lib/log_services.hpp
+++ b/redfish-core/lib/log_services.hpp
@@ -1254,7 +1254,6 @@
if (ret < 0)
{
BMCWEB_LOG_ERROR << "Failed to read PRIORITY field: " << strerror(-ret);
- return 1;
}
// Get the Created time from the timestamp
@@ -1275,8 +1274,7 @@
{"Message", msg},
{"EntryType", "Oem"},
{"Severity",
- severity <= 2 ? "Critical"
- : severity <= 4 ? "Warning" : severity <= 7 ? "OK" : ""},
+ severity <= 2 ? "Critical" : severity <= 4 ? "Warning" : "OK"},
{"OemRecordFormat", "BMC Journal Entry"},
{"Created", std::move(entryTimeStr)}};
return 0;