diff options
-rw-r--r-- | devbot/release.py | 8 |
1 files changed, 6 insertions, 2 deletions
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 |