ExecWorker
- class ClusterShell.Worker.Exec.ExecWorker(nodes, handler, timeout=None, **kwargs)[source]
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.
- COPY_CLASS
alias of
CopyClient
- SHELL_CLASS
alias of
ExecClient
- __init__(nodes, handler, timeout=None, **kwargs)[source]
Create an ExecWorker and its engine client instances.