Skip to content
Snippets Groups Projects
Unverified Commit d86ad6b9 authored by Georg Koppen's avatar Georg Koppen
Browse files

Bug 40012: Fix log.warn() deprecation in Python 3

parent e660f097
No related branches found
No related tags found
1 merge request!4Bug 40012: Fix log.warn() deprecation in Python 3
......@@ -260,7 +260,7 @@ def main():
if consensuses and votes:
issues += run_checks(consensuses, votes)
else:
log.warn("Unable to retrieve any votes. Skipping checks.")
log.warning("Unable to retrieve any votes. Skipping checks.")
is_all_suppressed = True # either no issues or they're all already suppressed
......
......@@ -61,7 +61,7 @@ def main():
elif "'dirreq-v3-ips' line had non-ascii content" in str(query.error) or "Entries in dirreq-v3-ips line should only be" in str(query.error):
log.debug("Suppressing error due to malformed dirreq-v3-ips line: https://trac.torproject.org/projects/tor/ticket/16858")
else:
log.warn("Unable to retrieve the %s: %s" % (descriptor_type, query.error))
log.warning("Unable to retrieve the %s: %s" % (descriptor_type, query.error))
send_email(EMAIL_SUBJECT, descriptor_type, query)
# download the consensus from each authority
......@@ -87,7 +87,7 @@ def main():
count = len(list(query)[0].routers)
log.debug(" %i descriptors retrieved from %s in %0.2fs" % (count, query.download_url, query.runtime))
else:
log.warn("Unable to retrieve the consensus from %s: %s" % (authority.nickname, query.error))
log.warning("Unable to retrieve the consensus from %s: %s" % (authority.nickname, query.error))
subject = EMAIL_SUBJECT + ' (%s)' % authority.nickname
send_email(subject, 'consensus', query)
......@@ -98,7 +98,7 @@ def send_email(subject, descriptor_type, query):
timestamp = datetime.datetime.now().strftime("%m/%d/%Y %H:%M")
util.send(subject, body = EMAIL_BODY % (descriptor_type, query.download_url, timestamp, query.error), to = [util.ERROR_ADDRESS])
except Exception as exc:
log.warn("Unable to send email: %s" % exc)
log.warning("Unable to send email: %s" % exc)
if __name__ == '__main__':
......
......@@ -214,6 +214,6 @@ if __name__ == '__main__':
try:
util.send('Packages wiki possibly outdated', body = content, to = ['atagar@torproject.org'])
except Exception as exc:
log.warn("Unable to send email: %s" % exc)
log.warning("Unable to send email: %s" % exc)
log.debug('\n' + content)
......@@ -57,7 +57,7 @@ def main():
query.run(True)
if query.error:
log.warn("Unable to retrieve the consensus: %s" % query.error)
log.warning("Unable to retrieve the consensus: %s" % query.error)
return
# mapping of fingerprints to their router status entry
......@@ -95,7 +95,7 @@ def send_email(new_relays):
util.send(EMAIL_SUBJECT, body = body)
except Exception as exc:
log.warn("Unable to send email: %s" % exc)
log.warning("Unable to send email: %s" % exc)
def load_fingerprints():
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment