Added get_ip_networks_from_file() convenience function - #7
Open
Script-Nomad wants to merge 3 commits into
Open
Conversation
zeroSteiner
requested changes
Oct 24, 2020
zeroSteiner
left a comment
Owner
There was a problem hiding this comment.
Would you also be able to add a unit test for this? You can write a file to /tmp if you'd like.
|
|
||
| # Semantic Versioning: http://semver.org/spec/v2.0.0.html | ||
| version_info = collections.namedtuple('version_info', ['major', 'minor', 'micro'])(2, 0, 1) | ||
| version_info = collections.namedtuple('version_info', ['major', 'minor', 'micro'])(2, 0, 2) |
Owner
There was a problem hiding this comment.
For a feature we should be bumping the minor version not the patch.
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.
Created a little convenience function that I use quite a bit for parsing files of IP addresses and CIDR networks.
Offers a "strict" flag that defaults to True and bubbles errors up when it encounters an invalid IPv4Network in a file. When the strict flag is set to False, it ignores invalid lines and proceeds silently. It is left up to the user to handle the errors encountered.
Thought it might make a useful addition to the library.
This commit iterates the micro version to 2.0.2
Recommend squashing commits to keep the history clean.
Example output run in IDLE: