diff options
author | Luke Kanies <luke@madstop.com> | 2005-07-22 04:22:50 +0000 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2005-07-22 04:22:50 +0000 |
commit | 60e02de01107ef403338558706f789580500996f (patch) | |
tree | 3d3d3cbed89ee252018f56bee630380ee5357cd0 | |
parent | 8ec8c8d73c0a784c62a01767ac06e01f08742d10 (diff) | |
download | puppet-60e02de01107ef403338558706f789580500996f.tar.gz puppet-60e02de01107ef403338558706f789580500996f.tar.xz puppet-60e02de01107ef403338558706f789580500996f.zip |
not dump/loading for local client/server
git-svn-id: https://reductivelabs.com/svn/puppet/library/trunk@434 980ebf18-57e1-0310-9a29-db15c13687c0
-rw-r--r-- | lib/puppet/client.rb | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/lib/puppet/client.rb b/lib/puppet/client.rb index 9e2774509..325a6d71e 100644 --- a/lib/puppet/client.rb +++ b/lib/puppet/client.rb @@ -88,10 +88,24 @@ module Puppet # XXX this is kind of a problem; if the user changes the state file # after this, then we have to reload the file and everything... - Puppet::Storage.init - Puppet::Storage.load + begin + Puppet::Storage.init + Puppet::Storage.load + rescue => detail + Puppet.err "Corrupt state file %s" % Puppet[:statefile] + begin + File.unlink(Puppet[:statefile]) + rescue => detail + raise Puppet::Error.new("Cannot remove %s: %s" % + [Puppet[statefile], detail]) + end + end - container = Marshal::load(tree).to_type + if @localonly + container = tree.to_type + else + container = Marshal::load(tree).to_type + end # this is a gross hack... but i don't see a good way around it # set all of the variables to empty |