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

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Stig Sandbeck Mathisen
  • Date: 2014-04-17 14:50:28 UTC
  • mfrom: (3.1.59 sid)
  • Revision ID: package-import@ubuntu.com-20140417145028-j3p3dwvp8ggpzvaf
Tags: 3.5.1-1
ImportedĀ upstreamĀ releaseĀ 3.5.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
    Puppet.settings.use(:main) unless FileTest.directory?(Puppet[:statedir])
46
46
    filename = Puppet[:statefile]
47
47
 
48
 
    unless Puppet::FileSystem::File.exist?(filename)
 
48
    unless Puppet::FileSystem.exist?(filename)
49
49
      self.init if @@state.nil?
50
50
      return
51
51
    end
62
62
        begin
63
63
          File.rename(filename, filename + ".bad")
64
64
        rescue
65
 
          raise Puppet::Error, "Could not rename corrupt #{filename}; remove manually"
 
65
          raise Puppet::Error, "Could not rename corrupt #{filename}; remove manually", detail.backtrace
66
66
        end
67
67
      end
68
68
    end
80
80
  def self.store
81
81
    Puppet.debug "Storing state"
82
82
 
83
 
    Puppet.info "Creating state file #{Puppet[:statefile]}" unless Puppet::FileSystem::File.exist?(Puppet[:statefile])
 
83
    Puppet.info "Creating state file #{Puppet[:statefile]}" unless Puppet::FileSystem.exist?(Puppet[:statefile])
84
84
 
85
85
    Puppet::Util.benchmark(:debug, "Stored state") do
86
86
      Puppet::Util::Yaml.dump(@@state, Puppet[:statefile])