コード例 #1
0
def remote(ssh_alias, *command, **options):
    """
    Execute a remote command (similar to :func:`.execute()`).

    :param ssh_alias: Used to set :attr:`RemoteAccount.ssh_alias`.
    :param command: All positional arguments are passed to
                    :func:`RemoteCommand.__init__()`.
    :param options: All keyword arguments are passed to
                    :func:`RemoteCommand.__init__()`.
    :returns: Refer to :func:`.execute_prepared()`.
    :raises: :exc:`RemoteCommandFailed` when the command exits with a
             nonzero exit code (and :attr:`~.ExternalCommand.check` is
             :data:`True`).
    """
    return execute_prepared(RemoteCommand(ssh_alias, *command, **options))
コード例 #2
0
ファイル: client.py プロジェクト: pombredanne/python-executor
def remote(ssh_alias, *command, **options):
    """
    Execute a remote command (similar to :func:`.execute()`).

    :param ssh_alias: Used to set :attr:`RemoteAccount.ssh_alias`.
    :param command: All positional arguments are passed to
                    :func:`RemoteCommand.__init__()`.
    :param options: All keyword arguments are passed to
                    :func:`RemoteCommand.__init__()`.
    :returns: Refer to :func:`.execute_prepared()`.
    :raises: :exc:`RemoteCommandFailed` when the command exits with a
             nonzero exit code (and :attr:`~.ExternalCommand.check` is
             :data:`True`).
    """
    return execute_prepared(RemoteCommand(ssh_alias, *command, **options))