Signed-off-by: Mattia Rizzolo's avatarMattia Rizzolo <mattia@debian.org>
parent a090f160
......@@ -18,7 +18,7 @@ from email.utils import getaddresses, parseaddr
parser = argparse.ArgumentParser()
parser.add_argument('-n', '--dry-run', action='store_true')
parser.add_argument('origin_file', metavar='email',
help='file containing the email to be relayed to IRC')
help='file containing the email to be relayed to IRC')
args = parser.parse_args()
......@@ -114,8 +114,7 @@ Subject: {subject}
First line: {fline}
IRC msg: {ircmsg}
.'''.format(date=date, jenkins_job=jenkins_job, channels=channels,
subject=subject, fline=fline, ircmsg=ircmsg)
subject=subject, fline=fline, ircmsg=ircmsg))
if args.dry_run:
print('Running in dry-run mode, not actually notifying kgb')
......@@ -126,10 +125,10 @@ for ch in channels:
print('Noifying kgb for {}...'.format(ch))
p = run(['kgb-client', '--conf', '/srv/jenkins/kgb/{}.conf'.format(ch),
'--relay-msg', ircmsg], check=True)
'--relay-msg', ircmsg], check=True)
except CalledProcessError as p:
print('E: kgb-client returned an error (code {})'.format(p.returncode),
print('kgb informed successfully')
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment