Warning

This document is for an in-development version of Galaxy. You can alternatively view this page in the latest release if it exists or view the top of the latest release's documentation.

galaxy.jobs.runners.util.cli.shell package

Abstract base class for runners which execute commands via a shell.

class galaxy.jobs.runners.util.cli.shell.BaseShellExec(*args, **kwargs)[source]

Bases: object

abstract __init__(*args, **kwargs)[source]

Constructor for shell executor instance.

execute(cmd, persist=False, timeout=60)[source]

Execute the specified command via defined shell.

Submodules

galaxy.jobs.runners.util.cli.shell.local module

class galaxy.jobs.runners.util.cli.shell.local.LocalShell(**kwds)[source]

Bases: galaxy.jobs.runners.util.cli.shell.BaseShellExec

>>> shell = LocalShell()
>>> def exec_python(script, **kwds): return shell.execute(['python', '-c', script], **kwds)
>>> exec_result = exec_python("from __future__ import print_function; print('Hello World')")
>>> exec_result.stderr == u''
True
>>> exec_result.stdout.strip() == u'Hello World'
True
>>> exec_result.returncode
0
>>> exec_result = exec_python("import time; time.sleep(10)", timeout=1, timeout_check_interval=.1)
>>> exec_result.stdout == u''
True
>>> exec_result.stderr == 'Execution timed out'
True
>>> exec_result.returncode == TIMEOUT_RETURN_CODE
True
>>> shell.execute('echo hi').stdout == "hi\n"
True
__init__(**kwds)[source]

Constructor for shell executor instance.

execute(cmd, persist=False, timeout=60, timeout_check_interval=3, **kwds)[source]

Execute the specified command via defined shell.

galaxy.jobs.runners.util.cli.shell.rsh module

class galaxy.jobs.runners.util.cli.shell.rsh.RemoteShell(rsh='rsh', rcp='rcp', hostname='localhost', username=None, options=None, **kwargs)[source]

Bases: galaxy.jobs.runners.util.cli.shell.local.LocalShell

__init__(rsh='rsh', rcp='rcp', hostname='localhost', username=None, options=None, **kwargs)[source]

Constructor for shell executor instance.

execute(cmd, persist=False, timeout=60)[source]

Execute the specified command via defined shell.

class galaxy.jobs.runners.util.cli.shell.rsh.SecureShell(rsh='ssh', rcp='scp', private_key=None, port=None, strict_host_key_checking=True, **kwargs)[source]

Bases: galaxy.jobs.runners.util.cli.shell.rsh.RemoteShell

__init__(rsh='ssh', rcp='scp', private_key=None, port=None, strict_host_key_checking=True, **kwargs)[source]

Constructor for shell executor instance.

class galaxy.jobs.runners.util.cli.shell.rsh.GlobusSecureShell(rsh='gsissh', rcp='gsiscp', **kwargs)[source]

Bases: galaxy.jobs.runners.util.cli.shell.rsh.SecureShell

__init__(rsh='gsissh', rcp='gsiscp', **kwargs)[source]

Constructor for shell executor instance.

class galaxy.jobs.runners.util.cli.shell.rsh.ParamikoShell(username, hostname, password=None, private_key=None, port=22, timeout=60, strict_host_key_checking=True, **kwargs)[source]

Bases: object

__init__(username, hostname, password=None, private_key=None, port=22, timeout=60, strict_host_key_checking=True, **kwargs)[source]

Initialize self. See help(type(self)) for accurate signature.

connect()[source]
execute(cmd, timeout=60)[source]