diff options
author | Jon Turney <jon.turney@dronecode.org.uk> | 2023-07-08 15:23:11 +0300 |
---|---|---|
committer | Jon Turney <jon.turney@dronecode.org.uk> | 2023-08-15 17:57:00 +0300 |
commit | 3d778791f91c1440fb6a5a7418d9549071ee7814 (patch) | |
tree | 6b0eea036e41617610cbe28b7d121a7742b75b0d /calm/calm.py | |
parent | f2764f165b23b2e9ae03849c84fb7ed310ed12b7 (diff) |
Factor out email sending to utils
Smooth out some issues when --email isn't specified, making args.email
an empty list rather than None, which can't be iterated.
When the To: address is 'debug', dump email to log, rather than stdout.
Diffstat (limited to 'calm/calm.py')
-rwxr-xr-x | calm/calm.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/calm/calm.py b/calm/calm.py index 7ea4739..a839873 100755 --- a/calm/calm.py +++ b/calm/calm.py @@ -754,7 +754,7 @@ def main(): parser = argparse.ArgumentParser(description='Upset replacement') parser.add_argument('-d', '--daemon', action='store', nargs='?', const=pidfile_default, help="daemonize (PIDFILE defaults to " + pidfile_default + ")", metavar='PIDFILE') - parser.add_argument('--email', action='store', dest='email', nargs='?', const=common_constants.EMAILS, help="email output to maintainer and ADDRS (ADDRS defaults to '" + common_constants.EMAILS + "')", metavar='ADDRS') + parser.add_argument('--email', action='store', dest='email', nargs='?', default='', const=common_constants.EMAILS, help="email output to maintainer and ADDRS (ADDRS defaults to '" + common_constants.EMAILS + "')", metavar='ADDRS') parser.add_argument('--force', action='count', help="force regeneration of static htdocs content", default=0) parser.add_argument('--homedir', action='store', metavar='DIR', help="maintainer home directory (default: " + homedir_default + ")", default=homedir_default) parser.add_argument('--htdocs', action='store', metavar='DIR', help="htdocs output directory (default: " + htdocs_default + ")", default=htdocs_default) |