1 import sys
2 import datetime
3 from flask_script import Command, Option
4 from coprs import db, app
5 from coprs.logic import coprs_logic
6 from coprs.mail import send_mail, OutdatedChrootMessage
7
8
10 """
11 Notify all admins of projects with builds in outdated chroots about upcoming deletion.
12 """
13 option_list = [
14 Option("--dry-run", action="store_true",
15 help="Do not actually notify the people, but rather print information on stdout"),
16 Option("-e", "--email", action="append", dest="email_filter",
17 help="Notify only "),
18 Option("-a", "--all", action="store_true",
19 help="Notify all (even the recently notified) relevant people"),
20 ]
21
22 - def run(self, dry_run, email_filter, all):
38
49
65
67 if app.config["ENV"] != "production" and not self.email_filter:
68 sys.stderr.write("I will not let you send emails to all Copr users from the dev instance!\n")
69 sys.stderr.write("Please use this command with -e myself@foo.bar\n")
70 sys.exit(1)
71
72
74 - def notify(self, user, chroots):
77
82
83
85 - def notify(self, user, chroots):
88
91