Skip to content

Commit

Permalink
fix: simplify unregister, not working and tracker down logic (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
onedr0p authored Sep 30, 2024
1 parent 4de5b22 commit 22c9c92
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions qbtools/commands/tagging.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,21 +134,10 @@ def __init__(args, logger):
tags_to_add.append(f"domain:{domain}")

working = any([s.status == TrackerStatus.WORKING for s in filtered_trackers])
if (args.unregistered or args.tracker_down or args.not_working) and not working:
unregistered_matched = (
any(x in z.msg.upper() for x in UNREGISTERED_MATCHES for z in filtered_trackers)
if args.unregistered
else False
)
maintenance_matched = (
any(x in z.msg.upper() for x in MAINTENANCE_MATCHES for z in filtered_trackers)
if args.tracker_down
else False
)

if args.unregistered and unregistered_matched:
if not working:
if args.unregistered and any(x in z.msg.upper() for z in filtered_trackers for x in UNREGISTERED_MATCHES):
tags_to_add.append("unregistered")
elif args.tracker_down and maintenance_matched:
elif args.tracker_down and any(x in z.msg.upper() for z in filtered_trackers for x in MAINTENANCE_MATCHES):
tags_to_add.append("tracker-down")
elif args.not_working:
tags_to_add.append("not-working")
Expand Down

0 comments on commit 22c9c92

Please sign in to comment.