diff --git a/cloudcafe/compute/common/clients/remote_instance/linux/linux_client.py b/cloudcafe/compute/common/clients/remote_instance/linux/linux_client.py index 22a6be31..35c3a081 100644 --- a/cloudcafe/compute/common/clients/remote_instance/linux/linux_client.py +++ b/cloudcafe/compute/common/clients/remote_instance/linux/linux_client.py @@ -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 diff --git a/cloudcafe/compute/common/clients/remote_instance/windows/windows_client.py b/cloudcafe/compute/common/clients/remote_instance/windows/windows_client.py index 0c01f55b..738ea1c2 100644 --- a/cloudcafe/compute/common/clients/remote_instance/windows/windows_client.py +++ b/cloudcafe/compute/common/clients/remote_instance/windows/windows_client.py @@ -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 diff --git a/cloudcafe/compute/common/exceptions.py b/cloudcafe/compute/common/exceptions.py index c857e5cb..7a63a6c4 100644 --- a/cloudcafe/compute/common/exceptions.py +++ b/cloudcafe/compute/common/exceptions.py @@ -157,15 +157,15 @@ class WinRMConnectionException(Exception): def __init__(self, ip_address): self.message = ( 'Unable to connect to {ip_address} via WinRM.').format( - ip_address=ip_address) + ip_address=ip_address) def __str__(self): return repr(self.message) 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)