Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ip network (cidr) validation #81

Closed
wants to merge 2 commits into from
Closed

Conversation

stevelle
Copy link

Uses a backport of the Python 3.3 ipaddress library
for Python 2.x implementation.

Fixes #80

Issue

#80

List of Changes Proposed

Added a dependency for a backport from a Python 3.3 module
Had to add unicode string handling as part of the implementation due to the expectation of unicode in the Python 3.3 module.
Added both positive and negative tests covering each of IPv4 and IPv6 formats.

Testing Evidence

py26: commands succeeded
py27: commands succeeded
SKIPPED: py33: InterpreterNotFound: python3.3
SKIPPED: py34: InterpreterNotFound: python3.4
SKIPPED: py35: InterpreterNotFound: python3.5
py36: commands succeeded
congratulations :)

Uses a backport of the Python 3.3 ipaddress library
for Python 2.x implementation.

Fixes mayn#80
Turns out the travis build doesn't install requirements
@stevelle
Copy link
Author

From the Py2.6 run:
line 640:
Successfully installed asn1crypto-0.23.0 certifi-2017.7.27.1 cffi-1.11.2 chardet-3.0.4 coverage-4.4.1
coveralls-1.2.0 cryptography-2.0.3 docopt-0.6.2 enum34-1.1.6 idna-2.6 ipaddress-1.0.18 pluggy-0.5.2
pyOpenSSL-17.3.0 pycparser-2.18 requests-2.18.4 tox-2.9.1 tox-travis-0.8 urllib3-1.22 virtualenv-15.1.0

From py2.7 run:
line 537:
Successfully installed asn1crypto-0.23.0 certifi-2017.7.27.1 cffi-1.11.2 chardet-3.0.4 coverage-4.4.1
coveralls-1.2.0 cryptography-2.1.1 docopt-0.6.2 enum34-1.1.6 idna-2.6 ipaddress-1.0.18 pluggy-0.5.2
pyOpenSSL-17.3.0 pycparser-2.18 requests-2.18.4 tox-2.9.1 tox-travis-0.8 urllib3-1.22 virtualenv-15.1.0

not sure why the import later fails.

@mayn
Copy link
Owner

mayn commented Oct 19, 2017

@stevelle, thanks for the PR! Interesting problem I will debug later today

@stevelle stevelle closed this Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

validator function to detect malformed cidrs
2 participants