When adding new IP addresses using cyhy-ip add TEST_ENTITY <IP address>, some IPs are returning an error.
To reproduce
cyhy-ip add TEST_ENTITY <IP address>
Traceback (most recent call last):
File "/usr/local/bin/cyhy-ip", line 506, in <module>
main()
File "/usr/local/bin/cyhy-ip", line 484, in main
add(db, args["OWNER"], nets)
File "/usr/local/bin/cyhy-ip", line 175, in add
country = geo_loc_db.check_restricted_ip(ip)
File "/usr/local/lib/python2.7/dist-packages/cyhy/core/geoloc.py", line 81, in check_restricted_ip
print >> sys.stderr, "CIDR %s not found in geolocation database" % cidr
NameError: global name 'cidr' is not defined
Expected behavior
We would expect for the code to return:
$ cyhy-ip add TEST_ENTITY <IP address>
IPs added to request, and initialized. Tally sync required to start scan of new IPs.
▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶▶| ETA: 0:00:00
🐛 Summary
When adding new IP addresses using
cyhy-ip add TEST_ENTITY <IP address>
, some IPs are returning an error.To reproduce
Expected behavior
We would expect for the code to return:
Any helpful log output or screenshots
To fix this bug, change this line from:
to this: