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 <Anna.Schumaker@Netapp.com>
This commit is contained in:
parent
27d8399529
commit
a95db28f5c
4
doors.py
4
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
|
||||
|
|
Loading…
Reference in New Issue