Get all the zones
(mongo_connector)
| 37 | |
| 38 | |
| 39 | def 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 | |
| 57 | def get_fld_from_value(value, zone): |
no test coverage detected