From 3314c2392dc2b0f738d26befdf260e5f713423c2 Mon Sep 17 00:00:00 2001 From: Gil Bregman Date: Tue, 20 Aug 2024 17:07:06 +0300 Subject: [PATCH] Fix output redirection for get_subsystems CLI output. Fixes #800 Signed-off-by: Gil Bregman --- control/cli.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/control/cli.py b/control/cli.py index 6366968f..5264554a 100644 --- a/control/cli.py +++ b/control/cli.py @@ -1824,6 +1824,8 @@ def namespace(self, args): @cli.cmd() def get_subsystems(self, args): """Get subsystems""" + out_func, err_func = self.get_output_functions(args) + subsystems = self.stub.get_subsystems(pb2.get_subsystems_req()) if args.format == "python": return subsystems @@ -1831,7 +1833,7 @@ def get_subsystems(self, args): subsystems, indent=4, including_default_value_fields=True, preserving_proto_field_name=True) - self.logger.info(f"Get subsystems:\n{subsystems_out}") + out_func(f"Get subsystems:\n{subsystems_out}") def main_common(client, args): client.logger.setLevel(GatewayEnumUtils.get_value_from_key(pb2.GwLogLevel, args.log_level.lower()))