Corrects error message for ping errors from server behavior
* Modified ServerUnreachable message to return whatever message is passed to it * Modified Windows and Linux clients to pass a full failure message rather than just an IP address. Change-Id: Ifc64b28063b1a3584568711f9ff8e4b77b5be399
This commit is contained in:
		@@ -57,7 +57,9 @@ class LinuxClient(RemoteInstanceClient):
 | 
			
		||||
                break
 | 
			
		||||
            time.sleep(retry_interval)
 | 
			
		||||
            if int(time.time()) - start >= connection_timeout:
 | 
			
		||||
                raise ServerUnreachable(ip_address)
 | 
			
		||||
                raise ServerUnreachable(
 | 
			
		||||
                    'Could not reach the server at {ip_address}'.format(
 | 
			
		||||
                        ip_address=ip_address))
 | 
			
		||||
 | 
			
		||||
        if key is not None:
 | 
			
		||||
            auth_strategy = SSHAuthStrategy.KEY_STRING
 | 
			
		||||
 
 | 
			
		||||
@@ -49,7 +49,9 @@ class WindowsClient(RemoteInstanceClient):
 | 
			
		||||
        if not self._is_instance_reachable(
 | 
			
		||||
                ip_address=ip_address, retry_interval=retry_interval,
 | 
			
		||||
                timeout=connection_timeout):
 | 
			
		||||
            raise ServerUnreachable(ip_address)
 | 
			
		||||
            raise ServerUnreachable(
 | 
			
		||||
                'Could not reach the server at {ip_address}'.format(
 | 
			
		||||
                    ip_address=ip_address))
 | 
			
		||||
 | 
			
		||||
        self.ip_address = ip_address
 | 
			
		||||
        self.username = username
 | 
			
		||||
 
 | 
			
		||||
@@ -164,8 +164,8 @@ class WinRMConnectionException(Exception):
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class ServerUnreachable(Exception):
 | 
			
		||||
    def __init__(self, address):
 | 
			
		||||
        self.message = 'Could not reach the server at %s.' % address
 | 
			
		||||
    def __init__(self, message):
 | 
			
		||||
        self.message = message
 | 
			
		||||
 | 
			
		||||
    def __str__(self):
 | 
			
		||||
        return repr(self.message)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user