Move duplicate reduction
getEthernetIfaceData callback should ideally be returning exactly the
values the system has, minus duplicates. In every case this function is
used, we don't want duplicates, so move where we check for duplicates.
Tested: In conjunction with
https://gerrit.openbmc.org/c/openbmc/bmcweb/+/54829 test cases pass.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Ib202db99f70e1a6fdddf18969e15b2382e287848
diff --git a/redfish-core/lib/network_protocol.hpp b/redfish-core/lib/network_protocol.hpp
index 1d63bc9..1345677 100644
--- a/redfish-core/lib/network_protocol.hpp
+++ b/redfish-core/lib/network_protocol.hpp
@@ -83,6 +83,7 @@
}
}
}
+ stl_utils::removeDuplicate(ntpData);
}
template <typename CallbackFunc>
@@ -146,7 +147,6 @@
"NetworkProtocol");
return;
}
- stl_utils::removeDuplicate(ntpServers);
asyncResp->res.jsonValue["NTP"]["NTPServers"] = ntpServers;
if (!hostName.empty())
{