ud-generate: Support writing gitolite config for just one user-group
authorPeter Palfrader <peter@palfrader.org>
Sat, 1 Jun 2013 09:49:14 +0000 (11:49 +0200)
committerPeter Palfrader <peter@palfrader.org>
Sat, 1 Jun 2013 09:49:51 +0000 (11:49 +0200)
debian/changelog
ud-generate

index 61579ac..7214594 100644 (file)
@@ -57,6 +57,7 @@ userdir-ldap (0.3.80) UNRELEASED; urgency=low
     End with 'by * none'.
   * ud-generate: Allow more than one email address in userForward.  Quite
     useful for role accounts.
+  * ud-generate: Support writing gitolite config for just one user-group.
 
   [ Stephen Gran ]
   * Fix deprecation warnings for sha module by using hashlib module instead
@@ -75,7 +76,6 @@ userdir-ldap (0.3.80) UNRELEASED; urgency=low
     - add mailPreserveSuffixSeperator
     - add voipPasswords
 
-
  -- Peter Palfrader <weasel@debian.org>  Mon, 14 May 2012 18:45:07 +0200
 
 userdir-ldap (0.3.79) unstable; urgency=low
index 6a2fcdd..6e857b9 100755 (executable)
@@ -1260,6 +1260,12 @@ def generate_host(host, global_dir, all_accounts, ssh_userkeys):
 
    if 'GITOLITE' in ExtraList:
       DoLink(global_dir, OutDir, "ssh-gitolite")
+   if 'exportOptions' in host[1]:
+      for entry in host[1]['exportOptions']:
+         v = entry.split('=',1)
+         if v[0] != 'GITOLITE' or len(v) != 2: continue
+         gitolite_accounts = filter(lambda x: IsInGroup(x, [v[1]], current_host), all_accounts)
+         GenSSHGitolite(gitolite_accounts, OutDir + "ssh-gitolite-%s"%(v[1],))
 
    if 'WEB-PASSWORDS' in ExtraList:
       DoLink(global_dir, OutDir, "web-passwords")