jenkins-bot has submitted this change and it was merged.

Change subject: Add cert test to version script
......................................................................


Add cert test to version script

Each platform may patch the httplib2 variable CA_CERTS, and
httplib2 allows this variable to be dynamically patched by
package 'httplib2.ca_certs_locater'.

To simplify debugging of ssl certificate verification errors,
it is useful to know which file is being loaded, and whether it
includes the certificate needed for Wikimedia projects.

Bug 72009

Change-Id: Ib3d1c5e1b5d683204150b04f3df4176754fbaaa5
---
M scripts/i18n
M scripts/version.py
2 files changed, 18 insertions(+), 4 deletions(-)

Approvals:
  XZise: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/scripts/i18n b/scripts/i18n
index 932e815..9fd02df 160000
--- a/scripts/i18n
+++ b/scripts/i18n
-Subproject commit 932e815df8c3877b3928b2525e010f4082ccca9f
+Subproject commit 9fd02df20c6769b3f7b9c1975d6e341f658e2372
diff --git a/scripts/version.py b/scripts/version.py
index d211884..c188b38 100755
--- a/scripts/version.py
+++ b/scripts/version.py
@@ -12,16 +12,30 @@
 #
 
 import sys
+import os
 import pywikibot
 from pywikibot.version import getversion
+try:
+    import httplib2
+except ImportError:
+    httplib2 = {'__version__': 'n/a'}
 
 if __name__ == '__main__':
     pywikibot.output('Pywikibot: %s' % getversion())
     pywikibot.output('Release version: %s' % pywikibot.__release__)
+    pywikibot.output('httplib2 version: %s' % httplib2.__version__)
+    if not hasattr(httplib2, 'CA_CERTS'):
+        httplib2.CA_CERTS = ''
+    pywikibot.output('  cacerts: %s' % httplib2.CA_CERTS)
+    has_wikimedia_cert = False
+    if os.path.isfile(httplib2.CA_CERTS):
+        with open(httplib2.CA_CERTS, 'r') as cert_file:
+            text = cert_file.read()
+            if 
'MIIDxTCCAq2gAwIBAgIQAqxcJmoLQJuPC3nyrkYldzANBgkqhkiG9w0BAQUFADBs' in text:
+                has_wikimedia_cert = True
+    pywikibot.output(u'    certificate test: %s' % ('ok' if has_wikimedia_cert 
else 'not ok'))
     pywikibot.output('Python: %s' % sys.version)
     if not __import__('unicodedata').normalize('NFC', 
u'\u092e\u093e\u0930\u094d\u0915 
\u091c\u093c\u0941\u0915\u0947\u0930\u092c\u0930\u094d\u0917') == 
u'\u092e\u093e\u0930\u094d\u0915 
\u091c\u093c\u0941\u0915\u0947\u0930\u092c\u0930\u094d\u0917':
-        pywikibot.output(u'unicode test: triggers problem #3081100')
+        pywikibot.output(u'  unicode test: triggers problem #3081100')
     else:
-        pywikibot.output(u'unicode test: ok')
-    import httplib2
-    pywikibot.output('httplib2 version: %s' % httplib2.__version__)
+        pywikibot.output(u'  unicode test: ok')

-- 
To view, visit https://gerrit.wikimedia.org/r/167561
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib3d1c5e1b5d683204150b04f3df4176754fbaaa5
Gerrit-PatchSet: 3
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <[email protected]>
Gerrit-Reviewer: Ladsgroup <[email protected]>
Gerrit-Reviewer: Merlijn van Deen <[email protected]>
Gerrit-Reviewer: XZise <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
Pywikibot-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-commits

Reply via email to