MCPcopy Create free account
hub / github.com/adobe/Marinus / find_cidr

Method find_cidr

python3_cron_scripts/libs3/IPManager.py:253–270  ·  view source on GitHub ↗

Is the provided IP in one of the provided CIDRs? Returns the CIDR that matches

(self, ip, cidrs)

Source from the content-addressed store, hash-verified

251 return False
252
253 def find_cidr(self, ip, cidrs):
254 """
255 Is the provided IP in one of the provided CIDRs?
256 Returns the CIDR that matches
257 """
258 try:
259 if isinstance(ip, str):
260 local_ip = IPAddress(ip)
261 else:
262 local_ip = ip
263
264 for network in cidrs:
265 if local_ip in network:
266 return network
267 except:
268 return None
269
270 return None
271
272 def is_aws_ip(self, ip):
273 """

Callers 1

find_partner_rangeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected