Closed GoogleCodeExporter closed 9 years ago
Hello, not sure if you all are familiar with contextual diffs. But I basically
put a
check in CIDR. If it's a tuple, it's not a CIDR IP. Well it could be, but that
would
be silly. Then I don't know why your end = start(1), start = start(0) didn't
work,
but I just set it at the same time and commented out the previous code.
--- /usr/lib/python2.4/site-packages/iptools-0.2-py2.4.egg/iptools/__init__.py
2010-01-02 17:19:59.000000000 -0600
+++ __init__.py 2010-01-02 17:22:40.000000000 -0600
@@ -153,6 +153,10 @@
Returns:
True if str is a valid CIDR address, False otherwise
"""
+ # Quick check: If it's a tuple, toodles.
+ if isinstance(s, tuple):
+ return False
+
if _CIDR_RE.match(s):
ip, mask = s.split('/')
if validate_ip(ip):
@@ -378,10 +382,12 @@
start, end = cidr2block(start)
elif end is None:
+ # This should work but it didn't. So I just set them both, once.
if isinstance(start, tuple):
+ start, end = start
# tuple range
- end = start(1)
- start = start(0)
+ #end = start(1)
+ #start = start(0)
else:
# degenerate range
end = start
Original comment by cimmeri...@gmail.com
on 2 Jan 2010 at 11:28
Apparently I never tested the tuple constructor. :(
Fixed in r15.
Original comment by casadebender
on 4 Jan 2010 at 3:52
Original issue reported on code.google.com by
cimmeri...@gmail.com
on 2 Jan 2010 at 4:48