summaryrefslogtreecommitdiff
path: root/lib/puppet/type/vcsrepo.rb
diff options
context:
space:
mode:
authorNate Butler <nathan.butler@gmail.com>2016-09-01 15:47:27 -0400
committerNate Butler <nathan.butler@gmail.com>2016-09-01 15:54:31 -0400
commit5e46486d3ea2d15984edfb28875471436f466a65 (patch)
treefd321e2b314f0c52849b220e64cffb7a55a0af5d /lib/puppet/type/vcsrepo.rb
parent54e3af8b1bb4aa141264bb5cd8b0ffb447361f16 (diff)
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.
Diffstat (limited to 'lib/puppet/type/vcsrepo.rb')
-rw-r--r--lib/puppet/type/vcsrepo.rb2
1 files changed, 2 insertions, 0 deletions
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