From 49a59d129207f5bc090b45afde2d607980467b29 Mon Sep 17 00:00:00 2001 From: Tomas Babej Date: Mon, 7 Apr 2014 21:37:09 +0200 Subject: 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 --- ipatests/test_integration/host.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'ipatests/test_integration') diff --git a/ipatests/test_integration/host.py b/ipatests/test_integration/host.py index a57e3763c..94440c187 100644 --- a/ipatests/test_integration/host.py +++ b/ipatests/test_integration/host.py @@ -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() -- cgit