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

Function get_zones

python3_cron_scripts/whois_lookups.py:39–54  ·  view source on GitHub ↗

Get all the zones

(mongo_connector)

Source from the content-addressed store, hash-verified

37
38
39def get_zones(mongo_connector):
40 """
41 Get all the zones
42 """
43 zone_collection = mongo_connector.get_zone_connection()
44 zone_results = zone_collection.distinct(
45 "zone", {"status": {"$ne": ZoneManager.FALSE_POSITIVE}}
46 )
47
48 zones = []
49 for zone in zone_results:
50 if zone.find(".") >= 0:
51 # The encode-decode is silly but necessary due to a Latin-1 Python quirk when printing.
52 zones.append(zone.encode("utf-8").decode("utf-8"))
53
54 return zones
55
56
57def get_fld_from_value(value, zone):

Callers 1

mainFunction · 0.85

Calls 1

get_zone_connectionMethod · 0.45

Tested by

no test coverage detected