aboutsummaryrefslogtreecommitdiff
path: root/samplejobs
diff options
context:
space:
mode:
authorTom Ritter <tom@ritter.vg>2020-09-07 23:54:47 -0400
committerTom Ritter <tom@ritter.vg>2020-09-07 23:54:47 -0400
commit7deaed5205d0db6139f1c5e1f7c2b72181b1a208 (patch)
treea9f11fe72bf4b20d787bd90bbcb7a78902dac1ae /samplejobs
parent4671e0dec5eab28941e598f109dbf77ed551a707 (diff)
Run futurize on the codebase for python3
Diffstat (limited to 'samplejobs')
-rwxr-xr-xsamplejobs/BWAuthChecker.py5
-rwxr-xr-xsamplejobs/MetricsChecker.py1
2 files changed, 5 insertions, 1 deletions
diff --git a/samplejobs/BWAuthChecker.py b/samplejobs/BWAuthChecker.py
index 618075e..ff59516 100755
--- a/samplejobs/BWAuthChecker.py
+++ b/samplejobs/BWAuthChecker.py
@@ -1,5 +1,8 @@
#!/usr/bin/env python
+from __future__ import division
+from builtins import str
+from past.utils import old_div
import os
import re
import time
@@ -29,7 +32,7 @@ class BWAuthChecker(JobBase.JobBase):
now = datetime.datetime.utcfromtimestamp(time.time())
if now - then > datetime.timedelta(hours=4):
body = "The bandwidth file is more than 4 hours old.\n"
- body += str((now-then).seconds / 60) + " minutes old.\n"
+ body += str(old_div((now-then).seconds, 60)) + " minutes old.\n"
elif len(lines) < 8300:
body = "The bandwidth file has a low number of relays: " + str(len(lines)) + "\n"
except Exception as e:
diff --git a/samplejobs/MetricsChecker.py b/samplejobs/MetricsChecker.py
index 762e46f..c0254b3 100755
--- a/samplejobs/MetricsChecker.py
+++ b/samplejobs/MetricsChecker.py
@@ -1,5 +1,6 @@
#!/usr/bin/env python
+from builtins import str
import os
import base64
import logging