From a95db28f5ce5d9c29c3c8e7ce7af4bd3fda331c5 Mon Sep 17 00:00:00 2001 From: Anna Schumaker Date: Tue, 19 Jan 2016 13:32:23 -0500 Subject: [PATCH] Clean up forming the server request We're getting a "bad request" error, but it's not clear how that request is bad. Let's add this message to the log, and also clean up the code to generate the request. Signed-off-by: Anna Schumaker --- doors.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doors.py b/doors.py index 4c20a9a..f2cde24 100755 --- a/doors.py +++ b/doors.py @@ -106,8 +106,8 @@ NEED_PING = [] THIS_MONTH = datetime.date.today().month def ping_server(key): - print("Pinging server with key: %s" % key) - with request.urlopen(SERVER + ("/%s" % key)) as f: + print("Pinging server with key: %s (%s/%s)" % (key, SERVER, key)) + with request.urlopen("%s/%s" % (SERVER, key)) as f: if f.read().decode() == "OK": CACHED_KEYS.add(key) return True