mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-11-02 11:48:03 +00:00
lfcli_base.py: can now import lanforge_client.logg
Adds notes on where present logg() function is being used Signed-off-by: Jed Reynolds <jed@bitratchet.com>
This commit is contained in:
@@ -22,10 +22,14 @@ sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../../")))
|
|||||||
|
|
||||||
debug_printer = pprint.PrettyPrinter(indent=2)
|
debug_printer = pprint.PrettyPrinter(indent=2)
|
||||||
LFRequest = importlib.import_module("py-json.LANforge.LFRequest")
|
LFRequest = importlib.import_module("py-json.LANforge.LFRequest")
|
||||||
|
LFUtils = importlib.import_module("py-json.LANforge.LFUtils")
|
||||||
|
Logg = importlib.import_module("lanforge_client.logg")
|
||||||
|
|
||||||
if os.environ.get("LF_USE_AUTOGEN") == 1:
|
if os.environ.get("LF_USE_AUTOGEN") == 1:
|
||||||
lanforge_api = importlib.import_module("lanforge_client.lanforge_api")
|
lanforge_api = importlib.import_module("lanforge_client.lanforge_api")
|
||||||
LFSession = lanforge_api.LFSession
|
LFSession = lanforge_api.LFSession
|
||||||
Logg = lanforge_api.Logg
|
|
||||||
|
|
||||||
|
|
||||||
class LFCliBase:
|
class LFCliBase:
|
||||||
|
|
||||||
@@ -34,11 +38,8 @@ class LFCliBase:
|
|||||||
SHOULD_HALT = 2 # indicates to quit loops, send SIGABRT to threads and exit
|
SHOULD_HALT = 2 # indicates to quit loops, send SIGABRT to threads and exit
|
||||||
|
|
||||||
# - LOGGING -
|
# - LOGGING -
|
||||||
_logger = None
|
_logger = logging.getLogger(__name__)
|
||||||
if os.environ.get("LF_USE_AUTOGEN") == 1:
|
|
||||||
_logger = Logg.logger
|
|
||||||
_method_name_list = []
|
|
||||||
_tag_list = []
|
|
||||||
|
|
||||||
# do not use `super(LFCLiBase,self).__init__(self, host, port, _debug)
|
# do not use `super(LFCLiBase,self).__init__(self, host, port, _debug)
|
||||||
# that is py2 era syntax and will force self into the host variable, making you
|
# that is py2 era syntax and will force self into the host variable, making you
|
||||||
@@ -523,6 +524,14 @@ class LFCliBase:
|
|||||||
mesg=None,
|
mesg=None,
|
||||||
filename=None,
|
filename=None,
|
||||||
scriptname=None):
|
scriptname=None):
|
||||||
|
"""
|
||||||
|
This method is used by vr_profile2, lf_create_bcast, and shadowed by base_profile.py
|
||||||
|
:param level:
|
||||||
|
:param mesg:
|
||||||
|
:param filename:
|
||||||
|
:param scriptname:
|
||||||
|
:return:
|
||||||
|
"""
|
||||||
if (mesg is None) or (mesg == "") or (level is None):
|
if (mesg is None) or (mesg == "") or (level is None):
|
||||||
return
|
return
|
||||||
userhome=os.path.expanduser('~')
|
userhome=os.path.expanduser('~')
|
||||||
|
|||||||
Reference in New Issue
Block a user