Updates to handle addition and removal of interfaces#12
Merged
Conversation
bjester
commented
Sep 29, 2021
| try: | ||
| return e.args[0] | ||
| except IndexError: | ||
| return None |
Member
Author
There was a problem hiding this comment.
It appeared that the OSError, socket.error exceptions had an explicit errno attribute so I made this match that, and also be defensive since the previous assert could be removed with python -O.
bjester
commented
Sep 29, 2021
| self.log_exception_warning() | ||
| except Exception as e: # TODO stop catching all Exceptions | ||
| if get_errno(e) == errno.ENETUNREACH: | ||
| self.log_warning_once("Network unreachable on interface {}".format(interface)) |
Member
Author
There was a problem hiding this comment.
A fix to log socket write errors as simple warnings, as observed when interface becomes disconnected.
9 tasks
rtibbles
approved these changes
Sep 30, 2021
Member
rtibbles
left a comment
There was a problem hiding this comment.
Tests pass, new test makes sense, new functionality is awesome!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
assertthat should likely persist ifpython -Ois usedZeroconf.__init__into its own method_add_interfaces_add_interfacesfunctions but in reverseZeroconf.update_interfaceswhich triggers add or removal of interfaces compared with already attached interfaceserrno.ENETUNREACHZeroconf.sendto accept aninterfaceon which filter the interfaces it sends the messages on, such that adding and removing interfaces can attempt to send add/remove messages when the interface is removedWARNING: Network unreachable on interface 10.8.0.21Notes
update_serviceevents, I believe the following scenario is handled: