From cd69da73218fbcf0911c2677715aae9dae1f6676 Mon Sep 17 00:00:00 2001 From: usmannasir Date: Thu, 10 Oct 2024 10:27:12 +0500 Subject: [PATCH] bug fix: if scp fail download via sftp --- plogical/applicationInstaller.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/plogical/applicationInstaller.py b/plogical/applicationInstaller.py index 48bf2e721..ae24a4874 100755 --- a/plogical/applicationInstaller.py +++ b/plogical/applicationInstaller.py @@ -6647,12 +6647,10 @@ class ApplicationInstaller(multi.Thread): if errorRet: logging.writeToFile(f"Error in scp command to retrieve backup {errorRet}") statusFile = open(tempStatusPath, 'w') - statusFile.writelines(f"Error in scp command to retrieve backup {errorRet} [404]") + statusFile.writelines(f"Error in scp command to retrieve backup {errorRet}.") statusFile.close() - return 0 - else: + try: - logging.writeToFile(f"Success in scp command to retrieve backup {successRet}") sftp.get(f'cpbackups/{folder}/{backupfile}', f'/home/cyberpanel/{backupfile}', callback=self.UpdateDownloadStatus) except BaseException as msg: @@ -6662,6 +6660,9 @@ class ApplicationInstaller(multi.Thread): statusFile.close() return 0 + else: + logging.writeToFile(f"Success in scp command to retrieve backup {successRet}") + if sftp: