ExecWorker(nodes, handler, timeout=None, **kwargs)¶
ClusterShell simple execution worker Class.
It runs commands locally. If a node list is provided, one command will be launched for each node and specific keywords will be replaced based on node name and rank.
Local shell usage example:
>>> worker = ExecWorker(nodeset, handler=MyEventHandler(), ... timeout=30, command="/bin/uptime") >>> task.schedule(worker) # schedule worker for execution >>> task.run() # run
Local copy usage example:
>>> worker = ExecWorker(nodeset, handler=MyEventHandler(), ... source="/etc/my.cnf", ... dest="/etc/my.cnf.bak") >>> task.schedule(worker) # schedule worker for execution >>> task.run() # run
connect_timeout option is ignored by this worker.
__init__(nodes, handler, timeout=None, **kwargs)¶
Create an ExecWorker and its engine client instances.
Abort processing any action by this worker.
Tell worker to close its writer file descriptors once flushed. Do not perform writes after this call.
Write to worker clients.
ExecClient(node, command, worker, stderr, timeout, autoclose=False, rank=None)¶
Run a simple local command.
Useful as a superclass for other more specific workers.