

def parse_file(self, sls_path):
    '\n        Given a typical Salt SLS path (e.g.: apache.vhosts.standard), find the\n        file on the file system and parse it\n        '
    config = self.state.document.settings.env.config
    formulas_dirs = config.formulas_dirs
    fpath = sls_path.replace('.', '/')
    name_options = ('{0}.sls'.format(fpath), os.path.join(fpath, 'init.sls'))
    paths = [os.path.join(fdir, fname) for fname in name_options for fdir in formulas_dirs]
    for i in paths:
        try:
            with open(i, 'rb') as f:
                return f.readlines()
        except IOError:
            pass
    raise IOError("Could not find sls file '{0}'".format(sls_path))

dataset/ETHPy150Open saltstack/salt/doc/_ext/saltdomain.py LiterateFormula.parse_file/original