support setting the owner/group in hg provider
authorAaron Bull Schaefer <aaron@elasticdog.com>
Tue, 14 Dec 2010 18:21:42 +0000 (02:21 +0800)
committerJames Turnbull <james@lovedthanlost.net>
Mon, 27 Dec 2010 07:47:00 +0000 (15:47 +0800)
lib/puppet/provider/vcsrepo/hg.rb

index 0212d50..f967586 100644 (file)
@@ -13,6 +13,7 @@ Puppet::Type.type(:vcsrepo).provide(:hg, :parent => Puppet::Provider::Vcsrepo) d
     else
       clone_repository(@resource.value(:revision))
     end
+    update_owner
   end
 
   def working_copy_exists?
@@ -72,6 +73,7 @@ Puppet::Type.type(:vcsrepo).provide(:hg, :parent => Puppet::Provider::Vcsrepo) d
       end
       hg('update', '--clean', '-r', desired)
     end
+    update_owner
   end
 
   private
@@ -90,4 +92,10 @@ Puppet::Type.type(:vcsrepo).provide(:hg, :parent => Puppet::Provider::Vcsrepo) d
     hg(*args)
   end
 
+  def update_owner
+    if @resource.value(:owner) or @resource.value(:group)
+      set_ownership
+    end
+  end
+
 end