Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cloudbaseinit/osutils/windows.py
Original file line number Diff line number Diff line change
Expand Up @@ -789,9 +789,9 @@ def set_ntp_client_config(self, ntp_hosts):

# Convert the NTP hosts list to a string, in order to pass
# it to w32tm.
ntp_hosts = ",".join(ntp_hosts)
ntp_hosts = " ".join(ntp_hosts)

args = [w32tm_path, '/config', '/manualpeerlist:%s' % ntp_hosts,
args = [w32tm_path, '/config', '/manualpeerlist:"%s"' % ntp_hosts,
'/syncfromflags:manual', '/update']

(out, err, ret_val) = self.execute_process(args, shell=False)
Expand Down
2 changes: 1 addition & 1 deletion cloudbaseinit/tests/osutils/test_windows.py
Original file line number Diff line number Diff line change
Expand Up @@ -2073,7 +2073,7 @@ def _test_set_ntp_client_config(self, mock_execute_process,
mock_get_system32_dir.return_value = fake_base_dir

args = [w32tm_path, '/config',
'/manualpeerlist:%s' % ",".join(ntp_hosts),
'/manualpeerlist:"%s"' % " ".join(ntp_hosts),
'/syncfromflags:manual', '/update']

if ret_val:
Expand Down