'Parses a yaml file.
Args:
basepath: The base directory of the application.
basename: The relative file path, from basepath, (with the \'.yaml\'
stripped off).
parser: the function or method used to parse the file.
Returns:
A single parsed yaml file or None if the file does not exist.'

def _ParseYamlFile(self, basepath, basename, parser):

    file_name = self._FindYaml(basepath, basename)
    if (file_name is not None):
        fh = self.opener(file_name, 'r')
        try:
            defns = parser(fh, open_fn=self.opener)
        finally:
            fh.close()
        return defns
    return None
