def ssh_execute_command(guestaddr, sshprivkey, command, timeout=10, user='root', prefix=None):
    # ServerAliveInterval protects against NAT firewall timeouts
    # on long-running commands with no output
    #
    # PasswordAuthentication=no prevents us from falling back to
    # keyboard-interactive password prompting
    #
    # -F /dev/null makes sure that we don't use the global or per-user
    # configuration files
    #
    # -t -t ensures we have a pseudo tty for sudo

    cmd = ["ssh", "-i", sshprivkey,
            "-F", "/dev/null",
            "-o", "ServerAliveInterval=30",
            "-o", "StrictHostKeyChecking=no",
            "-o", "ConnectTimeout=" + str(timeout),
            "-o", "UserKnownHostsFile=/dev/null",
            "-t", "-t",
            "-o", "PasswordAuthentication=no"]

    if prefix:
        command = prefix + " " + command

    cmd.extend(["%s@%s" % (user, guestaddr), command])

    if(prefix == 'sudo'):
        return subprocess_check_output_pty(cmd)
    else:
        return subprocess_check_output(cmd)
Execute the query without fetching data. Returns the number of
dataset/ETHPy150Open redhat-imaging/imagefactory/imgfac/FactoryUtils.py/ssh_execute_command--crossover with--dataset/ETHPy150Open lsbardel/python-stdnet/stdnet/backends/redisb/__init__.py/RedisQuery._execute_query