def set_servers(*servers):
 service_name = 'w32time'
 if (not __salt__['service.status'](service_name)):
  if (not __salt__['service.start'](service_name)):
   return False
 server_cmd = ['W32tm', '/config', '/syncfromflags:manual', '/manualpeerlist:{0}'.format(' '.join(servers))]
 reliable_cmd = ['W32tm', '/config', '/reliable:yes']
 update_cmd = ['W32tm', '/config', '/update']
 for cmd in (server_cmd, reliable_cmd, update_cmd):
  ret = __salt__['cmd.run'](cmd, python_shell=False)
  if ('command completed successfully' not in ret):
   return False
 __salt__['service.restart'](service_name)
 return True

def set_servers ( * servers ) : service_name = 'w32time' if ( not __salt__ [ 'service.status' ] ( service_name ) ) : if ( not __salt__ [ 'service.start' ] ( service_name ) ) : return False server_cmd = [ 'W32tm' , '/config' , '/syncfromflags:manual' , '/manualpeerlist:{0}' . format ( ' ' . join ( servers ) ) ] reliable_cmd = [ 'W32tm' , '/config' , '/reliable:yes' ] update_cmd = [ 'W32tm' , '/config' , '/update' ] for cmd in ( server_cmd , reliable_cmd , update_cmd ) : ret = __salt__ [ 'cmd.run' ] ( cmd , python_shell = False ) if ( 'command completed successfully' not in ret ) : return False __salt__ [ 'service.restart' ] ( service_name ) return True
configures a list of ntp servers on the device .