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

Class WorkerSsh

source code


ClusterShell ssh-based worker Class.

Remote Shell (ssh) usage example:

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

Remote Copy (scp) usage example:

>>> worker = WorkerSsh(nodeset, handler=MyEventHandler(),
...                    timeout=30, source="/etc/my.conf",
...                    dest="/etc/my.conf")
>>> task.schedule(worker)      # schedule worker for execution
>>> task.resume()              # run
Instance Methods [hide private]
 
__init__(self, nodes, handler, timeout, **kwargs)
Initialize Ssh worker instance.
source code
 
_engine_clients(self)
Access underlying engine clients.
source code
 
_on_node_rc(self, node, rc)
Return code received from a node, update last* stuffs.
source code
 
_on_node_timeout(self, node)
Update on node timeout.
source code
 
_check_fini(self) source code
 
write(self, buf)
Write to worker clients.
source code
 
set_write_eof(self)
Tell worker to close its writer file descriptor once flushed.
source code

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 Ssh worker instance.

Overrides: object.__init__

_engine_clients(self)

source code 

Access underlying engine clients.

Overrides: Worker.Worker._engine_clients

_on_node_rc(self, node, rc)

source code 

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

Overrides: Worker.DistantWorker._on_node_rc
(inherited documentation)

_on_node_timeout(self, node)

source code 

Update on node timeout.

Overrides: Worker.DistantWorker._on_node_timeout
(inherited documentation)

set_write_eof(self)

source code 

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