mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-11-07 06:07:52 +00:00
Python: introduces use_preexec variable to help simplify toggling on pre-exec login
This commit is contained in:
@@ -24,6 +24,12 @@ class LFCliBase:
|
|||||||
self.test_results = []
|
self.test_results = []
|
||||||
self.exit_on_error = _exit_on_error
|
self.exit_on_error = _exit_on_error
|
||||||
self.exit_on_fail = _exit_on_fail
|
self.exit_on_fail = _exit_on_fail
|
||||||
|
# toggle using preexec_cli, preexec_method; the preexec_X parameters are useful
|
||||||
|
# when you desire the lfclient to check for existance of entities to run commands on,
|
||||||
|
# like when developing; you might toggle this with use_preexec = _debug
|
||||||
|
# Otherwise, preexec methods use more processing time because they add an extra CLI call
|
||||||
|
# into the queue, and inspect it -- typically nc_show_port
|
||||||
|
self.use_preexec = False
|
||||||
|
|
||||||
def clear_test_results(self):
|
def clear_test_results(self):
|
||||||
self.test_results.clear()
|
self.test_results.clear()
|
||||||
@@ -32,6 +38,10 @@ class LFCliBase:
|
|||||||
json_response = None
|
json_response = None
|
||||||
try:
|
try:
|
||||||
lf_r = LFRequest.LFRequest(self.lfclient_url, _req_url, debug_=self.debug)
|
lf_r = LFRequest.LFRequest(self.lfclient_url, _req_url, debug_=self.debug)
|
||||||
|
if self.use_preexec == True:
|
||||||
|
del _data['suppress_preexec_cli']
|
||||||
|
del _data['suppress_preexec_method']
|
||||||
|
else:
|
||||||
_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)
|
||||||
|
|||||||
Reference in New Issue
Block a user