Changeset 3381
- Timestamp:
- 08/15/13 10:56:56 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
monitoring/plugins/mpi/generic_tla_monitoring.py
r3316 r3381 50 50 special_plugin_file_name = kwargs['special_plugin_file_name'] # X- 51 51 52 timestamp = datetime.datetime.today().isoformat() 52 timestamp = datetime.datetime.today().isoformat() 53 valid = False 53 54 54 55 try : 55 special_validator(data,56 descriptive_string,57 kwargs)56 valid = special_validator(data, 57 descriptive_string, 58 kwargs) 58 59 except : 59 traceback_string 60 traceback_string = traceback.format_exc() 60 61 #pdb.set_trace() 61 62 62 err_log_file_path = os.path.normpath("/tmp/" + special_plugin_file_name + "_err_ well-formedness_check__" + descriptive_string.replace('/' , '%2F') + "__" + timestamp + ".log")63 err_log_file_path = os.path.normpath("/tmp/" + special_plugin_file_name + "_err_generic_validator__" + descriptive_string.replace('/' , '%2F') + "__" + timestamp + ".log") 63 64 64 65 with open(name = err_log_file_path, 65 66 mode = "wt") as debugging_output_file : 66 67 debugging_output_file.write(traceback_string) 67 68 return False 69 else : 70 return True 68 sys.exit(999) # X- exit with some special error status 69 70 return valid 71 71 72 72 … … 94 94 special_validator) 95 95 96 return (wellformedness)96 return wellformedness 97 97 98 98 … … 110 110 special_validator) 111 111 112 return (wellformedness)112 return wellformedness 113 113 114 114 … … 120 120 descriptive_string, 121 121 kwargs) : 122 122 123 try : 123 124 data_tree_root_element = xml.etree.ElementTree.XML(text = data) … … 125 126 if data_tree_root_element.tag == kwargs['valid_root_element_tag'] : 126 127 return True 127 128 return False128 else : 129 return False 129 130 except : 130 131 return False … … 134 135 kwargs, 135 136 special_validator) 136 return (wellformedness)137 return wellformedness 137 138 138 139 … … 234 235 else : 235 236 try : 236 response 237 238 data 237 response = conn.getresponse() 238 239 data = response.read() 239 240 240 241 conn.close() … … 255 256 # HTTP status codes 200 and 302 256 257 # X- Resolve redirect in case of HTTP status == 302 257 well_formed = validator(data= data,258 well_formed = validator(data = data, 258 259 descriptive_string = UP_URL, 259 260 **validator_arguments) # ['validator_arguments'])
Note: See TracChangeset
for help on using the changeset viewer.