This leads to strange errors like using the previous device SSL cert
for the next device.

Signed-off-by: Brice Figureau <[email protected]>
---
 lib/puppet/application/device.rb     |    1 +
 spec/unit/application/device_spec.rb |    6 ++++++
 2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/lib/puppet/application/device.rb b/lib/puppet/application/device.rb
index 3e2dec9..a4e0b0f 100644
--- a/lib/puppet/application/device.rb
+++ b/lib/puppet/application/device.rb
@@ -196,6 +196,7 @@ Licensed under the Apache 2.0 License
         Puppet.settings.set_value(:vardir, vardir, :cli)
         Puppet.settings.set_value(:confdir, confdir, :cli)
         Puppet.settings.set_value(:certname, certname, :cli)
+        Puppet::Util::Cacher.expire
       end
     end
   end
diff --git a/spec/unit/application/device_spec.rb 
b/spec/unit/application/device_spec.rb
index 42a62da..da3d132 100755
--- a/spec/unit/application/device_spec.rb
+++ b/spec/unit/application/device_spec.rb
@@ -336,6 +336,12 @@ describe Puppet::Application::Device do
         @device.main
       end
 
+      it "should expire all cached attributes" do
+        Puppet::Util::Cacher.expects(:expire).twice
+
+        @device.main
+      end
+
     end
   end
 end
-- 
1.7.5.1

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to