# HG changeset patch # User Andre Heinecke # Date 1284043573 0 # Node ID e4c0beab53281b0c52e7d04f9365e6c2cb2da12a # Parent 296d26453e2ab32711155cbc10008dd086d0b889 Allow sending notifications from a local treepkg via sendnotificationmails.py diff -r 296d26453e2a -r e4c0beab5328 bin/sendnotificationmails.py --- 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: diff -r 296d26453e2a -r e4c0beab5328 demonotification.cfg --- a/demonotification.cfg Thu Sep 09 14:26:59 2010 +0000 +++ b/demonotification.cfg Thu Sep 09 14:46:13 2010 +0000 @@ -5,12 +5,13 @@ [notification] -# Username and host on which the treepackager runs. +# Username and host on which the a remote treepackager runs. +# Leave commented if treepkg runs locally # sendnotificationmails.py has to be able to connect to that host as the # builduser via ssh without knowing the password. This is best # achieved with the ssh-agent. -build_user: builder -build_host: localhost +# build_user: builder +# build_host: localhost # the program to run on build_host to list the pending notifications # currently sendnotificationmails.py assumes that the default