libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject git commit: Add __repr__ and __str__ methods.
Date Wed, 28 May 2014 15:19:13 GMT
Repository: libcloud
Updated Branches:
  refs/heads/trunk 1ad8e0396 -> 91f8df844


Add __repr__ and __str__ methods.


Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/91f8df84
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/91f8df84
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/91f8df84

Branch: refs/heads/trunk
Commit: 91f8df844a1dc0d288b969d89465b707a541efd6
Parents: 1ad8e03
Author: Tomaz Muraus <tomaz@apache.org>
Authored: Wed May 28 17:16:32 2014 +0200
Committer: Tomaz Muraus <tomaz@apache.org>
Committed: Wed May 28 17:16:32 2014 +0200

----------------------------------------------------------------------
 libcloud/compute/ssh.py | 7 +++++++
 1 file changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/91f8df84/libcloud/compute/ssh.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/ssh.py b/libcloud/compute/ssh.py
index fe9d856..af9c43a 100644
--- a/libcloud/compute/ssh.py
+++ b/libcloud/compute/ssh.py
@@ -64,6 +64,13 @@ class SSHCommandTimeoutError(Exception):
         message = 'Command didn\'t finish in %s seconds' % (timeout)
         super(SSHCommandTimeoutError, self).__init__(message)
 
+    def __repr__(self):
+        return ('<SSHCommandTimeoutError: cmd="%s",timeout=%s)>' %
+                (self.cmd, self.timeout))
+
+    def __str__(self):
+        return self.message
+
 
 class BaseSSHClient(object):
     """


Mime
View raw message