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 a552d26 Detect dropped names
a552d26 is described below
commit a552d26cc8158aa1f6684c6a879fbe86b1aeaf1d
Author: Sebb <[email protected]>
AuthorDate: Fri Feb 8 13:40:48 2019 +0000
Detect dropped names
---
www/roster/public_ldap_people.rb | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/www/roster/public_ldap_people.rb b/www/roster/public_ldap_people.rb
index 83cc533..251466c 100644
--- a/www/roster/public_ldap_people.rb
+++ b/www/roster/public_ldap_people.rb
@@ -72,3 +72,13 @@ info = {
}
public_json_output(info)
+
+# detect dropped names; these should not normally occur
+if changed? and @old_file
+ # Note: symbolize_names=false to avoid symbolising variable keys such as pmc
and user names
+ # However the current JSON (info) uses symbols for fixed keys - beware!
+ previous = JSON.parse(@old_file, :symbolize_names=>false)
+ now = info[:people].keys
+ old = previous['people'].keys
+ Wunderbar.warn "Unexpected removal of following names: #{old-now}"
+end
\ No newline at end of file