mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #28541 from twangboy/fix_28173
Fixed problem with system.set_computer_name
This commit is contained in:
commit
1e09f186ce
1 changed files with 3 additions and 1 deletions
|
@ -17,6 +17,7 @@ from datetime import datetime
|
|||
try:
|
||||
import win32net
|
||||
import win32api
|
||||
import win32con
|
||||
import pywintypes
|
||||
from ctypes import windll
|
||||
HAS_WIN32NET_MODS = True
|
||||
|
@ -244,7 +245,8 @@ def set_computer_name(name):
|
|||
if name:
|
||||
name = name.decode('utf-8')
|
||||
|
||||
if windll.kernel32.SetComputerNameW(name):
|
||||
if windll.kernel32.SetComputerNameExW(win32con.ComputerNamePhysicalDnsHostname,
|
||||
name):
|
||||
ret = {'Computer Name': {'Current': get_system_info()['name']}}
|
||||
pending = get_pending_computer_name()
|
||||
if pending not in (None, False):
|
||||
|
|
Loading…
Add table
Reference in a new issue