From: Zack Cerza Date: Fri, 25 Apr 2014 16:36:43 +0000 (-0500) Subject: Fix Cluster.__repr__() X-Git-Tag: 1.1.0~1523 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e6e287446a289bce19f8a4d9f97bd415d1084bbc;p=teuthology.git Fix Cluster.__repr__() Signed-off-by: Zack Cerza --- diff --git a/teuthology/orchestra/cluster.py b/teuthology/orchestra/cluster.py index 5dca13117..7d96dc1b0 100644 --- a/teuthology/orchestra/cluster.py +++ b/teuthology/orchestra/cluster.py @@ -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,