Skip to content

Commit a928076

Browse files
kamalmostafascrool
authored andcommitted
Actually use the --hostname destination_host
DiscoveryInterface() calls InterfaceAgent() incorrectly, such that destination_host gets lost. The result is that the cli --hostname argument does nothing: InterfaceAgent ends up pinging the broadcast address regardless of whether or not --hostname <address> is specified. Fix that! Fixes: #145
1 parent febce92 commit a928076

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

xled/discover.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,10 @@ def __init__(self, destination_host=None, receive_timeout=None):
161161
self.ctx = zmq.Context()
162162
p0, p1 = pipe(self.ctx)
163163
self.agent = InterfaceAgent(
164-
self.ctx, p1, destination_host, receive_timeout=receive_timeout
164+
self.ctx,
165+
p1,
166+
destination_host=destination_host,
167+
receive_timeout=receive_timeout,
165168
)
166169
self.agent_thread = Thread(target=self.agent.start)
167170
self.agent_thread.start()
@@ -332,6 +335,7 @@ def __init__(
332335
if loop is None:
333336
loop = IOLoop.instance()
334337
self.loop = loop
338+
log.debug(f"InterfaceAgent destination_host={destination_host}.")
335339
if destination_host:
336340
udp = udp_client.UDPClient(
337341
PING_PORT_NUMBER,

0 commit comments

Comments
 (0)