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:

Nested Classes [hide private]
  SHELL_CLASS
EngineClient which run 'pdsh'
  COPY_CLASS
EngineClient when pdsh is run to copy file, using pdcp.
Instance Methods [hide private]
 
_create_clients(self, **kwargs)
Create several shell and copy engine client instances based on worker properties.
source code
 
write(self, buf)
Write data to process.
source code
 
set_write_eof(self)
Tell worker to close its writer file descriptor once flushed.
source code

Inherited from Exec.ExecWorker: __init__, abort

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, read

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

Class Variables [hide private]

Inherited from Worker.Worker: SNAME_STDERR, SNAME_STDIN, SNAME_STDOUT

Instance Variables [hide private]

Inherited from Worker.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]

_create_clients(self, **kwargs)

source code 

Create several shell and copy engine client instances based on worker properties.

Additional arguments in `kwargs' will be used for client creation. There will be one client per node in self.nodes

Overrides: Exec.ExecWorker._create_clients
(inherited documentation)

write(self, buf)

source code 

Write data to process. Not supported with Pdsh worker.

Overrides: Exec.ExecWorker.write

set_write_eof(self)

source code 

Tell worker to close its writer file descriptor once flushed. Do not perform writes after this call.

Not supported by PDSH Worker.

Overrides: Exec.ExecWorker.set_write_eof