From 5e46486d3ea2d15984edfb28875471436f466a65 Mon Sep 17 00:00:00 2001 From: Nate Butler Date: Thu, 1 Sep 2016 15:47:27 -0400 Subject: Fix bug in ensure => absent The insync? method wasn't accounting for a condition where the state was absent and the desired state was absent. This manifest itself in puppet runs that would constantly output the following after setting ensure => absent. 2016-09-01T16:39:27.314283+00:00 vcstest puppet-agent[1161]: (/Stage[main]/Main/Node[vcstest]/Vcsrepo[/home/vagrant/test]/ensure) created 2016-09-01T16:40:22.583125+00:00 vcstest puppet-agent[1727]: (/Stage[main]/Main/Node[vcstest]/Vcsrepo[/home/vagrant/test]/ensure) created 2016-09-01T16:41:04.031750+00:00 vcstest puppet-agent[2267]: (/Stage[main]/Main/Node[vcstest]/Vcsrepo[/home/vagrant/test]/ensure) created 2016-09-01T16:42:51.779816+00:00 vcstest puppet-agent[2911]: (/Stage[main]/Main/Node[vcstest]/Vcsrepo[/home/vagrant/test]/ensure) created 2016-09-01T16:43:42.189035+00:00 vcstest puppet-agent[3466]: (/Stage[main]/Main/Node[vcstest]/Vcsrepo[/home/vagrant/test]/ensure) created I added unit tests for the vcsrepo type and then fixed the code. --- lib/puppet/type/vcsrepo.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/puppet/type/vcsrepo.rb') diff --git a/lib/puppet/type/vcsrepo.rb b/lib/puppet/type/vcsrepo.rb index e2ef0b7..f35bb18 100644 --- a/lib/puppet/type/vcsrepo.rb +++ b/lib/puppet/type/vcsrepo.rb @@ -71,6 +71,8 @@ Puppet::Type.newtype(:vcsrepo) do return is == :bare when :mirror return is == :mirror + when :absent + return is == :absent end end -- cgit v1.2.3