Module clush
[hide private]
[frames] | no frames]

Module clush

source code

Utility program to run commands on a cluster using the ClusterShell library.

clush is a pdsh-like command 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.


Version: 1.3

Classes [hide private]
  Display
Output display class for clush script.
  UpdatePromptException
Exception used by the signal handler
  StdInputHandler
Standard input event handler class.
  DirectOutputHandler
Direct output event handler class.
  GatherOutputHandler
Gathered output event handler class.
  RunTimer
  ClushConfigError
Exception used by ClushConfig to report an error.
  ClushConfig
Config class for clush (specialized ConfigParser)
Functions [hide private]
 
nodeset_cmp(ns1, ns2)
Compare 2 nodesets by their length (we want larger nodeset first) and then by first node.
source code
 
bufnodeset_cmp(bn1, bn2)
Convenience function to compare 2 (buf, nodeset) tuples by their nodeset length (we want larger nodeset first) and then by first node.
source code
 
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, gather, timeout, verbosity, display)
Manage the interactive prompt to run command
source code
 
bind_stdin(worker)
Create a ClusterShell stdin-reader worker bound to specified worker.
source code
 
run_command(task, cmd, ns, gather, timeout, verbosity, display)
Create and run the specified command line, displaying results in a dshbak way when gathering is used.
source code
 
run_copy(task, source, dest, ns, timeout, preserve_flag, display)
run copy command
source code
 
clush_exit(status) source code
 
clush_excepthook(type, value, traceback)
Exceptions hook for clush: this method centralizes exception handling from main thread and from (possible) separate task thread.
source code
 
clush_main(args)
Main clush script function
source code
Variables [hide private]
  VERB_QUIET = 0
  VERB_STD = 1
  VERB_VERB = 2
  VERB_DEBUG = 3
  WHENCOLOR_CHOICES = ['never', 'always', 'auto']
  __package__ = None
Function Details [hide private]

clush_excepthook(type, value, 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.