From 2711ea694a427f17256f28d36bec6b9afc6c0575 Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Wed, 15 Nov 2006 16:50:58 +0000 Subject: [PATCH] now returns a dict rather than a tuple --- PLC/Methods/RefreshPeer.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/PLC/Methods/RefreshPeer.py b/PLC/Methods/RefreshPeer.py index d8dbbc2..8f4aaef 100644 --- a/PLC/Methods/RefreshPeer.py +++ b/PLC/Methods/RefreshPeer.py @@ -19,10 +19,10 @@ class RefreshPeer(Method): Query a peer PLC for its list of nodes, and refreshes the local database accordingly - Returns a tuple containing - (*) the peer name - (*) the number of new nodes from that peer - may be negative - (*) the number of new slices from that peer - may be negative + Returns a dict containing + (*) 'plcname' : the peer name + (*) 'new_nodes' : the number of new nodes from that peer - may be negative + (*) 'new_slices': the number of new slices from that peer - may be negative """ roles = ['admin'] @@ -30,7 +30,7 @@ class RefreshPeer(Method): accepts = [ Auth(), Parameter (int, "Peer id") ] - returns = Parameter(int, "Delta in number of foreign nodes attached to that peer") + returns = Parameter(dict, "plcname, new_nodes, new_slices") def call (self, auth, peer_id): @@ -69,4 +69,6 @@ class RefreshPeer(Method): peer_get_slices = apiserver.GetSlices(auth) nb_new_slices = peer.refresh_slices(peer_get_slices,peer_foreign_nodes) - return (self.api.config.PLC_NAME,nb_new_nodes,nb_new_slices) + return {'plcname':self.api.config.PLC_NAME, + 'new_nodes':nb_new_nodes, + 'new_slices':nb_new_slices} -- 2.43.0