Call set_ownership from the bzr provider
authorAaron Stone <aaron@serendipity.cx>
Tue, 3 Dec 2013 07:30:51 +0000 (01:30 -0600)
committerAaron Stone <aaron@serendipity.cx>
Fri, 7 Mar 2014 06:41:23 +0000 (22:41 -0800)
lib/puppet/provider/vcsrepo/bzr.rb

index 6688ce8..80b18ed 100644 (file)
@@ -52,6 +52,7 @@ Puppet::Type.type(:vcsrepo).provide(:bzr, :parent => Puppet::Provider::Vcsrepo)
         bzr('update', '-r', desired, ':parent')
       end
     end
+    update_owner
   end
 
   def latest
@@ -70,6 +71,7 @@ Puppet::Type.type(:vcsrepo).provide(:bzr, :parent => Puppet::Provider::Vcsrepo)
 
   def create_repository(path)
     bzr('init', path)
+    update_owner
   end
 
   def clone_repository(revision)
@@ -80,6 +82,12 @@ Puppet::Type.type(:vcsrepo).provide(:bzr, :parent => Puppet::Provider::Vcsrepo)
     args.push(@resource.value(:source),
               @resource.value(:path))
     bzr(*args)
+    update_owner
   end
 
+  def update_owner
+    if @resource.value(:owner) or @resource.value(:group)
+      set_ownership
+    end
+  end
 end