mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Modify the way a FQDN is handled in the vmware cloud provider.
This commit is contained in:
parent
a0716643e4
commit
4b8dfb326f
1 changed files with 3 additions and 2 deletions
|
@ -2594,14 +2594,15 @@ def create(vm_):
|
|||
non_hostname_chars = compile(r'[^\w-]')
|
||||
if search(non_hostname_chars, vm_name):
|
||||
hostName = split(non_hostname_chars, vm_name, maxsplit=1)[0]
|
||||
domainName = split(non_hostname_chars, vm_name, maxsplit=1)[-1]
|
||||
else:
|
||||
hostName = vm_name
|
||||
domainName = hostName.split('.', 1)[-1]
|
||||
domainName = domain
|
||||
|
||||
if 'Windows' not in object_ref.config.guestFullName:
|
||||
identity = vim.vm.customization.LinuxPrep()
|
||||
identity.hostName = vim.vm.customization.FixedName(name=hostName)
|
||||
identity.domain = domainName if hostName != domainName else domain
|
||||
identity.domain = domainName
|
||||
else:
|
||||
identity = vim.vm.customization.Sysprep()
|
||||
identity.guiUnattended = vim.vm.customization.GuiUnattended()
|
||||
|
|
Loading…
Add table
Reference in a new issue