From eae48c98e60b918c0e89628a0c847a40fec2aeee Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Thu, 4 Jun 2020 00:17:29 +0500 Subject: [PATCH] bug fix: remove not needed php on cent8 and ub20 --- managePHP/phpManager.py | 6 ++++-- plogical/backupSchedule.py | 5 ++++- plogical/backupScheduleLocal.py | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/managePHP/phpManager.py b/managePHP/phpManager.py index b818850c8..8d360226a 100755 --- a/managePHP/phpManager.py +++ b/managePHP/phpManager.py @@ -13,9 +13,11 @@ class PHPManager: def findPHPVersions(): distro = ProcessUtilities.decideDistro() if distro == ProcessUtilities.centos: - if distro == ProcessUtilities.cent8: - return ['PHP 7.2', 'PHP 7.3', 'PHP 7.4'] return ['PHP 5.3', 'PHP 5.4', 'PHP 5.5', 'PHP 5.6', 'PHP 7.0', 'PHP 7.1', 'PHP 7.2', 'PHP 7.3', 'PHP 7.4'] + elif distro == ProcessUtilities.cent8: + return ['PHP 7.2', 'PHP 7.3', 'PHP 7.4'] + elif distro == ProcessUtilities.ubuntu20: + return ['PHP 7.2', 'PHP 7.3', 'PHP 7.4'] else: return ['PHP 7.0', 'PHP 7.1', 'PHP 7.2', 'PHP 7.3', 'PHP 7.4'] diff --git a/plogical/backupSchedule.py b/plogical/backupSchedule.py index d9d800b8e..12e0eed2a 100755 --- a/plogical/backupSchedule.py +++ b/plogical/backupSchedule.py @@ -37,7 +37,10 @@ class backupSchedule: print(("[" + time.strftime("%m.%d.%Y_%H-%M-%S") + "] "+ message + "\n")) file.close() - BackupJobLogs(owner=backupSchedule.backupLog, status=status, message="[" + time.strftime("%m.%d.%Y_%H-%M-%S") + "] "+ message).save() + if backupSchedule.backupLog == '': + pass + else: + BackupJobLogs(owner=backupSchedule.backupLog, status=status, message="[" + time.strftime("%m.%d.%Y_%H-%M-%S") + "] "+ message).save() except IOError as msg: return "Can not write to error file." diff --git a/plogical/backupScheduleLocal.py b/plogical/backupScheduleLocal.py index 345d7b610..6c0bc31fc 100755 --- a/plogical/backupScheduleLocal.py +++ b/plogical/backupScheduleLocal.py @@ -17,7 +17,7 @@ from plogical.processUtilities import ProcessUtilities from re import match,I,M import signal from datetime import datetime -from websiteFunctions.models import BackupJob, BackupJobLogs +from websiteFunctions.models import BackupJob class backupScheduleLocal: localBackupPath = '/home/cyberpanel/localBackupPath'