NTP: Remove workaround for empty list array
This workaround is no longer needed with bmcweb.
curl -k -H "Content-Type: application/json" -X PUT \
-d '{"data": [] }' \
https://${bmc}/xyz/openbmc_project/network/eth0/attr/NTPServers
See https://github.com/openbmc/openbmc/issues/3240
Tested: Built and loaded on a Witherspoon. Added, removed, and
edited NTP servers.
Change-Id: Ia106067a479c63a5761b1f62c624d3ccc6df55c7
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
diff --git a/app/configuration/controllers/date-time-controller.js b/app/configuration/controllers/date-time-controller.js
index d678ab4..92864db 100644
--- a/app/configuration/controllers/date-time-controller.js
+++ b/app/configuration/controllers/date-time-controller.js
@@ -164,15 +164,10 @@
};
function setNTPServers() {
- // Remove any empty strings from the array. Important because we add an
- // empty string to the end so the user can add a new NTP server, if the
+ // Remove any empty strings from the array. If the
// user doesn't fill out the field, we don't want to add.
$scope.ntp.servers = $scope.ntp.servers.filter(Boolean);
- // NTP servers does not allow an empty array, since we remove all empty
- // strings above, could have an empty array. TODO: openbmc/openbmc#3240
- if ($scope.ntp.servers.length == 0) {
- $scope.ntp.servers.push('');
- }
+
return APIUtils.setNTPServers($scope.ntp.servers);
}