diff --git a/plogical/applicationInstaller.py b/plogical/applicationInstaller.py index 1d5c3a695..01dca6bdc 100755 --- a/plogical/applicationInstaller.py +++ b/plogical/applicationInstaller.py @@ -2960,6 +2960,7 @@ def RestoreWPbackupNow(self): import pysftp import pysftp as sftp import boto3 + if os.path.exists(ProcessUtilities.debugPath): logging.writeToFile("Restore WP backup Now ....... start:%s" % self.extraArgs['Domain']) @@ -2979,7 +2980,11 @@ def RestoreWPbackupNow(self): DatabaseNameold = config['DatabaseName'] DumpFileName = DatabaseNameold + ".sql" oldurl = config['WPFinalURL'] - packgobj = Package.objects.get(pk=config['Webpackage_id']) + try: + packgobj = Package.objects.get(pk=config['Webpackage_id']) + except: + packgobj = Package.objects.get(packageName='Default') + packegs = packgobj.packageName WebOwnerobj = Administrator.objects.get(pk=config['Webadmin_id']) WebOwner = WebOwnerobj.userName @@ -6184,8 +6189,6 @@ def RestoreWPbackupNow(self): time.sleep(2) - - logging.statusWriter(self.tempStatusPath, 'Restoring site ....,30') NewWPsite = WPSites.objects.get(FinalURL=newurl) VHuser = NewWPsite.owner.externalApp diff --git a/plogical/phpUtilities.py b/plogical/phpUtilities.py index d4a9cba6b..3fe78a571 100755 --- a/plogical/phpUtilities.py +++ b/plogical/phpUtilities.py @@ -236,10 +236,10 @@ def GetPHPVersionFromFile(vhFile, domainName=None): finalConfPath = ApacheVhost.configBasePath + domainName + '.conf' if os.path.exists(finalConfPath): command = f'grep -Eo -m 1 "php[0-9]+" {finalConfPath} | sed -n "1p"' - result = ProcessUtilities.outputExecutioner(command, None, True).rstrip('\n') + php_version = ProcessUtilities.outputExecutioner(command, None, True).rstrip('\n') # Input string - php_version = "php73" + #php_version = "php73" # Insert a period between '7' and '3' to convert it to 'php7.3' converted_version = php_version[:4] + '.' + php_version[4:] @@ -277,7 +277,8 @@ def WrapGetPHPVersionFromFileToGetVersionWithPHP(vhFile): logging.CyberCPLogFileWriter.writeToFile(result) command = result + " -v 2>/dev/null | awk '/^PHP/ {print $2}'" - php_version = ProcessUtilities.outputExecutioner(command, None, True).rstrip('\n') + php_version = ProcessUtilities.outputExecutioner(command, None, True).rstrip('\n')[:3] + return f"PHP {php_version}" @staticmethod diff --git a/plogical/sslUtilities.py b/plogical/sslUtilities.py index 665d55ff5..6c8b67095 100755 --- a/plogical/sslUtilities.py +++ b/plogical/sslUtilities.py @@ -165,6 +165,7 @@ def getDNSRecords(virtualHostName): except BaseException as msg: return [0, "347 " + str(msg) + " [issueSSLForDomain]"] + @staticmethod def PatchVhostConf(virtualHostName): try: diff --git a/plogical/test.py b/plogical/test.py index e69de29bb..d88b0177f 100644 --- a/plogical/test.py +++ b/plogical/test.py @@ -0,0 +1,3 @@ +strr='8.0.30' + +print(strr[:3]) \ No newline at end of file