def try_printout(data, out, opts):
    '''
    Safely get the string to print out, try the configured outputter, then
    fall back to nested and then to raw
    '''
    try:
        return get_printout(out, opts)(data).rstrip()
    except (KeyError, __HOLE__):
        log.debug(traceback.format_exc())
        try:
            return get_printout('nested', opts)(data).rstrip()
        except (KeyError, AttributeError):
            log.error('Nested output failed: ', exc_info=True)
            return get_printout('raw', opts)(data).rstrip()
dataset/ETHPy150Open saltstack/salt/salt/output/__init__.py/try_printout