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:
Anna Schumaker 2016-01-19 13:32:23 -05:00
parent 27d8399529
commit a95db28f5c
1 changed files with 2 additions and 2 deletions

View File

@ -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