def METHOD_NAME(rootdir):
    # Load contexts in override directory, if any
    c = {}
    if os.path.isdir(os.path.join(rootdir, 'templates/context.override.d')):
        for fn in sorted(os.listdir(os.path.join(rootdir, 'templates/context.override.d'))):
            if fn.endswith('.json') or (_has_yaml and fn.endswith('.yaml')):
                try:
                    deep_update_context(c, _load_context_file(os.path.join(rootdir, 'templates/context.override.d', fn), False))
                except Exception as e:
                    logging.getLogger(__name__).warning(
                        'Failed to load context file {}: {}'.format(os.path.join(rootdir, 'templates/context.override.d', fn), e)
                    )
    return c