summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAsmitha Karunanithi <asmitk01@in.ibm.com>2021-11-29 17:43:30 +0300
committerEd Tanous <ed@tanous.net>2021-12-05 00:25:53 +0300
commit889ff6943d62762eeaf58824b651d2edaf940d1d (patch)
tree07579acbe0217d6c255410ccf91db2b9130be457
parent4dd5a4c0eddcd6f2411203025b3ec0dfbf8d6503 (diff)
downloadbmcweb-889ff6943d62762eeaf58824b651d2edaf940d1d.tar.xz
Enhance logs for networkd, hypervisor networkd app
Everytime a user does a GET on the ethernet interface redfish endpoint the journal logs gets filled with errors like the following: curl command: GET https://${bmc}/redfish/v1/Managers/bmc/EthernetInterfaces/eth1 GET https://${bmc}/redfish/v1/Systems/hypervisor/EthernetInterfaces/eth1 [ERROR "hyperv \ isor_system.hpp":211] Got extra property: Type on the /xyz/openbmc_pr \ oject/network/hypervisor/eth0/ipv4/addr0 object [ERROR "ethernet.hpp":499] Got extra property: Type on the \ /xyz/openbmc_project/network/hypervisor/eth0/ipv4/addr0 object While extracting the ip object, the properties Type & Gateway in the implementation are logged as errors, but they are not. The reason is, these two properties are not used but only the origin, prefix length, and address are fetched from the dbus to fill the ipv<4/6>config object. This commit avoids logging the above properties as errors. If there are properties other than these, then error will logged. Tested By: Before the changes: Nov 26 06:10:46 bmc bmcweb[264]: (2021-11-26 06:10:46) [ERROR "hyperv \ isor_system.hpp":211] Got extra property: Type on the /xyz/openbmc_pr \ oject/network/hypervisor/eth0/ipv4/addr0 object Nov 26 06:10:46 bmc bmcweb[264]: (2021-11-26 06:10:46) [ERROR "hyperv \ isor_system.hpp":211] Got extra property: Origin on the /xyz/openbmc_ \ project/network/hypervisor/eth1/ipv4/addr0 object Nov 26 06:10:46 bmc bmcweb[264]: (2021-11-26 06:10:46) [ERROR "hyperv \ isor_system.hpp":211] Got extra property: Type on the /xyz/openbmc_pr \ oject/network/hypervisor/eth1/ipv4/addr0 object After changes: These traces wont be logged as errors. Signed-off-by: Asmitha Karunanithi <asmitk01@in.ibm.com> Change-Id: I7160d3f71121a9758124a7c29517176e396c333e
-rw-r--r--redfish-core/lib/ethernet.hpp10
-rw-r--r--redfish-core/lib/hypervisor_system.hpp6
2 files changed, 16 insertions, 0 deletions
diff --git a/redfish-core/lib/ethernet.hpp b/redfish-core/lib/ethernet.hpp
index 6723d5bd18..f7fbb9575b 100644
--- a/redfish-core/lib/ethernet.hpp
+++ b/redfish-core/lib/ethernet.hpp
@@ -494,6 +494,11 @@ inline void
ipv6Address.prefixLength = *prefix;
}
}
+ else if (property.first == "Type" ||
+ property.first == "Gateway")
+ {
+ // Type & Gateway is not used
+ }
else
{
BMCWEB_LOG_ERROR
@@ -568,6 +573,11 @@ inline void
ipv4Address.netmask = getNetmask(*mask);
}
}
+ else if (property.first == "Type" ||
+ property.first == "Gateway")
+ {
+ // Type & Gateway is not used
+ }
else
{
BMCWEB_LOG_ERROR
diff --git a/redfish-core/lib/hypervisor_system.hpp b/redfish-core/lib/hypervisor_system.hpp
index 54166a7f66..01d7528332 100644
--- a/redfish-core/lib/hypervisor_system.hpp
+++ b/redfish-core/lib/hypervisor_system.hpp
@@ -261,6 +261,12 @@ inline bool extractHypervisorInterfaceData(
ipv4Address.netmask = getNetmask(*mask);
}
}
+ else if (property.first == "Type" ||
+ property.first == "Gateway")
+ {
+ // Type & Gateway is not used
+ continue;
+ }
else
{
BMCWEB_LOG_ERROR