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/03/17 19:14:31 UTC

[whimsy] branch master updated: Suppress Info log for apache; use https

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  012eaad   Suppress Info log for apache; use https
012eaad is described below

commit 012eaadb99464bb4fc3c712171a9025b52120222
Author: Sebb <se...@apache.org>
AuthorDate: Fri Mar 17 19:14:26 2017 +0000

    Suppress Info log for apache; use https
---
 tools/mirror_check.rb | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/tools/mirror_check.rb b/tools/mirror_check.rb
index 6be9bab..781bd11 100755
--- a/tools/mirror_check.rb
+++ b/tools/mirror_check.rb
@@ -124,7 +124,7 @@ def getHTTP(url)
 end
 
 # check page can be read => body
-def check_page(base, page, severity=:E, expectedStatus="200")
+def check_page(base, page, severity=:E, expectedStatus="200", log=true)
   path = base + page
   response = getHTTP(path)
   code = response.code ||  '?'
@@ -132,7 +132,7 @@ def check_page(base, page, severity=:E, expectedStatus="200")
     test(severity, "Fetched #{path} - HTTP status: #{code} expected: #{expectedStatus}") unless severity == nil
     return nil
   end
-  I "Fetched #{path} - OK"
+  I "Fetched #{path} - OK" if log
   response.body
 end
 
@@ -289,8 +289,8 @@ def init
 end
 
 def setup
-  tlps = parseIndexPage(check_page('http://www.apache.org/dist/',''))
-  podlings = parseIndexPage(check_page('http://www.apache.org/dist/incubator/',''))
+  tlps = parseIndexPage(check_page('https://www.apache.org/dist/','',:E,"200",log=false))
+  podlings = parseIndexPage(check_page('https://www.apache.org/dist/incubator/','',:E,"200",false))
   @pages = {:tlps => tlps, :podlings => podlings}
 end
 
@@ -348,7 +348,7 @@ end
 
 if __FILE__ == $0
   init
-  url = ARGV[0] || abort("Need URL to test!")
+  url = ARGV[0] || "localhost" # easier to test in an IDE
   checkHTTP(url+"") # allow url to be untainted later
   # display the test results
   @tests.each { |t| t.map{|k, v| puts "#{k}: - #{v}"}} 

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