'Locate the appropriate snippet for the current system and profile and
read it\'s contents.
This file could be located in a remote location.
This will first check for a per-system snippet, a per-profile snippet,
a distro snippet, and a general snippet. If no snippet is located, it
returns None.'

def read_snippet(self, file):

    for snipclass in ('system', 'profile', 'distro'):
        if self.varExists(('%s_name' % snipclass)):
            fullpath = ('%s/per_%s/%s/%s' % (self.getVar('autoinstall_snippets_dir'), snipclass, file, self.getVar(('%s_name' % snipclass))))
            try:
                contents = utils.read_file_contents(fullpath, fetch_if_remote=True)
                return contents
            except FileNotFoundException:
                pass
    try:
        return ('#errorCatcher    ListErrors\n' + utils.read_file_contents(('%s/%s' % (self.getVar('autoinstall_snippets_dir'), file)), fetch_if_remote=True))
    except FileNotFoundException:
        return None
