Changeset 871 for trunk/Monitoring/Watch/watch
- Timestamp:
- 06/11/13 09:33:58 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Monitoring/Watch/watch
r866 r871 29 29 import smon.types 30 30 31 """32 Code list reminder33 34 0000 (la simulation démarre)35 1000 (le job d'une simulation démarre)36 2000 (PushStack)37 3000 (PopStack OK)38 9000 (PopStack NOK)39 9999 (FATAL)40 """41 42 31 class Mail(): 43 32 … … 129 118 @classmethod 130 119 def start(cls): 131 pass120 repo_io.init() # open DB connection 132 121 133 122 @classmethod 134 123 def stop(cls): 135 pass124 repo_io.free() # close DB connection 136 125 137 126 @classmethod … … 174 163 175 164 # debug 176 print " [x] Received %s" % field165 #print " [x] Received %s" % field 177 166 178 167 splitted_field=field.split(":") … … 185 174 186 175 # debug 187 print " [x] Received %s (encoded)" % l__tmp_dic["body"]176 #print " [x] Received %s (encoded)" % l__tmp_dic["body"] 188 177 189 178 … … 194 183 # debug 195 184 #print " [x] Received %s" % raw_msg 196 print " [x] Received %s (uudecoded)" % base64_decoded_msg197 185 #print " [x] Received %s (uudecoded)" % base64_decoded_msg 198 199 186 #print " [x] Received %s (uudecoded)" % base64_decoded_msg 187 188 189 # message deserialization 200 190 message=None 201 191 try: 202 # body deserialization203 192 JSON_msg=json.loads(base64_decoded_msg) 204 193 message=smon.types.Message(JSON_msg) # all JSON object members will be available in smon.types.Message object 205 194 206 if "file" in l__tmp_dic: 207 208 # base64 decode file 209 base64_decoded_file=base64.b64decode(l__tmp_dic["file"]) 210 211 # add into msg 212 message.file=base64_decoded_file 213 195 196 197 except Exception,e: 198 print "ERR009 - exception occurs (exception=%s,msg=%s)"%(str(e),base64_decoded_msg) 199 200 #traceback.print_exc() 201 #raise 202 203 204 205 # manage config-card file which is attached to the "0000" type message (this file is base64 encoded and need to be unencoded) 206 # 207 if "file" in l__tmp_dic: 208 209 # base64 decode file 210 base64_decoded_file=base64.b64decode(l__tmp_dic["file"]) 211 212 # add as msg attribute 213 message.file=base64_decoded_file 214 215 216 217 # execute actions 218 try: 214 219 # message code based action 215 Actions.execActions(message)216 220 #Actions.execActions(message) 221 pass 217 222 except Exception,e: 218 print "E xception occurs (exception=%s,msg=%s)"%(str(e),base64_decoded_msg)219 220 #traceback.print_exc()223 print "ERR019 - exception occurs (exception=%s,msg=%s)"%(str(e),base64_decoded_msg) 224 225 traceback.print_exc() 221 226 222 227 raise 228 229 223 230 224 231 self.channel.basic_consume(callback, queue='myqueue', no_ack=True)
Note: See TracChangeset
for help on using the changeset viewer.