mirror of
https://github.com/craigerl/aprsd.git
synced 2025-04-20 18:33:11 -04:00
Fixed failure with fetch-stats
This patch fails nicely with the fetch-stats if it can't connect with the rpc server on the other end.
This commit is contained in:
parent
cb9456b29d
commit
10d023dd7b
@ -58,7 +58,11 @@ def fetch_stats(ctx, host, port, magic_word):
|
||||
with console.status(msg):
|
||||
client = rpc_client.RPCClient(host, port, magic_word)
|
||||
stats = client.get_stats_dict()
|
||||
console.print_json(data=stats)
|
||||
if stats:
|
||||
console.print_json(data=stats)
|
||||
else:
|
||||
LOG.error(f"Failed to fetch stats via RPC aprsd server at {host}:{port}")
|
||||
return
|
||||
aprsd_title = (
|
||||
"APRSD "
|
||||
f"[bold cyan]v{stats['aprsd']['version']}[/] "
|
||||
|
Loading…
Reference in New Issue
Block a user