]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Fix Cluster.__repr__()
authorZack Cerza <zack@cerza.org>
Fri, 25 Apr 2014 16:36:43 +0000 (11:36 -0500)
committerZack Cerza <zack@cerza.org>
Fri, 25 Apr 2014 16:36:43 +0000 (11:36 -0500)
Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
teuthology/orchestra/cluster.py

index 5dca131179fe52694b92b0e5258a3ce8214bd6e9..7d96dc1b0b631142fc88653ce4edcb9492be3fa5 100644 (file)
@@ -4,6 +4,7 @@ part of context, Cluster is used to save connection information.
 """
 import teuthology.misc
 
+
 class Cluster(object):
     """
     Manage SSH connections to a cluster of machines.
@@ -11,7 +12,8 @@ class Cluster(object):
 
     def __init__(self, remotes=None):
         """
-        Initialize
+        :param remotes: A sequence of 2-tuples of this format:
+                            (Remote, [role_1, role_2 ...])
         """
         self.remotes = {}
         if remotes is not None:
@@ -21,7 +23,8 @@ class Cluster(object):
     def __repr__(self):
         remotes = [(k, v) for k, v in self.remotes.items()]
         remotes.sort(key=lambda tup: tup[0].name)
-        remotes = '{' + ', '.join('{remote!r}: {roles!r}'.format(remote=k, roles=v) for k, v in remotes) + '}'
+        remotes = '[' + ', '.join('[{remote!r}, {roles!r}]'.format(
+            remote=k, roles=v) for k, v in remotes) + ']'
         return '{classname}(remotes={remotes})'.format(
             classname=self.__class__.__name__,
             remotes=remotes,