# File lib/puppet/provider/ssh_authorized_key/parsed.rb, line 56
56:   def flush
57:     raise Puppet::Error, "Cannot write SSH authorized keys without user"    unless @resource.should(:user)
58:     raise Puppet::Error, "User '#{@resource.should(:user)}' does not exist" unless uid = Puppet::Util.uid(@resource.should(:user))
59:     unless File.exist?(dir = File.dirname(target))
60:       Puppet.debug "Creating #{dir}"
61:       Dir.mkdir(dir, dir_perm)
62:       File.chown(uid, nil, dir)
63:     end
64: 
65:     # ParsedFile usually calls backup_target much later in the flush process,
66:     # but our SUID makes that fail to open filebucket files for writing.
67:     # Fortunately, there's already logic to make sure it only ever happens once,
68:     # so calling it here supresses the later attempt by our superclass's flush method.
69:     self.class.backup_target(target)
70: 
71:     Puppet::Util::SUIDManager.asuser(@resource.should(:user)) { super }
72:     File.chown(uid, nil, target)
73:     File.chmod(file_perm, target)
74:   end