whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c..@apache.org
Subject [whimsy] branch master updated: Fix typo -rm instead of --rm; only remove from LDAP if not in committee-info
Date Tue, 09 Jan 2018 00:00:21 GMT
This is an automated email from the ASF dual-hosted git repository.

clr 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 4ded0cb  Fix typo -rm instead of --rm; only remove from LDAP if not in committee-info
4ded0cb is described below

commit 4ded0cba211d7ddef649a4ecadc851fd80e75f8c
Author: Craig L Russell <craig.russell@oracle.com>
AuthorDate: Mon Jan 8 15:58:33 2018 -0800

    Fix typo -rm instead of --rm; only remove from LDAP if not in committee-info
---
 tools/modify_pmcchairs.rb | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/tools/modify_pmcchairs.rb b/tools/modify_pmcchairs.rb
index 96f3cc1..4316509 100755
--- a/tools/modify_pmcchairs.rb
+++ b/tools/modify_pmcchairs.rb
@@ -24,11 +24,16 @@ end
 # get the list from LDAP to be updated
 chairs = ASF::Service.find('pmc-chairs')
 
+# get the list of current chairs from committee-info
+current = ASF::Committee.pmcs.map(&:chair).uniq
+# only remove people from LDAP who are not currently chairs
+to_be_removed = people.reject{|p| current.include?(p)}
+
 # execute the action
 if action == '--add' and not people.empty?
   ASF::LDAP.bind { chairs.add(people) }
-elsif action == '-rm' and not people.empty?
-  ASF::LDAP.bind { chairs.remove(people) }
+elsif action == '--rm' and not to_be_removed.empty?
+  ASF::LDAP.bind { chairs.remove(to_be_removed) }
 else
   STDERR.puts "Usage: #{$PROGRAM_NAME} (--add|--rm) list..."
 end

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

Mime
View raw message