Package ClusterShell :: Package CLI :: Module Clush
[hide private]
[frames] | no frames]

Module Clush

source code

Execute cluster commands in parallel

clush is an utility program to run commands on a cluster which benefits from the ClusterShell library and its Ssh worker. It features an integrated output results gathering system (dshbak-like), can get node groups by running predefined external commands and can redirect lines read on its standard input to the remote commands.

When no command are specified, clush runs interactively.

Classes [hide private]
  UpdatePromptException
Exception used by the signal handler
  StdInputHandler
Standard input event handler class.
  OutputHandler
Base class for clush output handlers.
  DirectOutputHandler
Direct output event handler class.
  DirectProgressOutputHandler
Direct output event handler class with progress support.
  CopyOutputHandler
Copy output event handler.
  GatherOutputHandler
Gathered output event handler class (clush -b).
  SortedOutputHandler
Sorted by node output event handler class (clush -L).
  LiveGatherOutputHandler
Live line-gathered output event handler class (-bL).
  RunTimer
Running progress timer event handler
Functions [hide private]
 
signal_handler(signum, frame)
Signal handler used for main thread notification
source code
 
get_history_file()
Turn the history file path
source code
 
readline_setup()
Configure readline to automatically load and save a history file named .clush_history
source code
 
ttyloop(task, nodeset, timeout, display, remote)
Manage the interactive prompt to run command
source code
 
_stdin_thread_start(stdin_port, display)
Standard input reader thread entry point.
source code
 
bind_stdin(worker, display)
Create a stdin->port->worker binding: connect specified worker to stdin with the help of a reader thread and a ClusterShell Port object.
source code
 
run_command(task, cmd, ns, timeout, display, remote)
Create and run the specified command line, displaying results in a dshbak way when gathering is used.
source code
 
run_copy(task, sources, dest, ns, timeout, preserve_flag, display)
run copy command
source code
 
run_rcopy(task, sources, dest, ns, timeout, preserve_flag, display)
run reverse copy command
source code
 
set_fdlimit(fd_max, display)
Make open file descriptors soft limit the max.
source code
 
clush_exit(status, task=None)
Exit script, flushing stdio buffers and stopping ClusterShell task.
source code
 
clush_excepthook(extype, exp, traceback)
Exceptions hook for clush: this method centralizes exception handling from main thread and from (possible) separate task thread.
source code
 
main()
clush script entry point
source code
Variables [hide private]
  __package__ = 'ClusterShell.CLI'
Function Details [hide private]

clush_excepthook(extype, exp, traceback)

source code 

Exceptions hook for clush: this method centralizes exception handling from main thread and from (possible) separate task thread. This hook has to be previously installed on startup by overriding sys.excepthook and task.excepthook.