mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Fix get_hostname to handle longer computer names
This commit is contained in:
parent
f3ae3cd5c8
commit
7ca3fd7484
1 changed files with 2 additions and 3 deletions
|
@ -448,10 +448,9 @@ def get_hostname():
|
|||
|
||||
salt 'minion-id' system.get_hostname
|
||||
'''
|
||||
cmd = 'wmic computersystem get name'
|
||||
cmd = 'hostname'
|
||||
ret = __salt__['cmd.run'](cmd=cmd)
|
||||
_, hostname = ret.split("\n")
|
||||
return hostname
|
||||
return ret
|
||||
|
||||
|
||||
def set_hostname(hostname):
|
||||
|
|
Loading…
Add table
Reference in a new issue