Add flag to exclude policy exempt field trials when listing expired ones

Bug: None
Change-Id: I07bc9f3ad1172bcdaf205937fb518ec295c022bf
No-Try: True
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/346420
Commit-Queue: Emil Lundmark <lndmrk@webrtc.org>
Reviewed-by: Jeremy Leconte <jleconte@google.com>
Cr-Commit-Position: refs/heads/main@{#42019}
This commit is contained in:
Emil Lundmark 2024-04-09 10:40:37 +02:00 committed by WebRTC LUCI CQ
parent d6f382f463
commit 47cfed2a7d

View file

@ -1027,7 +1027,9 @@ def cmd_header(args: argparse.Namespace) -> None:
def cmd_expired(args: argparse.Namespace) -> None: def cmd_expired(args: argparse.Namespace) -> None:
today = todays_date() today = todays_date()
diff = datetime.timedelta(days=args.in_days) diff = datetime.timedelta(days=args.in_days)
expired = expired_field_trials(today + diff) expired = expired_field_trials(
today + diff,
REGISTERED_FIELD_TRIALS if args.exempt else ACTIVE_FIELD_TRIALS)
if len(expired) <= 0: if len(expired) <= 0:
return return
@ -1072,6 +1074,11 @@ def main() -> None:
Lists all expired field trials. Exits with a non-zero exit status if Lists all expired field trials. Exits with a non-zero exit status if
any field trials has expired, ignoring the --in-days argument. any field trials has expired, ignoring the --in-days argument.
''') ''')
parser_expired.add_argument(
'--exempt',
default=True,
action=argparse.BooleanOptionalAction,
help='whether to include policy exempt field trials')
parser_expired.add_argument( parser_expired.add_argument(
'--in-days', '--in-days',
default=0, default=0,