Package schrodinger :: Package job :: Module remote_command
[hide private]
[frames] | no frames]

Module remote_command

Classes [hide private]
  CommandError
Used to report external commands that fail.
Functions [hide private]
string
which(program, search_path=None)
Search for a file in the given list of directories.
 
get_home_dir()
Return the user's home directory.
 
get_rsh_exec()
Return the name of the rsh-compatible program to use for executing remote commands.
 
shell()
Return the pathname to a Bourne-compatible shell that can be used for running shell commands.
string
remote_command(host, user, command, capture_stderr=False)
Execute a the given command on a particular host.
list
_rsh_cmd(remotehost, remoteuser=None, nostdin=True)
Returns the 'ssh' command needed to execute a remote command on the given host.
 
rsh_test(hosts)
Test remote commands to and from one or more hosts.
Variables [hide private]
  logger = log.getLogger('jobc.rcmd')
  handler = log.StreamHandler(sys.stdout)
  rsh_timeout = 60
  rsh_max_retries = 1
  test_reverse_rsh = False
  schrodinger_dir = '/nfs/builds/objects/OB/alpaca/Linux-x86_64/...
  shell_exec = None
hash(x)
  rsh_exec = None
hash(x)
  rsh_src = None
hash(x)
  __package__ = 'schrodinger.job'
Function Details [hide private]

which(program, search_path=None)

 

Search for a file in the given list of directories. Use $PATH if no search path is specified.

Returns the absolute pathname for the first executable found.

Parameters:
  • rogram - the executable to search for
  • program (string)
Returns: string
the absolute pathname for the executable found, or None if the program could not be found.

get_home_dir()

 

Return the user's home directory. (Returns the %PROFILE%' directory for Windows.)

remote_command(host, user, command, capture_stderr=False)

 

Execute a the given command on a particular host.

Returns a tuple containing the captured output and an error message.

Parameters:
  • host (string) - the host on which to run the command
  • user (string) - the user account under which to run the command
  • command (string) - the command to be executed on the remote machine
  • capture_stderr (boolean) - should stderr be captured along with stdout?
Returns: string
the captured output from the command
Raises:

_rsh_cmd(remotehost, remoteuser=None, nostdin=True)

 

Returns the 'ssh' command needed to execute a remote command on the given host. The actual remote command needs to be appended to the returned string.

Parameters:
  • host (string) - string
  • user (string) - string
  • nostdin (boolean) - should stdin be closed for this command?
Returns: list
the list of command args for the remote command, suitable for use in subprocess functions

Variables Details [hide private]

schrodinger_dir

Value:
'/nfs/builds/objects/OB/alpaca/Linux-x86_64/build23'