Fix problem with detecting of host ip in vCenter environment

Change-Id: Icfa110979ac6f234a815adcc5677206102ee2095
Closes-Bug: 1527133
This commit is contained in:
Ilya Bumarskov 2015-12-17 16:47:18 +03:00
parent 9910a4726c
commit 00bb415457
1 changed files with 2 additions and 20 deletions

View File

@ -16,7 +16,6 @@
import logging
import os
import socket
import time
import traceback
@ -762,23 +761,6 @@ class NovaNetworkScenarioTest(OfficialClientTest):
# TODO(???) Allow configuration of execution and sleep duration.
return fuel_health.test.call_until_true(ping, 40, 1)
def _find_network_host(self, timeout, retries):
"""Find host where nova-network works."""
if self.config.compute.use_vcenter:
command = "crm_mon -1|grep nova-network|awk {'print $4'}"
ssh = SSHClient(self.host[0],
self.usr, self.pwd,
key_filename=self.key,
timeout=timeout)
n_net_nodename = self.retry_command(retries[0],
retries[1],
ssh.exec_command,
cmd=command).strip()
get_n_net_nodename = socket.gethostbyname(n_net_nodename)
return get_n_net_nodename
else:
return self.host[0]
def _ping_ip_address_from_instance(self, ip_address, timeout,
retries, viaHost=None):
def ping():
@ -787,7 +769,7 @@ class NovaNetworkScenarioTest(OfficialClientTest):
'parameters are empty controller_node_name or '
'controller_node_ip ')
try:
host = viaHost or self._find_network_host(timeout, retries)
host = viaHost or self.host[0]
LOG.debug('Get ssh to instance')
ssh = SSHClient(host,
self.usr, self.pwd,
@ -817,7 +799,7 @@ class NovaNetworkScenarioTest(OfficialClientTest):
'parameters are empty controller_node_name or '
'controller_node_ip ')
try:
host = viaHost or self._find_network_host(timeout, retries)
host = viaHost or self.host[0]
LOG.debug('Get ssh to instance')
ssh = SSHClient(host,
self.usr, self.pwd,