def do_save_raw_crash(boto_connection, raw_crash, dumps, crash_id): if dumps is None: dumps = MemoryDumpsMapping() raw_crash_as_string = boto_connection._convert_mapping_to_string( raw_crash ) boto_connection.submit( crash_id, "raw_crash", raw_crash_as_string ) dump_names_as_string = boto_connection._convert_list_to_string( dumps.keys() ) boto_connection.submit( crash_id, "dump_names", dump_names_as_string ) # we don't know what type of dumps mapping we have. We do know, # however, that by calling the memory_dump_mapping method, we will # get a MemoryDumpMapping which is exactly what we need. dumps = dumps.as_memory_dumps_mapping() for dump_name, dump in dumps.iteritems(): if dump_name in (None, '', 'upload_file_minidump'): dump_name = 'dump' boto_connection.submit(crash_id, dump_name, dump)
def save_raw_crash(self, raw_crash, dumps, crash_id): """Save raw crash data to S3 bucket. A raw crash consists of the raw crash annotations and all the dumps that came in the crash report. We need to save the raw crash file, a dump names file listing the dumps that came in the crash report, and then each of the dumps. """ if dumps is None: dumps = MemoryDumpsMapping() path = build_keys("raw_crash", crash_id)[0] raw_crash_data = dict_to_str(raw_crash).encode("utf-8") self.conn.save_file(path, raw_crash_data) path = build_keys("dump_names", crash_id)[0] dump_names_data = list_to_str(dumps.keys()).encode("utf-8") self.conn.save_file(path, dump_names_data) # We don't know what type of dumps mapping we have. We do know, # however, that by calling the memory_dump_mapping method, we will get # a MemoryDumpMapping which is exactly what we need. dumps = dumps.as_memory_dumps_mapping() for dump_name, dump in dumps.items(): if dump_name in (None, "", "upload_file_minidump"): dump_name = "dump" path = build_keys(dump_name, crash_id)[0] self.conn.save_file(path, dump)
def do_save_raw_crash(boto_connection, raw_crash, dumps, crash_id): if dumps is None: dumps = MemoryDumpsMapping() raw_crash_data = boto_connection._convert_mapping_to_string(raw_crash).encode('utf-8') boto_connection.submit(crash_id, 'raw_crash', raw_crash_data) dump_names_data = boto_connection._convert_list_to_string(dumps.keys()).encode('utf-8') boto_connection.submit(crash_id, 'dump_names', dump_names_data) # We don't know what type of dumps mapping we have. We do know, # however, that by calling the memory_dump_mapping method, we will get # a MemoryDumpMapping which is exactly what we need. dumps = dumps.as_memory_dumps_mapping() for dump_name, dump in iteritems(dumps): if dump_name in (None, '', 'upload_file_minidump'): dump_name = 'dump' boto_connection.submit(crash_id, dump_name, dump)
def do_save_raw_crash(conn, raw_crash, dumps, crash_id): if dumps is None: dumps = MemoryDumpsMapping() raw_crash_data = conn._convert_mapping_to_string(raw_crash).encode( "utf-8") conn.submit(crash_id, "raw_crash", raw_crash_data) dump_names_data = conn._convert_list_to_string( dumps.keys()).encode("utf-8") conn.submit(crash_id, "dump_names", dump_names_data) # We don't know what type of dumps mapping we have. We do know, # however, that by calling the memory_dump_mapping method, we will get # a MemoryDumpMapping which is exactly what we need. dumps = dumps.as_memory_dumps_mapping() for dump_name, dump in iteritems(dumps): if dump_name in (None, "", "upload_file_minidump"): dump_name = "dump" conn.submit(crash_id, dump_name, dump)
def do_save_raw_crash(boto_connection, raw_crash, dumps, crash_id): if dumps is None: dumps = MemoryDumpsMapping() raw_crash_data = boto_connection._convert_mapping_to_string( raw_crash).encode('utf-8') boto_connection.submit(crash_id, 'raw_crash', raw_crash_data) dump_names_data = boto_connection._convert_list_to_string( dumps.keys()).encode('utf-8') boto_connection.submit(crash_id, 'dump_names', dump_names_data) # We don't know what type of dumps mapping we have. We do know, # however, that by calling the memory_dump_mapping method, we will get # a MemoryDumpMapping which is exactly what we need. dumps = dumps.as_memory_dumps_mapping() for dump_name, dump in iteritems(dumps): if dump_name in (None, '', 'upload_file_minidump'): dump_name = 'dump' boto_connection.submit(crash_id, dump_name, dump)