1
0
mirror of https://github.com/craigerl/aprsd.git synced 2024-11-16 05:12:01 -05:00

Ensure fetch-stats ip is a string

This commit is contained in:
Hemna 2023-07-22 16:41:54 -04:00
parent 6ae55fc9a1
commit cbef93b327
2 changed files with 3 additions and 6 deletions

View File

@ -51,7 +51,7 @@ def fetch_stats(ctx, ip_address, port, magic_word):
console = Console() console = Console()
with console.status(msg): with console.status(msg):
client = rpc_client.RPCClient(ip_address, port, magic_word) client = rpc_client.RPCClient(str(ip_address), port, magic_word)
stats = client.get_stats_dict() stats = client.get_stats_dict()
console.print_json(data=stats) console.print_json(data=stats)
aprsd_title = ( aprsd_title = (

View File

@ -52,11 +52,9 @@ class RPCClient:
LOG.debug(f"RPC Client: {self.ip}:{self.port} {self.magic_word}") LOG.debug(f"RPC Client: {self.ip}:{self.port} {self.magic_word}")
def _rpyc_connect( def _rpyc_connect(
self, host, port, self, host, port, service=rpyc.VoidService,
service=rpyc.VoidService,
config={}, ipv6=False, config={}, ipv6=False,
keepalive=False, authorizer=None, keepalive=False, authorizer=None, ):
):
print(f"Connecting to RPC host {host}:{port}") print(f"Connecting to RPC host {host}:{port}")
try: try:
@ -71,7 +69,6 @@ class RPCClient:
def get_rpc_client(self): def get_rpc_client(self):
if not self._rpc_client: if not self._rpc_client:
CONF.rpc_settings.magic_word
self._rpc_client = self._rpyc_connect( self._rpc_client = self._rpyc_connect(
self.ip, self.ip,
self.port, self.port,