Commit c2606b4c authored by Thomas Gambier's avatar Thomas Gambier 🚴🏼

ws.py: make url an argument

parent b44f1bab
import time
import argparse
import json
import time
from websocket import create_connection
url = "ws://[2a11:9ac0:d::1]:9002"
parser = argparse.ArgumentParser(description='Connect to a lteue websocket to perform some testing.')
parser.add_argument('url', help='url of the websocket in the form ws://[XXX]:XXX (eg "ws://[2a11:9ac0:d::1]:9002")')
args = parser.parse_args()
class UeError(Exception):
pass
......@@ -45,7 +48,7 @@ def power_off(ws, ue_id):
try:
try:
ws = create_connection(url)
ws = create_connection(args.url)
except ConnectionRefusedError:
raise UeError("Couldn't connect to remote API")
......
Markdown is supported
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