whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject [whimsy] branch master updated: Synch HOSTS list with puppet Add test to check against puppet Add missing require in case YAML parser needed
Date Mon, 11 Apr 2016 10:23:07 GMT
This is an automated email from the ASF dual-hosted git repository.

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

The following commit(s) were added to refs/heads/master by this push:
       new  ce35a4e   Synch HOSTS list with puppet Add test to check against puppet Add missing
require in case YAML parser needed
ce35a4e is described below

commit ce35a4ebdca0a15e1f5cdc45e55ce440dbac2416
Author: Sebb <sebb@apache.org>
AuthorDate: Mon Apr 11 11:22:59 2016 +0100

    Synch HOSTS list with puppet
    Add test to check against puppet
    Add missing require in case YAML parser needed
---
 lib/whimsy/asf/ldap.rb | 40 +++++++++++++++++++++++++++++++++++-----
 1 file changed, 35 insertions(+), 5 deletions(-)

diff --git a/lib/whimsy/asf/ldap.rb b/lib/whimsy/asf/ldap.rb
index ea75078..807ea21 100644
--- a/lib/whimsy/asf/ldap.rb
+++ b/lib/whimsy/asf/ldap.rb
@@ -39,14 +39,15 @@ module ASF
   module LDAP
      # https://www.pingmybox.com/dashboard?location=304
      # https://github.com/apache/infrastructure-puppet/blob/deployment/data/common.yaml (ldapserver::slapd_peers)
+     # Updated 2016-04-11 
     HOSTS = %w(
-      ldaps://ldap1-us-west.apache.org:636
-      ldaps://ldap1-lw-us.apache.org:636
-      ldaps://ldap2-us-west.apache.org:636
+      ldaps://devops.apache.org:636
       ldaps://ldap1-lw-eu.apache.org:636
-      ldaps://snappy5.apache.org:636
-      ldaps://ldap2-lw-us.apache.org:636
+      ldaps://ldap1-lw-us.apache.org:636
       ldaps://ldap2-lw-eu.apache.org:636
+      ldaps://ldap2-lw-us.apache.org:636
+      ldaps://snappy5.apache.org:636
+      ldaps://themis.apache.org:636
     )
 
     CONNECT_LOCK = Mutex.new
@@ -58,6 +59,8 @@ module ASF
       file = '/apache/infrastructure-puppet/deployment/data/common.yaml'
       http = Net::HTTP.new('raw.githubusercontent.com', 443)
       http.use_ssl = true
+      # the enclosing method is optional, so we only require the gem here
+      require 'yaml'
       @puppet = YAML.load(http.request(Net::HTTP::Get.new(file)).body)
     end
 
@@ -721,3 +724,30 @@ module ASF
     end
   end
 end
+
+if __FILE__ == $0
+  module ASF
+    module LDAP
+      def self.getHOSTS
+        HOSTS
+      end
+    end
+  end
+  hosts=ASF::LDAP.getHOSTS().sort!
+  puppet=ASF::LDAP.puppet_ldapservers().sort!
+  if hosts == puppet
+    puts("LDAP HOSTS array is up to date with the puppet list")
+  else
+    puts("LDAP HOSTS array does not agree with the puppet list")
+    hostsonly=hosts-puppet
+    if hostsonly.length > 0
+      print("In HOSTS but not in puppet:")
+      puts(hostsonly)
+    end
+    puppetonly=puppet-hosts
+    if puppetonly.length > 0
+      print("In puppet but not in HOSTS: ")
+      puts(puppetonly)
+    end
+  end
+end
\ No newline at end of file

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

Mime
View raw message