From a5517b27bbb93dba55e272681671f002ba680878 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Tue, 4 Feb 2020 10:37:14 +0500 Subject: [PATCH] dataloss check update --- plogical/applicationInstaller.py | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/plogical/applicationInstaller.py b/plogical/applicationInstaller.py index 7e9d510ea..c158e8379 100755 --- a/plogical/applicationInstaller.py +++ b/plogical/applicationInstaller.py @@ -151,31 +151,9 @@ class ApplicationInstaller(multi.Thread): dirFiles = os.listdir(finalPath) - if len(dirFiles) == 1: - if dirFiles[0] == ".well-known" or dirFiles[0] == 'index.html': - return 1 - else: - statusFile = open(tempStatusPath, 'w') - statusFile.writelines( - "Target directory should be empty before installation, otherwise data loss could occur." + " [404]") - statusFile.close() - return 0 - elif len(dirFiles) == 2: - if ".well-known" in dirFiles and "index.html" in dirFiles: - return 1 - else: - statusFile = open(tempStatusPath, 'w') - statusFile.writelines( - "Target directory should be empty before installation, otherwise data loss could occur." + " [404]") - statusFile.close() - return 0 - elif len(dirFiles) == 0: + if len(dirFiles) <= 3: return 1 else: - statusFile = open(tempStatusPath, 'w') - statusFile.writelines( - "Target directory should be empty before installation, otherwise data loss could occur." + " [404]") - statusFile.close() return 0 def installGit(self):