From 5dc7c27a552312987d0bf9487f89896c7c8d6ad4 Mon Sep 17 00:00:00 2001 From: yixinglu <2520865+yixinglu@users.noreply.github.com> Date: Fri, 2 Jul 2021 10:11:55 +0800 Subject: [PATCH] Fix debug option --- tests/nebula-test-run.py | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/tests/nebula-test-run.py b/tests/nebula-test-run.py index 0ddef6a49..304012b70 100755 --- a/tests/nebula-test-run.py +++ b/tests/nebula-test-run.py @@ -45,16 +45,20 @@ def init_parser(): default='', help='Support multi graphds') opt_parser.add_option('--address', - dest='address', - default='', - help='Address of the Nebula') + dest='address', + default='', + help='Address of the Nebula') opt_parser.add_option('--debug', - dest='debug', - default=True, - help='Print verbose debug logs') + dest='debug', + default=True, + help='Print verbose debug logs') return opt_parser +def opt_is(val, expect): + return type(val) == str and val.lower() == expect + + def start_nebula(nb, configs): if configs.address is not None and configs.address != "": print('test remote nebula graph, address is {}'.format(configs.address)) @@ -65,7 +69,8 @@ def start_nebula(nb, configs): else: nb.install() address = "localhost" - port = nb.start(debug_log=configs.debug, multi_graphd=configs.multi_graphd) + debug = opt_is(configs.debug, "true") + port = nb.start(debug_log=debug, multi_graphd=configs.multi_graphd) # Load csv data pool = get_conn_pool(address, port) @@ -105,10 +110,6 @@ def stop_nebula(nb, configs=None): print('nebula services have been stopped.') -def opt_is(val, expect): - return type(val) == str and val.lower() == expect - - if __name__ == "__main__": try: parser = init_parser()