Skip to content

Commit

Permalink
add incorrect conf check
Browse files Browse the repository at this point in the history
Signed-off-by: Stephen Coady <[email protected]>
  • Loading branch information
StephenCoady committed Jun 25, 2020
1 parent d8ebc3e commit 85a90b3
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion fmn/formatters.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def shorten(link):
response = requests.get('https://da.gd/s', params=dict(url=link), timeout=30)
return response.text.strip()
except Exception as e:
_log.warn("Link shortening failed: %r" % e)
_log.warning("Link shortening failed: %r" % e)
return link


Expand Down
4 changes: 2 additions & 2 deletions fmn/lib/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ def create_defaults_for(session, user, only_for=None, detail_values=None):
detail_values = detail_values or {}

if not user.openid.endswith('.fedoraproject.org'):
log.warn("New user not from fedoraproject.org. No defaults set.")
log.warning("New user not from fedoraproject.org. No defaults set.")
return

# the openid is of the form USERNAME.id.fedoraproject.org
Expand All @@ -249,7 +249,7 @@ def contexts():
if context:
yield context
else:
log.warn("No such context %r is in the DB." % name)
log.warning("No such context %r is in the DB." % name)

# For each context, build one little and two big filters
for context in contexts():
Expand Down
12 changes: 6 additions & 6 deletions fmn/rules/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def get_fas(config):
try:
creds = config['fas_credentials']
except KeyError:
log.warn("No fas_credentials available. Unable to query FAS.")
log.warning("No fas_credentials available. Unable to query FAS.")
return None

default_url = 'https://admin.fedoraproject.org/accounts/'
Expand Down Expand Up @@ -103,7 +103,7 @@ def _paginate_pagure_data(url, params):
next_page_url = None

except requests.exceptions.Timeout as e:
log.warn('URL %s timed out %r', next_page_url, e)
log.warning('URL %s timed out %r', next_page_url, e)
next_page_url = None


Expand Down Expand Up @@ -163,11 +163,11 @@ def _get_pagure_packagers_for(config, package):
try:
response = requests_session.get(url, params={'fork': False}, timeout=25)
except requests.exceptions.Timeout as e:
log.warn('URL %s timed out %r', url, e)
log.warning('URL %s timed out %r', url, e)
return set()

if response.status_code != 200:
log.warn('URL %s returned code %s', response.url, response.status_code)
log.warning('URL %s returned code %s', response.url, response.status_code)
return set()

data = response.json()
Expand Down Expand Up @@ -201,7 +201,7 @@ def _get_pkgdb2_packagers_for(config, package):
try:
req = requests_session.get(url, timeout=15)
except requests.exceptions.Timeout as e:
log.warn('URL %s timed out %r', url, e)
log.warning('URL %s timed out %r', url, e)
return set()

if not req.status_code == 200:
Expand Down Expand Up @@ -320,7 +320,7 @@ def _get_pkgdb2_packages_for(config, username, flags):
try:
req = requests_session.get(url, timeout=15)
except requests.exceptions.Timeout as e:
log.warn('URL %s timed out %r', url, e)
log.warning('URL %s timed out %r', url, e)
return set()

if not req.status_code == 200:
Expand Down
2 changes: 1 addition & 1 deletion fmn/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ def heat_fas_cache(): # pragma: no cover
This is helpful to do once on startup since we'll need everyone's email or
IRC nickname eventually.
"""
if config.app_conf.get('fasjson'):
if config.app_conf['fasjson'].get('active'):
fmn_fasshim.make_fasjson_cache(**config.app_conf)
else:
fmn_fasshim.make_fas_cache(**config.app_conf)
Expand Down

0 comments on commit 85a90b3

Please sign in to comment.