Mercurial > treepkg
diff bin/sendnotificationmails.py @ 466:e4c0beab5328
Allow sending notifications from a local treepkg via sendnotificationmails.py
author | Andre Heinecke <aheinecke@intevation.de> |
---|---|
date | Thu, 09 Sep 2010 14:46:13 +0000 |
parents | 1fcdffbeb9de |
children | a4efa91bc3b2 |
line wrap: on
line diff
--- a/bin/sendnotificationmails.py Thu Sep 09 14:26:59 2010 +0000 +++ b/bin/sendnotificationmails.py Thu Sep 09 14:46:13 2010 +0000 @@ -20,8 +20,8 @@ from treepkg.run import capture_output from treepkg.cmdexpand import cmdexpand -notification_desc = ["build_user", "build_host", "build_listpending", - "notification_template", +notification_desc = [("build_user", str, ""), ("build_host", str, ""), + "build_listpending", "notification_template", "smtp_host", ("smtp_port", int), ] @@ -56,9 +56,12 @@ template = open(config["notification_template"]).read() - lines = capture_output(cmdexpand("ssh $build_user$@$build_host" - " $build_listpending", - **config)) + if not config.get("build_user") or not config.get("build_host"): + lines = capture_output(cmdexpand("$build_listpending", **config)) + else: + lines = capture_output(cmdexpand("ssh $build_user$@$build_host" + " $build_listpending", + **config)) for line in lines.splitlines(): words = line.split() if len(words) == 4: