def get_file_content_until_tag(path, tag):
    """Get content from a filepath up to a given tag.
    If tag is not is the file, an exception is thrown."""
    content = []
    with open(path) as f:
        for l in f:
            content.append(l)
            if tag == l.strip():
                return content
    raise ValueError('Could not find "%s" in file "%s"' % (tag, path))