mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-11-25 06:24:50 +00:00
LFRequest.py : allow for debug to be enable at enstanciation o the LFRequest.py and passed in
vap_profile.py updated to allow the mac address to be used and pass in debug state on enstanciation of LFRequest modify_vap.py : added logging, pass debug flag to base classes Signed-off-by: Chuck SmileyRekiere <chuck.smileyrekiere@candelatech.com>
This commit is contained in:
committed by
shivam
parent
06168e0803
commit
9a5bf473c3
@@ -105,7 +105,7 @@ class LFRequest:
|
||||
def form_post(self, show_error=True, debug=False, die_on_error_=False):
|
||||
if self.die_on_error:
|
||||
die_on_error_ = True
|
||||
if not debug and self.debug:
|
||||
if debug or self.debug:
|
||||
debug = True
|
||||
responses = []
|
||||
urlenc_data = ""
|
||||
@@ -160,7 +160,7 @@ class LFRequest:
|
||||
response_json_list_=response_json_list_)
|
||||
|
||||
def json_post(self, show_error=True, debug=False, die_on_error_=False, response_json_list_=None, method_='POST'):
|
||||
if not debug and self.debug:
|
||||
if debug or self.debug:
|
||||
debug = True
|
||||
if self.die_on_error:
|
||||
die_on_error_ = True
|
||||
@@ -185,7 +185,7 @@ class LFRequest:
|
||||
try:
|
||||
resp = urllib.request.urlopen(myrequest)
|
||||
resp_data = resp.read().decode('utf-8')
|
||||
if debug and die_on_error_:
|
||||
if debug or die_on_error_:
|
||||
self.logger.debug("----- LFRequest::json_post:128 debug: --------------------------------------------")
|
||||
self.logger.debug("URL: <%s> status: %d " % (self.requested_url, resp.status))
|
||||
if resp.status != 200:
|
||||
|
||||
Reference in New Issue
Block a user