import glob
import json


def parse_yang2proto_files(yang2proto_file_glob):
    """Parses a glob specifying yang2proto files to load as JSON."""
    yang2proto = []
    for yang2proto_filename in list(glob.glob(yang2proto_file_glob)):
        with open(yang2proto_filename) as yang2proto_fd:
            yang2proto.extend(json.load(yang2proto_fd))
    return yang2proto