diff bin/sendnotificationmails.py @ 576:8f62a825addb

Use shlex.split for build_listpanding command because the string may contain arguments like --config-file foo.cfg When returning lists cmdexpand replacement variable must use @ instead of $
author Bjoern Ricks <bricks@intevation.de>
date Sat, 03 Sep 2011 11:35:36 +0000
parents 7de7869962ef
children 7a9841e4958f
line wrap: on
line diff
--- a/bin/sendnotificationmails.py	Sat Sep 03 10:55:32 2011 +0000
+++ b/bin/sendnotificationmails.py	Sat Sep 03 11:35:36 2011 +0000
@@ -23,7 +23,8 @@
 from treepkg.cmdexpand import cmdexpand
 
 notification_desc = [("build_user", str, ""), ("build_host", str, ""),
-                     "build_listpending", "notification_template",
+                     ("build_listpending", shlex.split),
+                     "notification_template",
                      "smtp_host", ("smtp_port", int),
                      ]
 
@@ -59,10 +60,10 @@
     template = open(config["notification_template"]).read()
 
     if not config.get("build_user") or not config.get("build_host"):
-        lines = capture_output(cmdexpand("$build_listpending", **config))
+        lines = capture_output(cmdexpand("@build_listpending", **config))
     else:
         lines = capture_output(cmdexpand("ssh $build_user$@$build_host"
-                                         " $build_listpending",
+                                         " @build_listpending",
                                          **config))
     for line in lines.splitlines():
         words = line.split()
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)