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

Function update_zones

python3_cron_scripts/send_remote_server.py:35–55  ·  view source on GitHub ↗

Copy all the currently known FLDs to the remote database.

(logger, mongo_connector, rm_connector, update_zone_list)

Source from the content-addressed store, hash-verified

33
34
35def update_zones(logger, mongo_connector, rm_connector, update_zone_list):
36 """
37 Copy all the currently known FLDs to the remote database.
38 """
39 logger.info("Starting Zones..")
40 zones_collection = mongo_connector.get_zone_connection()
41 remote_zones_collection = rm_connector.get_zone_connection()
42
43 zones = zones_collection.find({}, {"_id": 0})
44 zone_list = []
45
46 if update_zone_list:
47 remote_zones_collection.delete_many({})
48 for zone in zones:
49 remote_zones_collection.insert_one(zone)
50 zone_list.append(zone["zone"])
51 else:
52 for zone in zones:
53 zone_list.append(zone["zone"])
54
55 return zone_list
56
57
58def update_ip_zones(logger, mongo_connector, rm_connector):

Callers 1

mainFunction · 0.85

Calls 1

get_zone_connectionMethod · 0.45

Tested by

no test coverage detected