# File lib/puppet/parser/files.rb, line 40 40: def find_template(template, environment = nil) 41: if template =~ /^#{File::SEPARATOR}/ 42: return template 43: end 44: 45: if template_paths = templatepath(environment) 46: # If we can find the template in :templatedir, we return that. 47: template_paths.collect { |path| 48: File::join(path, template) 49: }.each do |f| 50: return f if FileTest.exist?(f) 51: end 52: end 53: 54: # check in the default template dir, if there is one 55: if td_file = find_template_in_module(template, environment) 56: return td_file 57: end 58: 59: return nil 60: end