Fix easyfix to work in stg. Needs to use stg.fedoraproject.org for ssl reasons.

This commit is contained in:
Kevin Fenzi 2015-07-27 17:41:17 +00:00
parent c90a18bc25
commit 93090bf778
3 changed files with 19 additions and 1 deletions

View file

@ -53,7 +53,7 @@
- easyfix
- name: Install the easyfix script
copy: >
template: >
src=gather_easyfix.py dest=/usr/local/bin/gather_easyfix.py
owner=root group=root mode=0755
tags:

View file

@ -0,0 +1,10 @@
# Sends the reminder about coming meetings
#
# The frequency set here should be consistent with the one set in the
# configuration file.
#
{% if env == 'staging' %}
*/30 * * * * apache cd /srv/web/easyfix && /usr/bin/python /usr/local/bin/gather_easyfix.py --fedmenu-url="https://apps.stg.fedoraproject.org/fedmenu" --fedmenu-data-url="https://apps.stg.fedoraproject.org/js/data.js" >& /dev/null
{% else %}
*/30 * * * * apache cd /srv/web/easyfix && /usr/bin/python /usr/local/bin/gather_easyfix.py --fedmenu-url="https://apps.fedoraproject.org/fedmenu" --fedmenu-data-url="https://apps.fedoraproject.org/js/data.js" >& /dev/null
{% endif %}

View file

@ -66,7 +66,11 @@ class MediaWiki(fedora.client.Wiki):
https://fedorapeople.org/gitweb?p=till/public_git/cnucnu.git;a=summary
"""
{% if env == 'staging' %}
def __init__(self, base_url='https://stg.fedoraproject.org/w/', *args,
{% else %}
def __init__(self, base_url='https://fedoraproject.org/w/', *args,
{% endif %}
**kwargs):
""" Instanciate a Mediawiki client.
:arg base_url: base url of the mediawiki to query.
@ -151,7 +155,11 @@ def gather_bugzilla_easyfix():
def gather_project():
""" Retrieve all the projects which have subscribed to this idea.
"""
{% if env == 'staging' %}
wiki = MediaWiki(base_url='https://stg.fedoraproject.org/w/')
{% else %}
wiki = MediaWiki(base_url='https://fedoraproject.org/w/')
{% endif %}
page = wiki.get_pagesource("Easyfix")
projects = []
for row in page.split('\n'):