From: Faiyaz Ahmed Date: Thu, 6 Mar 2008 16:01:56 +0000 (+0000) Subject: to support pl_mom list emails instead of mails to support X-Git-Tag: 1.7-3~22 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=4c5cb74ef18fde013d440f6d2243aa71978c7b3d;hp=460f8c534c63e20d595a294409d84f59259e7136;p=nodemanager.git to support pl_mom list emails instead of mails to support --- diff --git a/bwmon.py b/bwmon.py index ec8c552..0e9f78e 100644 --- a/bwmon.py +++ b/bwmon.py @@ -32,26 +32,22 @@ import database from sets import Set +# Defaults +debug = False +verbose = False +datafile = "/var/lib/misc/bwmon.dat" + try: sys.path.append("/etc/planetlab") from plc_config import * except: logger.log("bwmon: Warning: Configuration file /etc/planetlab/plc_config.py not found") - PLC_NAME = "PlanetLab" - PLC_SLICE_PREFIX = "pl" - PLC_MAIL_SUPPORT_ADDRESS = "support@planet-lab.org" - PLC_MAIL_SLICE_ADDRESS = "SLICE@slices.planet-lab.org" + logger.log("bwmon: Running in DEBUG mode. Logging to file and not emailing.") # Constants seconds_per_day = 24 * 60 * 60 bits_per_byte = 8 -# Defaults -debug = False -verbose = False -datafile = "/var/lib/misc/bwmon.dat" -#nm = None - # Burst to line rate (or node cap). Set by NM. in KBit/s default_MaxRate = int(bwlimit.get_bwcap() / 1000) default_Maxi2Rate = int(bwlimit.bwmax / 1000) @@ -133,13 +129,8 @@ def slicemail(slice, subject, body): sendmail = os.popen("/usr/sbin/sendmail -N never -t -f%s" % PLC_MAIL_SUPPORT_ADDRESS, "w") - # PLC and PLE has a separate list for pl_mom messages - if PLC_MAIL_SUPPORT_ADDRESS == "support@planet-lab.org": - to = ["pl-mom@planet-lab.org"] - elif PLC_MAIL_SUPPORT_ADDRESS == "support@planet-lab.eu": - to = ["pl-mom@planet-lab.eu"] - else: - to = [PLC_MAIL_SUPPORT_ADDRESS] + # Parsed from MyPLC config + to = [PLC_MAIL_MOM_LIST_ADDRESS] if slice is not None and slice != "root": to.append(PLC_MAIL_SLICE_ADDRESS.replace("SLICE", slice))