Index: shared/scripts/configuration/utility.py =================================================================== diff -u -r8ad5f306455a57670d4ab09c409c3d2941194e46 -r8a47faf40db724c9f1360b5e5579530410ee86ca --- shared/scripts/configuration/utility.py (.../utility.py) (revision 8ad5f306455a57670d4ab09c409c3d2941194e46) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision 8a47faf40db724c9f1360b5e5579530410ee86ca) @@ -8,18 +8,45 @@ # @file utils.py # # @author (last) LTTS -# @date (last) 15-Jan-2022 +# @date (last) 08-July-2022 # ############################################################################ - +import os import names import test import object import squish +import glob from configuration import config from builtins import int as pyInt + +CLOUD_CREDENTIALS_LOCATION = '/home/denali/Desktop/cloudsync/credentials' +CLOUD_SYNC_LOG_LOCATION = '/home/denali/Desktop/sd-card/cloudsync' + +PEM_FILES = ['1.pem', '2.pem', '3.pem' ] + + +def get_current_date_and_time(date_format='%Y/%b/%d - %H:%M:%S'): + + date = datetime.now() + return str(date.strftime(date_format)) + + +def append_cloudsync_credentials_file(): + + try: + os.makedirs(CLOUD_CREDENTIALS_LOCATION, exist_ok = True) + test.log("Directory created successfully") + for file_handler in range(len(PEM_FILES)): + path = os.path.join(CLOUD_CREDENTIALS_LOCATION, PEM_FILES[file_handler]) + with open(path, 'w') as file_reader: + pass + + except OSError as error: + test.log("Directory can not be created") + def get_extracted_file_inp_buf(): """ This function is the handler for getting file from cloudsync folder. @@ -37,3 +64,4 @@ except: test.fail("input buf file is not created during application interaction") return False + \ No newline at end of file