From be3607334dff10a4dcf1609ffa70c174007cb214 Mon Sep 17 00:00:00 2001 From: Faiyaz Ahmed Date: Thu, 6 Mar 2008 18:11:41 +0000 Subject: [PATCH] Bug in debug code. Also now sends to mom list address. --- pl_mom.py | 6 +----- swapmon.py | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 17 deletions(-) diff --git a/pl_mom.py b/pl_mom.py index b4e09b0..f058eb4 100644 --- a/pl_mom.py +++ b/pl_mom.py @@ -88,11 +88,7 @@ def removepid(prog): def slicemail(slice, subject, body): sendmail = os.popen("/usr/sbin/sendmail -N never -t -f%s" % PLC_MAIL_SUPPORT_ADDRESS, "w") - # PLC has a separate list for pl_mom messages - if PLC_MAIL_SUPPORT_ADDRESS == "support@planet-lab.org": - to = ["pl-mom@planet-lab.org"] - else: - to = [PLC_MAIL_SUPPORT_ADDRESS] + to = [PLC_MAIL_MOM_LIST_ADDRESS] if slice is not None and slice != "root": to.append(PLC_MAIL_SLICE_ADDRESS.replace("SLICE", slice)) diff --git a/swapmon.py b/swapmon.py index b0c3bb3..7ca19bc 100755 --- a/swapmon.py +++ b/swapmon.py @@ -229,18 +229,18 @@ class Reset: if debug: print reset_subject % params print reset_body % params - try: - pid = os.fork() - if pid == 0: - print "Resetting slice " + self.name - vserver = VServer(self.name) - vserver.stop() - vserver.start(wait = False) - os._exit(0) - else: - os.waitpid(pid,0) - except Exception, err: - print "Warning: Exception received while resetting slice %s:" \ + try: + pid = os.fork() + if pid == 0: + print "Resetting slice " + self.name + vserver = VServer(self.name) + vserver.stop() + vserver.start(wait = False) + os._exit(0) + else: + os.waitpid(pid,0) + except Exception, err: + print "Warning: Exception received while resetting slice %s:" \ % self.name, err if (time.time() - self.resetmail) > email_timeout: slicemail(self.name, reset_subject % params, reset_body % params) -- 2.43.0