$OpenBSD: patch-lib_puppet_indirector_yaml_rb,v 1.1 2010/11/04 07:20:57 robert Exp $
--- lib/puppet/indirector/yaml.rb.orig	Fri Oct 29 00:16:42 2010
+++ lib/puppet/indirector/yaml.rb	Fri Oct 29 00:17:30 2010
@@ -1,26 +1,17 @@
 require 'puppet/indirector/terminus'
-require 'puppet/util/file_locking'
 
 # The base class for YAML indirection termini.
 class Puppet::Indirector::Yaml < Puppet::Indirector::Terminus
-  include Puppet::Util::FileLocking
-
   # Read a given name's file in and convert it from YAML.
   def find(request)
     file = path(request.key)
     return nil unless FileTest.exist?(file)
 
-    yaml = nil
     begin
-      readlock(file) { |fh| yaml = fh.read }
+      return from_yaml(File.read(file))
     rescue => detail
       raise Puppet::Error, "Could not read YAML data for #{indirection.name} #{request.key}: #{detail}"
     end
-    begin
-      return from_yaml(yaml)
-    rescue => detail
-      raise Puppet::Error, "Could not parse YAML data for #{indirection.name} #{request.key}: #{detail}"
-    end
   end
 
   # Convert our object to YAML and store it to the disk.
@@ -35,7 +26,7 @@ class Puppet::Indirector::Yaml < Puppet::Indirector::T
     Dir.mkdir(basedir) unless FileTest.exist?(basedir)
 
     begin
-      writelock(file, 0660) { |f| f.print to_yaml(request.instance) }
+      File.open(file, "w", 0660) { |f| f.print to_yaml(request.instance) }
     rescue TypeError => detail
       Puppet.err "Could not save #{self.name} #{request.key}: #{detail}"
     end
