Index: shared/scripts/configuration/utility.py =================================================================== diff -u -r7d62115ed0ebabcf0ce0c1cd398e8b3873e0b469 -r710c198d30c8c4479ba1006f637441dce1f9a46f --- shared/scripts/configuration/utility.py (.../utility.py) (revision 7d62115ed0ebabcf0ce0c1cd398e8b3873e0b469) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision 710c198d30c8c4479ba1006f637441dce1f9a46f) @@ -15,6 +15,8 @@ import csv import test import os +import shutil +from dialin.ui import utils from configuration import config from datetime import timezone from datetime import datetime @@ -308,4 +310,39 @@ ack_bak_status = get_bak_request_details(file_name, ack_bak_value) content_record.append(ack_bak_status) return content_record + + +def rename_file(path,filename): + """ + This method Rename the original folder name to dummy name. + """ + folder_path = os.listdir(path) + for files in folder_path: + if files == filename+"_1": + if os.path.exists(path+filename+"_1"): + shutil.rmtree(path+filename+"_1") + test.log(str(filename+" name changed to "+files)) + if files == filename: + if os.path.exists(path+filename): + utils.waitForGUI(1) + os.rename(path+filename,path+filename+"_1") + test.log(str(files+" name changed to "+filename+"_1")) + +def rename_old_name(path,filename): + """ + This method Rename the dummy name to original folder name . + """ + folder_path = os.listdir(path) + for files in folder_path: + if files == filename: + if os.path.exists(path+filename): + shutil.rmtree(path+filename) + test.log(str(files+"_1 name changed to "+filename)) + utils.waitForGUI(5) + if files != filename: + if (files == filename+"_1"): + os.rename(path+files,path+filename) + test.log(str(files+" name changed to "+filename)) + + \ No newline at end of file