Skip to content

Commit d0c455a

Browse files
add logic to chage rest params when set engine from pandas to rest
Signed-off-by: Lanuti_emanuele <[email protected]>
1 parent 5395b03 commit d0c455a

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

suzieq/cli/sqcmds/context_commands.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
from termcolor import cprint, colored
88

99
from suzieq.cli.nubia_patch import argument
10-
from suzieq.shared.utils import SUPPORTED_ENGINES, print_version
10+
from suzieq.shared.utils import SUPPORTED_ENGINES,\
11+
print_version,\
12+
set_rest_engine
1113

1214

1315
@command("set")
@@ -86,7 +88,13 @@ def set_ctxt(
8688
ctxt.end_time = end_time
8789

8890
if engine:
89-
plugin_ctx.change_engine(engine)
91+
if ctxt.engine != engine:
92+
if engine == 'rest':
93+
ctxt.rest_server_ip,\
94+
ctxt.rest_server_port,\
95+
ctxt.rest_transport,\
96+
ctxt.rest_api_key = set_rest_engine(ctxt.cfg)
97+
plugin_ctx.change_engine(engine)
9098

9199
if debug:
92100
ctxt.debug = debug == 'True'

0 commit comments

Comments
 (0)