def try_printout(data, out, opts):
    try:
        return get_printout(out, opts)(data).rstrip()
    except (KeyError, AttributeError):
        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()
Safely get the string to print out, try the configured outputter, then
dataset/ETHPy150Open saltstack/salt/salt/output/__init__.py/try_printout