From e6e287446a289bce19f8a4d9f97bd415d1084bbc Mon Sep 17 00:00:00 2001 From: Zack Cerza Date: Fri, 25 Apr 2014 11:36:43 -0500 Subject: [PATCH] Fix Cluster.__repr__() Signed-off-by: Zack Cerza --- teuthology/orchestra/cluster.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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, -- 2.47.3