summaryrefslogtreecommitdiffstats
path: root/lib/puppet/client
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-05-25 06:24:44 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-05-25 06:24:44 +0000
commit4cd30194f18cdb792bc551080b95c0a6ce400de5 (patch)
tree8f3a38af03b0980b70e988d52c46088dd77165a1 /lib/puppet/client
parent45a9edbe23c43b5e1c8e2c6683502a6a6ef54661 (diff)
downloadpuppet-4cd30194f18cdb792bc551080b95c0a6ce400de5.tar.gz
puppet-4cd30194f18cdb792bc551080b95c0a6ce400de5.tar.xz
puppet-4cd30194f18cdb792bc551080b95c0a6ce400de5.zip
Did some work on making sure object removal actually works, thus stopping some potential memory leaks. Also explicitly removed objects in more places, again hopefully forestalling memory leaks.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1224 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet/client')
-rw-r--r--lib/puppet/client/dipper.rb8
-rw-r--r--lib/puppet/client/master.rb10
2 files changed, 10 insertions, 8 deletions
diff --git a/lib/puppet/client/dipper.rb b/lib/puppet/client/dipper.rb
index 7271eded9..a9de76e6f 100644
--- a/lib/puppet/client/dipper.rb
+++ b/lib/puppet/client/dipper.rb
@@ -26,13 +26,7 @@ module Puppet
unless FileTest.exists?(file)
raise(BucketError, "File %s does not exist" % file)
end
- contents = File.read(file)
- string = Base64.encode64(contents)
-
- sum = @driver.addfile(string,file)
- string = ""
- contents = ""
- return sum
+ return @driver.addfile(Base64.encode64(File.read(file)),file)
end
# Restore the file
diff --git a/lib/puppet/client/master.rb b/lib/puppet/client/master.rb
index 9194b86be..3f29eb44e 100644
--- a/lib/puppet/client/master.rb
+++ b/lib/puppet/client/master.rb
@@ -110,6 +110,12 @@ class Puppet::Client::MasterClient < Puppet::Client
@cachefile
end
+ def clear
+ #@objects = nil
+ @objects.remove(true)
+ Puppet::Type.allclear
+ end
+
# Disable running the configuration. This can be used from the command line, but
# is also used to make sure only one client is running at a time.
def disable(running = false)
@@ -261,6 +267,9 @@ class Puppet::Client::MasterClient < Puppet::Client
# Clear all existing objects, so we can recreate our stack.
if defined? @objects
Puppet::Type.allclear
+
+ # Make sure all of the objects are really gone.
+ @objects.remove(true)
end
@objects = nil
@@ -273,7 +282,6 @@ class Puppet::Client::MasterClient < Puppet::Client
if @objects.nil?
raise Puppet::Error, "Configuration could not be processed"
end
- #@objects = objects
# and perform any necessary final actions before we evaluate.
@objects.finalize