Package ClusterShell :: Package Worker :: Module Worker :: Class DistantWorker
[hide private]
[frames] | no frames]

Class DistantWorker

source code


Base class DistantWorker.

DistantWorker provides a useful set of setters/getters to use with distant workers like ssh or pdsh.

Instance Methods [hide private]
 
_on_node_msgline(self, node, msg, sname)
Message received from node, update last* stuffs.
source code
 
_on_node_rc(self, node, rc)
Command return code received.
source code
 
_on_node_timeout(self, node)
Update on node timeout.
source code
 
last_node(self)
Get last node, useful to get the node in an EventHandler callback like ev_read().
source code
 
last_read(self)
Get last (node, buffer), useful in an EventHandler.ev_read() [DEPRECATED] use (current_node, current_msg)
source code
 
last_error(self)
Get last (node, error_buffer), useful in an EventHandler.ev_error() [DEPRECATED] use (current_node, current_errmsg)
source code
 
last_retcode(self)
Get last (node, rc), useful in an EventHandler.ev_hup() [DEPRECATED] use (current_node, current_rc)
source code
 
node_buffer(self, node)
Get specific node buffer.
source code
 
node_error(self, node)
Get specific node error buffer.
source code
 
node_error_buffer(self, node)
Get specific node error buffer.
source code
 
node_retcode(self, node)
Get specific node return code.
source code
 
node_rc(self, node)
Get specific node return code.
source code
 
iter_buffers(self, match_keys=None)
Returns an iterator over available buffers and associated NodeSet.
source code
 
iter_errors(self, match_keys=None)
Returns an iterator over available error buffers and associated NodeSet.
source code
 
iter_node_buffers(self, match_keys=None)
Returns an iterator over each node and associated buffer.
source code
 
iter_node_errors(self, match_keys=None)
Returns an iterator over each node and associated error buffer.
source code
 
iter_retcodes(self, match_keys=None)
Returns an iterator over return codes and associated NodeSet.
source code
 
iter_node_retcodes(self)
Returns an iterator over each node and associated return code.
source code
 
num_timeout(self)
Return the number of timed out "keys" (ie.
source code
 
iter_keys_timeout(self)
Iterate over timed out keys (ie.
source code

Inherited from Worker: __init__, abort, did_timeout, flush_buffers, flush_errors, read

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]

Inherited from Worker: SNAME_STDERR, SNAME_STDIN, SNAME_STDOUT

Instance Variables [hide private]

Inherited from Worker: current_errmsg, current_msg, current_node, current_rc, current_sname, eh, started, task

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

last_node(self)

source code 

Get last node, useful to get the node in an EventHandler callback like ev_read(). [DEPRECATED] use current_node

last_read(self)

source code 

Get last (node, buffer), useful in an EventHandler.ev_read() [DEPRECATED] use (current_node, current_msg)

Overrides: Worker.last_read

last_error(self)

source code 

Get last (node, error_buffer), useful in an EventHandler.ev_error() [DEPRECATED] use (current_node, current_errmsg)

Overrides: Worker.last_error

node_retcode(self, node)

source code 

Get specific node return code.

:raises KeyError: command on node has not yet finished (no return code
    available), or this node is not known by this worker

node_rc(self, node)

source code 

Get specific node return code.

:raises KeyError: command on node has not yet finished (no return code
    available), or this node is not known by this worker

iter_buffers(self, match_keys=None)

source code 

Returns an iterator over available buffers and associated NodeSet. If the optional parameter match_keys is defined, only keys found in match_keys are returned.

iter_errors(self, match_keys=None)

source code 

Returns an iterator over available error buffers and associated NodeSet. If the optional parameter match_keys is defined, only keys found in match_keys are returned.

iter_retcodes(self, match_keys=None)

source code 

Returns an iterator over return codes and associated NodeSet. If the optional parameter match_keys is defined, only keys found in match_keys are returned.

num_timeout(self)

source code 

Return the number of timed out "keys" (ie. nodes) for this worker.

iter_keys_timeout(self)

source code 

Iterate over timed out keys (ie. nodes) for a specific worker.