mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Return full pending computer name (#33483)
This commit is contained in:
parent
a89be5e9d4
commit
4f96cc1f54
1 changed files with 4 additions and 4 deletions
|
@ -287,7 +287,7 @@ def set_computer_name(name):
|
|||
|
||||
if windll.kernel32.SetComputerNameExW(win32con.ComputerNamePhysicalDnsHostname,
|
||||
name):
|
||||
ret = {'Computer Name': {'Current': get_system_info()['name']}}
|
||||
ret = {'Computer Name': {'Current': get_computer_name()}}
|
||||
pending = get_pending_computer_name()
|
||||
if pending not in (None, False):
|
||||
ret['Computer Name']['Pending'] = pending
|
||||
|
@ -315,8 +315,8 @@ def get_pending_computer_name():
|
|||
'''
|
||||
current = get_computer_name()
|
||||
pending = read_value('HKLM',
|
||||
r'SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName',
|
||||
'ComputerName')['vdata']
|
||||
r'SYSTEM\CurrentControlSet\Services\Tcpip\Parameters',
|
||||
'NV Hostname')['vdata']
|
||||
if pending:
|
||||
return pending if pending != current else None
|
||||
return False
|
||||
|
@ -335,7 +335,7 @@ def get_computer_name():
|
|||
|
||||
salt 'minion-id' system.get_computer_name
|
||||
'''
|
||||
name = get_system_info()['name']
|
||||
name = win32api.GetComputerNameEx(win32con.ComputerNamePhysicalDnsHostname)
|
||||
return name if name else False
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue