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

Method check_in_cidr

python3_cron_scripts/libs3/IPManager.py:233–251  ·  view source on GitHub ↗

Is the provided IP in one of the provided CIDRs? Returns a true/false result

(self, ip, cidrs)

Source from the content-addressed store, hash-verified

231 self.Tracked_CIDRs.append(IPNetwork(result["zone"]))
232
233 def check_in_cidr(self, ip, cidrs):
234 """
235 Is the provided IP in one of the provided CIDRs?
236 Returns a true/false result
237 """
238 try:
239 if isinstance(ip, str):
240 local_ip = IPAddress(ip)
241 else:
242 local_ip = ip
243
244 for network in cidrs:
245 if local_ip in network:
246 return True
247 except Exception as e:
248 self._logger.debug(f"Error checking CIDR: {e}")
249 return False
250
251 return False
252
253 def find_cidr(self, ip, cidrs):
254 """

Callers 6

is_aws_ipMethod · 0.95
is_azure_ipMethod · 0.95
is_gcp_ipMethod · 0.95
is_tracked_ipMethod · 0.95
is_akamai_ipMethod · 0.95
is_local_ipMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected