mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-11-01 11:18:03 +00:00
LFRequest.py: adds more debugging
This commit is contained in:
@@ -1,7 +1,8 @@
|
|||||||
#!env /usr/bin/python
|
#!env /usr/bin/python
|
||||||
|
|
||||||
# Extend this class to use common set of debug and request features for your script
|
# Extend this class to use common set of debug and request features for your script
|
||||||
|
from pprint import pprint
|
||||||
|
import LANforge.LFUtils
|
||||||
from LANforge.LFUtils import *
|
from LANforge.LFUtils import *
|
||||||
|
|
||||||
|
|
||||||
@@ -20,6 +21,8 @@ class LFCliBase:
|
|||||||
_data['suppress_preexec_cli'] = True
|
_data['suppress_preexec_cli'] = True
|
||||||
_data['suppress_preexec_method'] = True
|
_data['suppress_preexec_method'] = True
|
||||||
lf_r.addPostData(_data)
|
lf_r.addPostData(_data)
|
||||||
|
if (self.debugOn):
|
||||||
|
LANforge.LFUtils.debug_printer.pprint(_data)
|
||||||
json_response = lf_r.jsonPost(self.debugOn)
|
json_response = lf_r.jsonPost(self.debugOn)
|
||||||
# Debugging
|
# Debugging
|
||||||
# if (json_response != None):
|
# if (json_response != None):
|
||||||
@@ -34,7 +37,7 @@ class LFCliBase:
|
|||||||
|
|
||||||
def checkConnect(self):
|
def checkConnect(self):
|
||||||
print(f"Checking for LANforge GUI connection: {self.mgr_url}")
|
print(f"Checking for LANforge GUI connection: {self.mgr_url}")
|
||||||
response = self.jsonGet("")
|
response = self.jsonGet("/")
|
||||||
duration = 0
|
duration = 0
|
||||||
while (response is None) and (duration < 300):
|
while (response is None) and (duration < 300):
|
||||||
print(f"LANforge GUI connection not found sleeping 5 seconds, tried: {self.mgr_url}")
|
print(f"LANforge GUI connection not found sleeping 5 seconds, tried: {self.mgr_url}")
|
||||||
|
|||||||
Reference in New Issue
Block a user