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

Incorrect and invalid glob produced when result's last octet is not * #15

Closed
paragbaxi opened this issue Aug 5, 2011 · 1 comment
Closed

Comments

@paragbaxi
Copy link

This results in not being able to use the glob methods with accurate results.

Examples of incorrect results

Last octet of start range is equal to last octet of end range

>>> a = iprange_to_globs('10.0.0.255', '10.0.255.255')
>>> a
['10.0.*.255']
>>> valid_glob(a[0])
False

The value for a should be ['10.0.0.255', '10.0.1-255.*'].

Last octet of start range is less than last octet of end range

>>> b = iprange_to_globs('10.0.0.254', '10.0.255.255')
>>> b[0]
'10.0.0.254-255'
>>> valid_glob(b[0])
True

The value for b should be ['10.0.0.254-255', '10.0.1-255.*'].

Last octet of start range is greater than last octet of end range:

>>> c = iprange_to_globs('10.0.0.255', '10.0.255.254')
>>> c[0]
'10.0.0.255'
>>> valid_glob(c[0])
True

The value for c should be ['10.0.0.255', '10.0.1-254.*', '10.0.255.0-254'].

Example of correct result

This is not the case when the last octet of the start range is 0 and the last octet of the end range is 255.

>>> z = iprange_to_globs('10.0.0.0', '10.0.255.255')
>>> z
['10.0.*.*']
>>> valid_glob(z[0])
True
@drkjam
Copy link
Collaborator

drkjam commented Sep 13, 2011

fixed in latest checkin

@drkjam drkjam closed this as completed Sep 13, 2011
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

No branches or pull requests

2 participants