bug fix: createLocalBackup function

This commit is contained in:
Usman Nasir
2020-06-21 21:39:01 +05:00
parent 18958b77ce
commit bfef244f21
2 changed files with 67 additions and 63 deletions

View File

@@ -1266,7 +1266,7 @@ def submitBackupCreation(tempStoragePath, backupName, backupPath, backupDomain):
ProcessUtilities.executioner(command)
else:
writeToFile = open(schedulerPath, 'w')
writeToFile.writelines('error')
writeToFile.writelines('1269')
writeToFile.close()
return 0
@@ -1275,7 +1275,7 @@ def submitBackupCreation(tempStoragePath, backupName, backupPath, backupDomain):
ProcessUtilities.executioner(command)
else:
writeToFile = open(schedulerPath, 'w')
writeToFile.writelines('error')
writeToFile.writelines('1278')
writeToFile.close()
return 0
@@ -1286,7 +1286,7 @@ def submitBackupCreation(tempStoragePath, backupName, backupPath, backupDomain):
ProcessUtilities.executioner(command)
else:
writeToFile = open(schedulerPath, 'w')
writeToFile.writelines('error')
writeToFile.writelines('1289')
writeToFile.close()
return 0
@@ -1295,7 +1295,7 @@ def submitBackupCreation(tempStoragePath, backupName, backupPath, backupDomain):
ProcessUtilities.executioner(command)
else:
writeToFile = open(schedulerPath, 'w')
writeToFile.writelines('error')
writeToFile.writelines('1298')
writeToFile.close()
return 0
@@ -1305,7 +1305,7 @@ def submitBackupCreation(tempStoragePath, backupName, backupPath, backupDomain):
ProcessUtilities.executioner(command)
else:
writeToFile = open(schedulerPath, 'w')
writeToFile.writelines('error')
writeToFile.writelines('1308')
writeToFile.close()
return 0
@@ -1314,7 +1314,7 @@ def submitBackupCreation(tempStoragePath, backupName, backupPath, backupDomain):
ProcessUtilities.executioner(command)
else:
writeToFile = open(schedulerPath, 'w')
writeToFile.writelines('error')
writeToFile.writelines('1317')
writeToFile.close()
return 0
@@ -1322,7 +1322,7 @@ def submitBackupCreation(tempStoragePath, backupName, backupPath, backupDomain):
if result[0] == 0:
writeToFile = open(schedulerPath, 'w')
writeToFile.writelines('error')
writeToFile.writelines('1325')
writeToFile.close()
logging.CyberCPLogFileWriter.statusWriter(status, str(result[1]) + ' [1084][5009]')
return 0
@@ -1339,7 +1339,7 @@ def submitBackupCreation(tempStoragePath, backupName, backupPath, backupDomain):
if output.find('[5009') > -1:
logging.CyberCPLogFileWriter.writeToFile(output)
writeToFile = open(schedulerPath, 'w')
writeToFile.writelines('error')
writeToFile.writelines(output)
writeToFile.close()
return 0
@@ -1355,7 +1355,7 @@ def submitBackupCreation(tempStoragePath, backupName, backupPath, backupDomain):
if mysqlUtilities.mysqlUtilities.createDatabaseBackup(dbName, '/home/cyberpanel') == 0:
writeToFile = open(schedulerPath, 'w')
writeToFile.writelines('error')
writeToFile.writelines('1358')
writeToFile.close()
return 0