mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
ipatests: Allow using FQDN with trailing dot as final hostname
When creating a BaseHost instance, the machine's hostname was reconfigured to have the same shortname prepended the domain name of the domain where it was defined. However, it makes sense in certain use cases to define hosts that have hostnames other than belonging directly in the domain they were defined in. Treat input hostnames with trailing dots as static FQDNs that will not be changed by the name of the domain they were defined in. Reviewed-By: Petr Viktorin <pviktori@redhat.com>
This commit is contained in:
committed by
Petr Viktorin
parent
24aa0a91e5
commit
49a59d1292
@@ -41,7 +41,11 @@ class BaseHost(object):
|
||||
|
||||
shortname, dot, ext_domain = hostname.partition('.')
|
||||
self.shortname = shortname
|
||||
self.hostname = str(shortname + '.' + self.domain.name)
|
||||
|
||||
self.hostname = (hostname[:-1]
|
||||
if hostname.endswith('.')
|
||||
else shortname + '.' + self.domain.name)
|
||||
|
||||
self.external_hostname = str(external_hostname or hostname)
|
||||
|
||||
self.netbios = self.domain.name.split('.')[0].upper()
|
||||
|
||||
Reference in New Issue
Block a user