You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by se...@apache.org on 2017/08/07 21:53:34 UTC

[whimsy] branch master updated: Add crude check of LDAP consistency

This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git


The following commit(s) were added to refs/heads/master by this push:
     new 93c83ec  Add crude check of LDAP consistency
93c83ec is described below

commit 93c83ec9db257d09f184acd63cde6461fb2a2e2e
Author: Sebb <se...@apache.org>
AuthorDate: Mon Aug 7 22:53:33 2017 +0100

    Add crude check of LDAP consistency
---
 tools/check_consistency.rb | 44 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)

diff --git a/tools/check_consistency.rb b/tools/check_consistency.rb
new file mode 100644
index 0000000..bba3517
--- /dev/null
+++ b/tools/check_consistency.rb
@@ -0,0 +1,44 @@
+# basic check of LDAP consistency
+$LOAD_PATH.unshift File.realpath(File.expand_path('../../lib', __FILE__))
+require 'whimsy/asf'
+
+groups = ASF::Group.preload # for performance
+committees = ASF::Committee.preload # for performance
+projects = ASF::Project.preload
+
+puts "project.members ~ group.members"
+groups.keys.sort_by {|a| a.name}.each do |entry|
+    project = ASF::Project[entry.name]
+    if project
+      p = []
+      project.members.sort_by {|a| a.name}.each do |e|
+          p << e.name
+      end
+      g = []
+      entry.members.sort_by {|a| a.name}.each do |e|
+          g << e.name
+      end
+      if p != g
+        puts "#{entry.name}: pm-g=#{p-g} g-pm=#{g-p}" 
+      end
+    end
+end
+
+puts ""
+puts "project.owners ~ committee.members"
+committees.keys.sort_by {|a| a.name}.each do |entry|
+    project = ASF::Project[entry.name]
+    if project
+      p = []
+      project.owners.sort_by {|a| a.name}.each do |e|
+          p << e.name
+      end
+      c = []
+      entry.members.sort_by {|a| a.name}.each do |e|
+          c << e.name
+      end
+      if p != c
+        puts "#{entry.name}: po-c=#{p-c} c-po=#{c-p}" 
+      end
+    end
+end

-- 
To stop receiving notification emails like this one, please contact
['"commits@whimsical.apache.org" <co...@whimsical.apache.org>'].