diff options
author | Ed Tanous <ed@tanous.net> | 2020-09-30 01:15:03 +0300 |
---|---|---|
committer | Ed Tanous <ed@tanous.net> | 2020-10-05 20:42:59 +0300 |
commit | d4d25793d79eeee62a5b7f199410c0578070dce1 (patch) | |
tree | 0b2a6c8a5fa4c6f97d5b69cbf850dc0daed87234 /redfish-core/lib/log_services.hpp | |
parent | f2a4a60698a41fbf23e933daaea5df66cde19e53 (diff) | |
download | bmcweb-d4d25793d79eeee62a5b7f199410c0578070dce1.tar.xz |
Implement bugprone-branch-clone compliance
As part of getting the clang-tidy bugprone tests running, these
conditionals were found to have duplicate entries, or be somewhat
nonsensical.
Tested: clang-tidy now passes with the branch-compliance check set.
Change-Id: Ibec106f3bbd866fc471a1fc56bd8cdd5d44024e0
Diffstat (limited to 'redfish-core/lib/log_services.hpp')
-rw-r--r-- | redfish-core/lib/log_services.hpp | 29 |
1 files changed, 7 insertions, 22 deletions
diff --git a/redfish-core/lib/log_services.hpp b/redfish-core/lib/log_services.hpp index 0e93f5ce34..777f37ef1d 100644 --- a/redfish-core/lib/log_services.hpp +++ b/redfish-core/lib/log_services.hpp @@ -107,31 +107,16 @@ using GetManagedObjectsType = boost::container::flat_map< inline std::string translateSeverityDbusToRedfish(const std::string& s) { - if (s == "xyz.openbmc_project.Logging.Entry.Level.Alert") + if ((s == "xyz.openbmc_project.Logging.Entry.Level.Alert") || + (s == "xyz.openbmc_project.Logging.Entry.Level.Critical") || + (s == "xyz.openbmc_project.Logging.Entry.Level.Emergency") || + (s == "xyz.openbmc_project.Logging.Entry.Level.Error")) { return "Critical"; } - else if (s == "xyz.openbmc_project.Logging.Entry.Level.Critical") - { - return "Critical"; - } - else if (s == "xyz.openbmc_project.Logging.Entry.Level.Debug") - { - return "OK"; - } - else if (s == "xyz.openbmc_project.Logging.Entry.Level.Emergency") - { - return "Critical"; - } - else if (s == "xyz.openbmc_project.Logging.Entry.Level.Error") - { - return "Critical"; - } - else if (s == "xyz.openbmc_project.Logging.Entry.Level.Informational") - { - return "OK"; - } - else if (s == "xyz.openbmc_project.Logging.Entry.Level.Notice") + else if ((s == "xyz.openbmc_project.Logging.Entry.Level.Debug") || + (s == "xyz.openbmc_project.Logging.Entry.Level.Informational") || + (s == "xyz.openbmc_project.Logging.Entry.Level.Notice")) { return "OK"; } |