Index: shared/scripts/configuration/utility.py =================================================================== diff -u -r3498a1f45b1c0dafe4f39e79abbed3e7cd3e1d17 -rad950ca0826e092b2c28c87e8a2f42d9f0718edd --- shared/scripts/configuration/utility.py (.../utility.py) (revision 3498a1f45b1c0dafe4f39e79abbed3e7cd3e1d17) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision ad950ca0826e092b2c28c87e8a2f42d9f0718edd) @@ -12,6 +12,8 @@ # ############################################################################ + + import builtins import csv import names @@ -23,6 +25,7 @@ import squish import time import test + from builtins import format from builtins import int as pyInt from builtins import str as pyStr @@ -35,6 +38,7 @@ from datetime import timezone from datetime import datetime + CLOUD_CREDENTIALS_LOCATION = '/home/denali/Desktop/cloudsync/credentials' CLOUD_SYNC_LOG_LOCATION = '/home/denali/Desktop/sd-card/cloudsync/' LOG_LOCATION = "/home/denali/Desktop/sd-card/log/*.log" @@ -988,13 +992,13 @@ return names.o_recirculate_rejection_msg -def get_current_date_and_time(date_format='%Y/%m/%d - %H:%M:%S'): +def get_current_date_and_time_in_utc(date_format='%Y/%m/%d - %H:%M:%S'): """ Method to get current date and time. @input date_format (str) - format of date to be retrieved. @return (str) - date in specified format. """ - date = datetime.now() + date = datetime.now(timezone.utc) return str(date.strftime(date_format)) @@ -1022,7 +1026,7 @@ @return latest_file - (string) returns latest input log file path from sd-data """ try: - current_date = get_current_date_and_time(date_format = "%Y_%m_%d") + current_date = get_current_date_and_time_in_utc(date_format = "%Y_%m_%d") latest_file = CLOUD_SYNC_LOG_LOCATION+current_date+'_inp.buf' return latest_file except: @@ -1041,9 +1045,8 @@ return latest_file except: return False - - -def retrive_log_data(readline_count = 1): + +def retrive_log_data(readline_count): """ This function is the handler for getting file from log folder. Application log data is automatically appended on '/home/denali/Desktop/sd-card/cloudsync/ {current_date}_out.log' @@ -1116,7 +1119,7 @@ test.fail("application log data is corrupted") except: test.fail("Log file is not created or log file is not created based on standard log naming format.") - + def get_epoch_value_consistancy(current_epoch_value, expected_epoch_value): """ This function is verify consistancy of epoch value.