From a927ca8cf22c89eb1c3b1cb2798b8f94c87bd049 Mon Sep 17 00:00:00 2001 From: Daniel Narvaez Date: Mon, 24 Dec 2012 10:39:24 +0000 Subject: Remove the announce file from remote host --- (limited to 'devbot') diff --git a/devbot/release.py b/devbot/release.py index 0139e14..a9f5a64 100644 --- a/devbot/release.py +++ b/devbot/release.py @@ -18,7 +18,7 @@ def upload(module, path): return subprocess.call(["scp", path, upload_dest]) == 0 def announce(module, filename, version, annotation): - fd, announce_path = tempfile.mkstemp("announce-") + fd, announce_path = tempfile.mkstemp(prefix="announce-") with os.fdopen(fd, "w") as f: f.write("From: %s\n" % _get_email()) @@ -33,10 +33,14 @@ def announce(module, filename, version, annotation): upload_dest = "%s:~" % upload_host if subprocess.call(["scp", announce_path, upload_dest]) == 0: + announce_basename = os.path.basename(announce_path) + if subprocess.call(["ssh", upload_host, "sendmail", "-t", - "<", os.path.basename(announce_path)]): + "<", announce_basename]): result = True + subprocess.check_call(["ssh", upload_host, "rm", announce_basename]) + os.unlink(announce_path) return result -- cgit v0.9.1