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

Function get_primary_zones

python3_cron_scripts/mark_expired.py:36–55  ·  view source on GitHub ↗

The whois_lookups script is not reliable for international zones Therefore, we want to trim the list to ones that we know work. This is the more traditional (.com, .net, .org, etc.) This list of trust will be expanded over time.

(logger, zones)

Source from the content-addressed store, hash-verified

34
35
36def get_primary_zones(logger, zones):
37 """
38 The whois_lookups script is not reliable for international zones
39 Therefore, we want to trim the list to ones that we know work.
40 This is the more traditional (.com, .net, .org, etc.)
41 This list of trust will be expanded over time.
42 """
43 supported_tld_list = ["com", "net", "org"]
44 new_zones = []
45 for zone in zones:
46 try:
47 tld = get_tld(zone, fix_protocol=True)
48 except:
49 logger.warning(zone + " was not compatible with TLD")
50 continue
51
52 if tld in supported_tld_list:
53 new_zones.append(zone)
54
55 return new_zones
56
57
58def main(logger=None):

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected