Skip to content

Commit

Permalink
Merge pull request #812 from gbregman/devel
Browse files Browse the repository at this point in the history
Fix output redirection for get_subsystems CLI output
  • Loading branch information
gbregman authored Aug 20, 2024
2 parents a7b0b7f + 3314c23 commit e3bf616
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion control/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -1824,14 +1824,16 @@ 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
subsystems_out = json_format.MessageToJson(
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()))
Expand Down

0 comments on commit e3bf616

Please sign in to comment.