summaryrefslogtreecommitdiffstats
path: root/ipatests/test_integration/host.py
diff options
context:
space:
mode:
authorTomas Babej <tbabej@redhat.com>2014-04-07 21:37:09 +0200
committerPetr Viktorin <pviktori@redhat.com>2014-04-17 16:31:11 +0200
commit49a59d129207f5bc090b45afde2d607980467b29 (patch)
treeef67a34861478c985c7d9efd8813740dcdb53032 /ipatests/test_integration/host.py
parent24aa0a91e5376236a76ca3d8a371b75c584c9327 (diff)
downloadfreeipa-49a59d129207f5bc090b45afde2d607980467b29.tar.gz
freeipa-49a59d129207f5bc090b45afde2d607980467b29.tar.xz
freeipa-49a59d129207f5bc090b45afde2d607980467b29.zip
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>
Diffstat (limited to 'ipatests/test_integration/host.py')
-rw-r--r--ipatests/test_integration/host.py6
1 files changed, 5 insertions, 1 deletions
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()