summaryrefslogtreecommitdiffstats
path: root/doctor_tests
diff options
context:
space:
mode:
authordongwenjuan <dong.wenjuan@zte.com.cn>2019-09-29 14:07:20 +0800
committerdongwenjuan <dong.wenjuan@zte.com.cn>2019-09-29 14:44:01 +0800
commite961ab783887a9c44d2a321df646f1c49f83b299 (patch)
tree1b4f9fde75100aab1054097aa305105b127a66df /doctor_tests
parent7bba7d67beec7b3db26ab1319bf4080565053096 (diff)
use hostname without domain name & fix the `find` command in tox
Change-Id: I719c46a8b5407b565cf0b6df4cd9b4c95a6a8ce5 Signed-off-by: dongwenjuan <dong.wenjuan@zte.com.cn>
Diffstat (limited to 'doctor_tests')
-rw-r--r--doctor_tests/scenario/fault_management.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/doctor_tests/scenario/fault_management.py b/doctor_tests/scenario/fault_management.py
index 5216aa80..0271dffe 100644
--- a/doctor_tests/scenario/fault_management.py
+++ b/doctor_tests/scenario/fault_management.py
@@ -111,7 +111,10 @@ class FaultManagement(object):
server = servers.get(vm_name)
if not server:
raise Exception('Can not find instance: vm_name(%s)' % vm_name)
- host_name = server.__dict__.get('OS-EXT-SRV-ATTR:hypervisor_hostname')
+ # use hostname without domain name which is mapped to the cell
+ hostname = \
+ server.__dict__.get('OS-EXT-SRV-ATTR:hypervisor_hostname')
+ host_name = hostname.split('.')[0]
host_ip = self.installer.get_host_ip_from_hostname(host_name)
self.log.info('Get host info(name:%s, ip:%s) which vm(%s) launched at'