Conditions | 1 |
Total Lines | 6 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | #!/usr/bin/env python3 |
||
20 | def delete_liveness_non_existent(liveness_controller: LivenessController) -> int: |
||
21 | """Delete liveness documents which don't exist on switches.interfaces docs.""" |
||
22 | db = liveness_controller.db |
||
23 | return db.liveness.delete_many( |
||
24 | {"_id": {"$nin": db.switches.distinct("interfaces.id")}} |
||
25 | ).deleted_count |
||
26 | |||
49 |