def _resolve_file_include(self, pattern, parent): path = os.path.join(self.cwd, pattern) file_path = None for file_path in glob.iglob(path): include = block.IncludeBlock('include', [file_path]) parent.append(include) self.parse(file_path, include) if not file_path: LOG.warning("File not found: {}".format(path))
def _resolve_dump_include(self, pattern, parent): path = os.path.join(self.cwd, pattern) founded = False for file_path, parsed in self.configs.items(): if fnmatch.fnmatch(file_path, path): founded = True include = block.IncludeBlock('include', [file_path]) parent.append(include) self.parse_block(parsed, include) if not founded: LOG.warning("File not found: {0}".format(path))
def _resolve_file_include(self, pattern, parent): path = os.path.join(self.cwd, pattern) exists = False for file_path in glob.iglob(path): if not os.path.exists(file_path): continue exists = True include = block.IncludeBlock('include', [file_path]) parent.append(include) self.parse_file(file_path, include) if not exists: LOG.warning('File not found: {0}'.format(path))