Index: shared/scripts/configuration/utility.py =================================================================== diff -u -reb60fc7fabd81e5d61e9526dea36ceeecd29f1ea -r9d149eb43cc0dc58b5b3d52f64ccc6180abb7161 --- shared/scripts/configuration/utility.py (.../utility.py) (revision eb60fc7fabd81e5d61e9526dea36ceeecd29f1ea) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision 9d149eb43cc0dc58b5b3d52f64ccc6180abb7161) @@ -15,11 +15,27 @@ import csv import test import squish +import os +import glob from dialin.ui.hd_simulator import HDSimulator from builtins import int as pyInt from builtins import format from datetime import datetime +from datetime import date +from apt_pkg import config +from configuration import config +import builtins +import names +import os +import glob +import object +import test +import time +import squish +from configuration import config +from builtins import int as pyInt + hd_simulator = HDSimulator() LOG_LOCATION = "/home/denali/Desktop/sd-card/log/*.log" @@ -105,7 +121,7 @@ return False -def get_message_from_log(file_name, message_text): +def get_message_from_log(file_name, epoch, ZERO, registration_request, THREE, VERSION_SERIAL, SW_VERSION): """ This method intended to extract the message from application log. @@ -233,12 +249,13 @@ try: list_of_files = glob.glob(config.CLOUD_SYNC_INP__BUF_LOCATION) latest_file = max(list_of_files, key=os.path.getctime) - return latest_file + test.log(str(latest_file)) + return str(latest_file) except: test.fail("input buf file is not created during application interaction") return False -def get_current_log_details_from_inp_buf(epoch, ZERO, registration_request, THREE, HD_VERSION_SERIAL, DG_VERSION_SERIAL = None, SW_VERSION): +def get_current_log_details_from_inp_buf(epoch, ZERO, registration_request, THREE, HD_VERSION_SERIAL, DG_VERSION_SERIAL, SW_VERSION): """ This function is capable to perform data analysis from application log folder. @@ -251,15 +268,17 @@ """ content_record = [] file_name = get_extracted_file_inp_buf() - if HD_VERSION_SERIAL= None: - message = get_message_from_log(file_name, message_text) + if DG_VERSION_SERIAL == None: + message = get_message_from_log(file_name, epoch, ZERO, registration_request, THREE, HD_VERSION_SERIAL, SW_VERSION) content_record.append(message) - if message_ack != False: - ack_req_status, ack_req_value, message_id = get_ack_request_details(file_name, message_text) - ack_bak_value = ack_req_value.replace(":-", ":") # getting negative requested ack from positive requested ack - content_record.append(ack_req_status) - content_record.append(message_id.lower()) - if message_ack != False and ack_bak_value != None: - ack_bak_status = get_bak_request_details(file_name, ack_bak_value) - content_record.append(ack_bak_status) + if HD_VERSION_SERIAL == None: + message = get_message_from_log(file_name, epoch, ZERO, registration_request, THREE, DG_VERSION_SERIAL, SW_VERSION) + content_record.append(message) +# ack_req_status, ack_req_value, message_id = get_ack_request_details(file_name, message_text) +# ack_bak_value = ack_req_value.replace(":-", ":") # getting negative requested ack from positive requested ack +# content_record.append(ack_req_status) +# content_record.append(message_id.lower()) +# if message_ack != False and ack_bak_value != None: +# ack_bak_status = get_bak_request_details(file_name, ack_bak_value) +# content_record.append(ack_bak_status) return content_record