pulsar.managers.util.cli.shell package¶
Submodules¶
pulsar.managers.util.cli.shell.local module¶
-
class
pulsar.managers.util.cli.shell.local.
LocalShell
(**kwds)[source]¶ Bases:
pulsar.managers.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
pulsar.managers.util.cli.shell.rsh module¶
-
class
pulsar.managers.util.cli.shell.rsh.
RemoteShell
(rsh='rsh', rcp='rcp', hostname='localhost', username=None, options=None, **kwargs)[source]¶
-
class
pulsar.managers.util.cli.shell.rsh.
SecureShell
(rsh='ssh', rcp='scp', private_key=None, port=None, strict_host_key_checking=True, **kwargs)[source]¶