- if the appropriate message template doesn't exist log error and exit without throwi...
authorTony Mack <tmack@cs.princeton.edu>
Mon, 8 Jan 2007 16:34:12 +0000 (16:34 +0000)
committerTony Mack <tmack@cs.princeton.edu>
Mon, 8 Jan 2007 16:34:12 +0000 (16:34 +0000)
PLC/Methods/BootNotifyOwners.py
PLC/Persons.py

index 7de5a1a..418905d 100644 (file)
@@ -29,8 +29,8 @@ class BootNotifyOwners(Method):
     def call(self, auth, message_id, include_pis, include_techs, include_support):
         messages = Messages(self.api, [message_id], enabled = True)
         if not messages:
-            # raise PLCInvalidArgument, "No such message template"
-            return 1
+            print >> log, "No such message template"
+           return 1
         message = messages[0]
        
         if not self.api.config.PLC_MAIL_ENABLED:
index 54e6a86..4261bfc 100644 (file)
@@ -4,7 +4,7 @@
 # Mark Huang <mlhuang@cs.princeton.edu>
 # Copyright (C) 2006 The Trustees of Princeton University
 #
-# $Id: Persons.py,v 1.26 2007/01/05 15:56:16 tmack Exp $
+# $Id: Persons.py,v 1.28 2007/01/05 19:50:20 tmack Exp $
 #
 
 from types import StringTypes
@@ -16,6 +16,7 @@ import re
 import crypt
 
 from PLC.Faults import *
+from PLC.Debug import log
 from PLC.Parameter import Parameter
 from PLC.Filter import Filter
 from PLC.Table import Row, Table
@@ -300,9 +301,10 @@ class Person(Row):
         "%s %s" % ('Planetlab', 'Support')
 
        # fill in template
-        messages = Messages(self.api, ['PASSWORD_RESET_INITIATE'])
+        messages = Messages(self.api, ['ASSWORD_RESET_INITIATE'])
         if not messages:
-            raise PLCAPIError, "Email template not found"
+            print >> log, "No such message template"
+           return 1
 
         message = messages[0]
         subject = message['subject']
@@ -341,7 +343,8 @@ class Person(Row):
        # fill in template
        messages = Messages(self.api, ['ACCOUNT_REGISTERED'])
         if not messages:
-            raise PLCAPIError, "Email template not found"
+           print >> log, "No such message template"
+            return 1
 
         message = messages[0]
         subject = message['subject'] % (user_full_name, site['name'])