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

Class WorkerPdsh

source code


ClusterShell pdsh-based worker Class.

Remote Shell (pdsh) usage example:

>>> worker = WorkerPdsh(nodeset, handler=MyEventHandler(),
...                     timeout=30, command="/bin/hostname")
>>> task.schedule(worker)      # schedule worker for execution
>>> task.resume()              # run

Remote Copy (pdcp) usage example:

>>> worker = WorkerPdsh(nodeset, handler=MyEventHandler(),
...                     timeout=30, source="/etc/my.conf",
...                     dest="/etc/my.conf")
>>> task.schedule(worker)      # schedule worker for execution
>>> task.resume()              # run

Known limitations:

Instance Methods [hide private]
 
__init__(self, nodes, handler, timeout, **kwargs)
Initialize Pdsh worker instance.
source code
 
_engine_clients(self)
Return a list of underlying engine clients.
source code
 
_start(self)
Start worker, initialize buffers, prepare command.
source code
 
write(self, buf)
Write data to process.
source code
 
_close(self, force, timeout)
Close worker.
source code
 
_parse_line(self, line, stderr)
Parse Pdsh line syntax.
source code
 
_handle_read(self)
Engine is telling us a read is available.
source code
 
_handle_error(self)
Engine is telling us an error read is available.
source code
 
_on_node_rc(self, node, rc)
Return code received from a node, update last* stuffs.
source code

Inherited from EngineClient.EngineClient: error_fileno, reader_fileno, writer_fileno

Inherited from Engine.Engine.EngineBaseTimer: invalidate, is_valid, set_nextfire

Inherited from Engine.Engine.EngineBaseTimer (private): _set_engine

Inherited from Worker.DistantWorker: iter_buffers, iter_errors, iter_keys_timeout, iter_node_buffers, iter_node_errors, iter_node_retcodes, iter_retcodes, last_error, last_node, last_read, last_retcode, node_buffer, node_error, node_error_buffer, node_rc, node_retcode, num_timeout

Inherited from Worker.Worker: did_timeout, flush_buffers, flush_errors

Inherited from Worker.Worker (private): _invoke, _set_task, _task_bound_check

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, nodes, handler, timeout, **kwargs)
(Constructor)

source code 

Initialize Pdsh worker instance.

Overrides: object.__init__

_engine_clients(self)

source code 

Return a list of underlying engine clients.

Overrides: Worker.Worker._engine_clients
(inherited documentation)

_start(self)

source code 

Start worker, initialize buffers, prepare command.

Overrides: EngineClient.EngineClient._start

write(self, buf)

source code 

Write data to process. Not supported with Pdsh worker.

_close(self, force, timeout)

source code 

Close worker. Called by engine after worker has been unregistered. This method should handle all termination types (normal, forced or on timeout).

Overrides: EngineClient.EngineClient._close

_handle_read(self)

source code 

Engine is telling us a read is available.

Overrides: EngineClient.EngineClient._handle_read

_handle_error(self)

source code 

Engine is telling us an error read is available.

Overrides: EngineClient.EngineClient._handle_error

_on_node_rc(self, node, rc)

source code 

Return code received from a node, update last* stuffs.

Overrides: Worker.DistantWorker._on_node_rc