lib/puppet/provider/cron/filetype.rb
# Overwrite a specific @path's cron tab; must be passed the @path name
# and the text with which to create the cron tab.
#
# TODO: We should refactor this at some point to make it identical to the
# :aixtab and :suntab's write methods so that, at the very least, the pipe
# is not created and the crontab command's errors are not swallowed.
Overwrite a specific @path's cron tab; must be passed the @path name
and the text with which to create the cron tab.

We should refactor this at some point to make it identical to the
:aixtab and :suntab's write methods so that, at the very least, the pipe
is not created and the crontab command's errors are not swallowed.
Overwrite a specific @path ' s cron tab ; must be passed the @path name and the text with which to create the cron tab . We should refactor this at some point to make it identical to the : aixtab and : suntab ' s write methods so that at the very least the pipe is not created and the crontab command ' s errors are not swallowed .
def write(text)
        unless Puppet::Util.uid(@path)
          raise Puppet::Error, _("Cannot write the %{path} user's crontab: The user does not exist") % { path: @path }
        end
        IO.popen("#{cmdbase} -", 'w', encoding: Encoding.default_external) do |p|
          p.print text
        end
      end
def write ( text ) unless Puppet :: Util . uid ( @path ) raise Puppet :: Error , _ ( "Cannot write the %{path} user's crontab: The user does not exist" ) % { path : @path } end IO . popen ( "#{cmdbase} -" , 'w' , encoding : Encoding . default_external ) do | p | p . print text end end
Overwrite a specific @path's cron tab; must be passed the @path name
and the text with which to create the cron tab.
Overwrite a specific @path ' s cron tab ; must be passed the @path name and the text with which to create the cron tab .
# this file is managed by the OS and should be using system encoding
text