def _ssh_execute(ssh_obj, cmd_to_exec):
    try:
        output_list = processutils.ssh_execute(ssh_obj,
                                               cmd_to_exec)[0].split('\n')
    except Exception as e:
        LOG.error(_LE("Cannot execute SSH cmd %(cmd)s. Reason: %(err)s."),
                  {'cmd': cmd_to_exec, 'err': e})
        raise exception.SSHCommandFailed(cmd=cmd_to_exec)

    return output_list
Executes a command via ssh.
dataset/ETHPy150Open openstack/ironic/ironic/drivers/modules/ssh.py/_ssh_execute