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.2

Classes [hide private]
  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 the signal handler
  ClushConfig
Config class for clush (specialized ConfigParser)
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
 
print_buffer(header, content)
Display a dshbak-like header block and content.
source code
 
print_lines(header, msg)
Display a MsgTree buffer by line with prefixed header.
source code
 
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
 
ttyloop(task, nodeset, gather, timeout, label, verbosity, gather_print)
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, label, verbosity, gather_print)
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)
run copy command
source code
 
clush_exit(status) 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
  __package__ = None