mirror of
https://github.com/9001/copyparty.git
synced 2025-08-17 09:02:15 -06:00
mdns: improve nic-ip changelog
if a NIC is brought up with several IPs, it would only mention one of the new IPs in the logs or if a PCIe bus crashes and all NICs drop dead, it would only mention one of the IPs that disappeared as both scenarios are oddly common, be more verbose
This commit is contained in:
parent
64501fd7f1
commit
a49bf81ff2
|
@ -402,17 +402,17 @@ class TcpSrv(object):
|
|||
if not netdevs:
|
||||
continue
|
||||
|
||||
added = "nothing"
|
||||
removed = "nothing"
|
||||
add = []
|
||||
rem = []
|
||||
for k, v in netdevs.items():
|
||||
if k not in self.netdevs:
|
||||
added = "{} = {}".format(k, v)
|
||||
add.append("\n added %s = %s" % (k, v))
|
||||
for k, v in self.netdevs.items():
|
||||
if k not in netdevs:
|
||||
removed = "{} = {}".format(k, v)
|
||||
rem.append("\nremoved %s = %s" % (k, v))
|
||||
|
||||
t = "network change detected:\n added {}\033[0;33m\nremoved {}"
|
||||
self.log("tcpsrv", t.format(added, removed), 3)
|
||||
t = "network change detected:\033[32m%s\033[33m%s"
|
||||
self.log("tcpsrv", t % ("".join(add), "".join(rem)), 3)
|
||||
self.netdevs = netdevs
|
||||
self._distribute_netdevs()
|
||||
|
||||
|
|
Loading…
Reference in a new issue