packerlicious icon indicating copy to clipboard operation
packerlicious copied to clipboard

Add ip network (cidr) validation

Open stevelle opened this issue 8 years ago • 2 comments

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

Fixes #80

Issue

https://github.com/mayn/packerlicious/issues/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 :)

stevelle avatar Oct 19 '17 08:10 stevelle

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.

stevelle avatar Oct 19 '17 10:10 stevelle

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

mayn avatar Oct 19 '17 13:10 mayn