mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-11-03 12:18:00 +00:00
create_wanlink.py: remove stopping wanlink
This commit is contained in:
@@ -197,36 +197,36 @@ def main(args={}):
|
|||||||
|
|
||||||
print("Wanlink is running")
|
print("Wanlink is running")
|
||||||
|
|
||||||
# stop wanlink
|
# # stop wanlink
|
||||||
lf_r = LFRequest.LFRequest(base_url+"/cli-json/set_cx_state")
|
# lf_r = LFRequest.LFRequest(base_url+"/cli-json/set_cx_state")
|
||||||
lf_r.addPostData({
|
# lf_r.addPostData({
|
||||||
'test_mgr': 'all',
|
# 'test_mgr': 'all',
|
||||||
'cx_name': args['name'],
|
# 'cx_name': args['name'],
|
||||||
'cx_state': 'STOPPED'
|
# 'cx_state': 'STOPPED'
|
||||||
})
|
# })
|
||||||
lf_r.jsonPost()
|
# lf_r.jsonPost()
|
||||||
running = 1
|
# running = 1
|
||||||
while (running > 0):
|
# while (running > 0):
|
||||||
sleep(1)
|
# sleep(1)
|
||||||
lf_r = LFRequest.LFRequest(base_url+"/wl/"+args['name']+"?fields=name,eid,state,_links")
|
# lf_r = LFRequest.LFRequest(base_url+"/wl/"+args['name']+"?fields=name,eid,state,_links")
|
||||||
LFUtils.debug_printer.pprint(json_response)
|
# LFUtils.debug_printer.pprint(json_response)
|
||||||
try:
|
# try:
|
||||||
json_response = lf_r.getAsJson()
|
# json_response = lf_r.getAsJson()
|
||||||
if (json_response is None):
|
# if (json_response is None):
|
||||||
continue
|
# continue
|
||||||
for key, value in json_response.items():
|
# for key, value in json_response.items():
|
||||||
if (isinstance(value, dict)):
|
# if (isinstance(value, dict)):
|
||||||
if ("_links" in value):
|
# if ("_links" in value):
|
||||||
if (value["name"] == args['name']):
|
# if (value["name"] == args['name']):
|
||||||
if (value["state"].startswith("Stop")):
|
# if (value["state"].startswith("Stop")):
|
||||||
LFUtils.debug_printer.pprint(json_response)
|
# LFUtils.debug_printer.pprint(json_response)
|
||||||
running = 0
|
# running = 0
|
||||||
|
|
||||||
except urllib.error.HTTPError as error:
|
# except urllib.error.HTTPError as error:
|
||||||
print("Error code "+error.code)
|
# print("Error code "+error.code)
|
||||||
continue
|
# continue
|
||||||
|
|
||||||
print("Wanlink is stopped.")
|
# print("Wanlink is stopped.")
|
||||||
|
|
||||||
# print("Wanlink info:")
|
# print("Wanlink info:")
|
||||||
# lf_r = LFRequest.LFRequest(base_url+"/wl/wl_eg1")
|
# lf_r = LFRequest.LFRequest(base_url+"/wl/wl_eg1")
|
||||||
|
|||||||
Reference in New Issue
Block a user