VMware: remove blank from ntp server list (#44273)

Due to blank line returned from vCenter, wrong values were appended
to NTP server list. This fix adds filter for such blank values of NTP servers.

Fixes: #44183

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
pull/44303/head
Abhijeet Kasurde 6 years ago committed by GitHub
parent 57497a490b
commit 39e2bd01a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -118,6 +118,7 @@ class VmwareNtpConfigManager(PyVmomi):
host_date_time_manager = host.configManager.dateTimeSystem host_date_time_manager = host.configManager.dateTimeSystem
if host_date_time_manager: if host_date_time_manager:
available_ntp_servers = host_date_time_manager.dateTimeInfo.ntpConfig.server available_ntp_servers = host_date_time_manager.dateTimeInfo.ntpConfig.server
available_ntp_servers = list(filter(None, available_ntp_servers))
if operation == 'add': if operation == 'add':
available_ntp_servers = available_ntp_servers + ntp_servers available_ntp_servers = available_ntp_servers + ntp_servers
elif operation == 'delete': elif operation == 'delete':

Loading…
Cancel
Save