Commit 25d46c5f authored by Simon Gölzhäuser's avatar Simon Gölzhäuser
Browse files

Added local test option to bearer acquisition script

parent 52b3a5ca
import http.client
import json
import time
import sys
test = False
if len(sys.argv) > 1:
test = True
identifier = input("Set device identifier: ")
if identifier == "":
......@@ -8,11 +13,17 @@ if identifier == "":
print("-> Exit")
exit()
connection = http.client.HTTPSConnection("earth.informatik.uni-freiburg.de")
if test:
connection = http.client.HTTPConnection("192.168.0.36:5000")
else:
connection = http.client.HTTPSConnection("earth.informatik.uni-freiburg.de")
print("Requesting token")
while True:
connection.request("GET", ("/handwash/tokenauth/request/?identifier=" + identifier))
if test:
connection.request("GET", ("/tokenauth/request/?identifier=" + identifier))
else:
connection.request("GET", ("/handwash/tokenauth/request/?identifier=" + identifier))
response = connection.getresponse()
if response.status != 200:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment