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.
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 .
def write(text)
        output_file = Tempfile.new('puppet_aixtab', encoding: Encoding.default_external)
        begin
          output_file.print text
          output_file.close
          File.chown(Puppet::Util.uid(@path), nil, output_file.path)
          Puppet::Util::Execution.execute(['crontab', output_file.path], cronargs)
        rescue => detail
          raise FileReadError, _('Could not write crontab for %{path}: %{detail}') % { path: @path, detail: detail }, detail.backtrace
        ensure
          output_file.close
          output_file.unlink
        end
      end
def write ( text ) output_file = Tempfile . new ( 'puppet_aixtab' , encoding : Encoding . default_external ) begin output_file . print text output_file . close File . chown ( Puppet :: Util . uid ( @path ) , nil , output_file . path ) Puppet :: Util :: Execution . execute ( [ 'crontab' , output_file . path ] , cronargs ) rescue => detail raise FileReadError , _ ( 'Could not write crontab for %{path}: %{detail}' ) % { path : @path , detail : detail } , detail . backtrace ensure output_file . close output_file . unlink 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 # We have to chown the stupid file to the user.
text