summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG2
-rw-r--r--lib/puppet/network/client/master.rb3
-rwxr-xr-xtest/network/client/master.rb17
3 files changed, 21 insertions, 1 deletions
diff --git a/CHANGELOG b/CHANGELOG
index db9ef9c12..8f4e2669c 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,5 @@
+ Fixed #532 -- reparsing config files now longer throws an exception.
+
Added some warnings and logs to the service type so
users will be encouraged to specify either "ensure"
or "enabled" and added debugging to indicate why
diff --git a/lib/puppet/network/client/master.rb b/lib/puppet/network/client/master.rb
index 2b9490539..ae13f8185 100644
--- a/lib/puppet/network/client/master.rb
+++ b/lib/puppet/network/client/master.rb
@@ -108,7 +108,7 @@ class Puppet::Network::Client::Master < Puppet::Network::Client
end
def clear
- @objects.remove(true)
+ @objects.remove(true) if @objects
Puppet::Type.allclear
mkdefault_objects
@objects = nil
@@ -325,6 +325,7 @@ class Puppet::Network::Client::Master < Puppet::Network::Client
ensure
# Just make sure we remove the lock file if we set it.
lockfile.unlock if got_lock and lockfile.locked?
+ clear()
end
def running?
diff --git a/test/network/client/master.rb b/test/network/client/master.rb
index edd91cf30..64ff34314 100755
--- a/test/network/client/master.rb
+++ b/test/network/client/master.rb
@@ -706,6 +706,23 @@ end
client.send(:splay)
end
end
+
+ # This is partially to fix #532, but also to save on memory.
+ def test_remove_objects_after_every_run
+ client = mkclient
+
+ ftype = Puppet::Type.type(:file)
+
+ assert_nil(ftype[@createdfile], "file object already exists")
+ assert(! FileTest.exists?(@createdfile), "File already exists on disk")
+
+ assert_nothing_raised("Could not apply config") do
+ client.run
+ end
+
+ assert(FileTest.exists?(@createdfile), "File does not exist on disk")
+ assert_nil(ftype[@createdfile], "file object was not removed from memory")
+ end
end
# $Id$