~ubuntu-branches/ubuntu/wily/puppet/wily

« back to all changes in this revision

Viewing changes to lib/puppet/util/filetype.rb

  • Committer: Package Import Robot
  • Author(s): Stig Sandbeck Mathisen
  • Date: 2014-01-07 12:04:39 UTC
  • mfrom: (3.1.57 sid)
  • Revision ID: package-import@ubuntu.com-20140107120439-42anap22xfs9260x
Tags: 3.4.2-1
ImportedĀ upstreamĀ releaseĀ 3.4.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
98
98
  newfiletype(:flat) do
99
99
    # Back the file up before replacing it.
100
100
    def backup
101
 
      bucket.backup(@path) if File.exists?(@path)
 
101
      bucket.backup(@path) if Puppet::FileSystem::File.exist?(@path)
102
102
    end
103
103
 
104
104
    # Read the file.
105
105
    def read
106
 
      if File.exist?(@path)
 
106
      if Puppet::FileSystem::File.exist?(@path)
107
107
        File.read(@path)
108
108
      else
109
109
        return nil
112
112
 
113
113
    # Remove the file.
114
114
    def remove
115
 
      File.unlink(@path) if File.exist?(@path)
 
115
      Puppet::FileSystem::File.unlink(@path) if Puppet::FileSystem::File.exist?(@path)
116
116
    end
117
117
 
118
118
    # Overwrite the file.