Package ganeti :: Module rpc :: Class Client
[hide private]
[frames] | no frames]

Class Client

source code

RPC Client class.

This class, given a (remote) method name, a list of parameters and a list of nodes, will contact (in parallel) all nodes, and return a dict of results (key: node name, value: result).

One current bug is that generic failure is still signaled by 'False' result, which is not good. This overloading of values can cause bugs.

Instance Methods [hide private]
 
__init__(self, procedure, body, port, address_lookup_fn=_AddressLookup) source code
 
ConnectList(self, node_list, address_list=None, read_timeout=None)
Add a list of nodes to the target nodes.
source code
 
ConnectNode(self, name, address=None, read_timeout=None)
Add a node to the target list.
source code
list
GetResults(self, http_pool=None)
Call nodes and return results.
source code
Method Details [hide private]

ConnectList(self, node_list, address_list=None, read_timeout=None)

source code 

Add a list of nodes to the target nodes.

Parameters:
  • node_list (list) - the list of node names to connect
  • address_list (list or None) - either None or a list with node addresses, which must have the same length as the node list
  • read_timeout (int) - overwrites default timeout for operation

ConnectNode(self, name, address=None, read_timeout=None)

source code 

Add a node to the target list.

Parameters:
  • name (str) - the node name
  • address (str) - the node address, if known
  • read_timeout (int) - overwrites default timeout for operation

GetResults(self, http_pool=None)

source code 

Call nodes and return results.

Returns: list
List of RPC results