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

Method find_partner_range

python3_cron_scripts/libs3/IPManager.py:366–414  ·  view source on GitHub ↗

Find the CIDR range and partner for the provided IP

(self, ip)

Source from the content-addressed store, hash-verified

364 return False
365
366 def find_partner_range(self, ip):
367 """
368 Find the CIDR range and partner for the provided IP
369 """
370 if isinstance(ip, str):
371 ip_addr = IPAddress(ip)
372 else:
373 ip_addr = ip
374
375 if self.Akamai_IPs is None:
376 self.__get_akamai_ips()
377 self.__get_akamai_ipv6s()
378
379 cidr = self.find_cidr(ip_addr, self.Akamai_IPs)
380 if cidr is not None:
381 return self.AKAMAI, cidr
382
383 if self.AWS_IPs is None:
384 self.__get_aws_ips()
385 self.__get_aws_ipv6s()
386
387 cidr = self.find_cidr(ip_addr, self.AWS_IPs)
388 if cidr is not None:
389 return self.AWS, cidr
390
391 if self.Azure_IPs is None:
392 self.__get_azure_ips()
393
394 cidr = self.find_cidr(ip_addr, self.Azure_IPs)
395 if cidr is not None:
396 return self.AZURE, cidr
397
398 if self.Tracked_CIDRs is None:
399 self.__get_tracked_cidrs()
400 self.__get_tracked_ipv6_cidrs()
401
402 cidr = self.find_cidr(ip_addr, self.Tracked_CIDRs)
403 if cidr is not None:
404 return self.TRACKED, cidr
405
406 if self.GCP_IPs is None:
407 self.__get_gcp_ips()
408 self.__get_gcp_ipv6s()
409
410 cidr = self.find_cidr(ip_addr, self.GCP_IPs)
411 if cidr is not None:
412 return self.GCP, cidr
413
414 return self.UNKNOWN, None
415
416 def find_partner_notes(self, cidr_value, partner):
417 """

Callers 1

insert_recordMethod · 0.95

Calls 10

__get_akamai_ipsMethod · 0.95
__get_akamai_ipv6sMethod · 0.95
find_cidrMethod · 0.95
__get_aws_ipsMethod · 0.95
__get_aws_ipv6sMethod · 0.95
__get_azure_ipsMethod · 0.95
__get_tracked_cidrsMethod · 0.95
__get_gcp_ipsMethod · 0.95
__get_gcp_ipv6sMethod · 0.95

Tested by

no test coverage detected