jenkins-bot submitted this change.
[IMPR] Enable generate_family_file to force verify
- enable a verify parameter to be passed to FamilyFileGenerator and
force that parameter as default
- create portalwiki family file with disabled verify_SSL_certificate
Bug: T282766
Change-Id: I8d4b026e136bdb11d6628f98721f889e63d9f858
---
M .travis.yml
M generate_family_file.py
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index c2a35cb..cfaac4b 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -67,7 +67,7 @@
python -m generate_family_file 'http://'$LANGUAGE'.wikisource.beta.wmflabs.org/' 'wsbeta' 'y' ;
fi
- if [[ $FAMILY == 'portalwiki' ]]; then
- python -m generate_family_file 'https://theportalwiki.com/wiki/Main_Page' 'portalwiki' 'y' ;
+ python -m generate_family_file 'https://theportalwiki.com/wiki/Main_Page' 'portalwiki' 'y' 'y';
fi
- python -W error::UserWarning -m generate_user_files -dir:~/.pywikibot/ -family:$FAMILY -lang:$LANGUAGE -v -user:"$PYWIKIBOT_USERNAME"
diff --git a/generate_family_file.py b/generate_family_file.py
index e557a35..9c5f33d 100755
--- a/generate_family_file.py
+++ b/generate_family_file.py
@@ -25,7 +25,7 @@
"""Family file creator."""
- def __init__(self, url=None, name=None, dointerwiki=None):
+ def __init__(self, url=None, name=None, dointerwiki=None, verify=None):
"""Initializer."""
# from pywikibot.site_detect import MWSite
# when required but disable user-config checks
@@ -45,6 +45,7 @@
self.dointerwiki = dointerwiki
self.base_url = url
self.name = name
+ self.verify = verify
self.wikis = {} # {'https://wiki/$1': Wiki('https://wiki/$1'), ...}
self.langs = [] # [Wiki('https://wiki/$1'), ...]
@@ -63,7 +64,8 @@
pywikibot.exception()
if not pywikibot.bot.input_yn(
'Retry with disabled ssl certificate validation',
- automatic_quit=False):
+ default=self.verify, automatic_quit=False,
+ force=self.verify is not None):
break
else:
return w, verify
To view, visit change 690565. To unsubscribe, or for help writing mail filters, visit settings.