mirror of https://github.com/craigerl/aprsd.git
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):
|
with console.status(msg):
|
||||||
client = rpc_client.RPCClient(host, port, magic_word)
|
client = rpc_client.RPCClient(host, port, magic_word)
|
||||||
stats = client.get_stats_dict()
|
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_title = (
|
||||||
"APRSD "
|
"APRSD "
|
||||||
f"[bold cyan]v{stats['aprsd']['version']}[/] "
|
f"[bold cyan]v{stats['aprsd']['version']}[/] "
|
||||||
|
|
Loading…
Reference in New Issue