add additional logging

This commit is contained in:
Usman Nasir
2021-04-13 01:03:40 +05:00
parent 37e79c60cf
commit c68b08d44a

View File

@@ -576,6 +576,9 @@ $parameters = array(
result = ProcessUtilities.outputExecutioner(command, externalApp) result = ProcessUtilities.outputExecutioner(command, externalApp)
if os.path.exists(ProcessUtilities.debugPath):
logging.writeToFile(str(result))
if result.find('Success:') == -1: if result.find('Success:') == -1:
raise BaseException(result) raise BaseException(result)
@@ -588,6 +591,9 @@ $parameters = array(
command = "wp core config --dbname=" + dbName + " --dbuser=" + dbUser + " --dbpass=" + dbPassword + " --dbhost=%s:%s --dbprefix=wp_ --allow-root --path=" % (ApplicationInstaller.LOCALHOST, ApplicationInstaller.PORT) + finalPath command = "wp core config --dbname=" + dbName + " --dbuser=" + dbUser + " --dbpass=" + dbPassword + " --dbhost=%s:%s --dbprefix=wp_ --allow-root --path=" % (ApplicationInstaller.LOCALHOST, ApplicationInstaller.PORT) + finalPath
result = ProcessUtilities.outputExecutioner(command, externalApp) result = ProcessUtilities.outputExecutioner(command, externalApp)
if os.path.exists(ProcessUtilities.debugPath):
logging.writeToFile(str(result))
if result.find('Success:') == -1: if result.find('Success:') == -1:
raise BaseException(result) raise BaseException(result)
@@ -600,6 +606,9 @@ $parameters = array(
command = 'wp core install --url="http://' + finalURL + '" --title="' + blogTitle + '" --admin_user="' + adminUser + '" --admin_password="' + adminPassword + '" --admin_email="' + adminEmail + '" --allow-root --path=' + finalPath command = 'wp core install --url="http://' + finalURL + '" --title="' + blogTitle + '" --admin_user="' + adminUser + '" --admin_password="' + adminPassword + '" --admin_email="' + adminEmail + '" --allow-root --path=' + finalPath
result = ProcessUtilities.outputExecutioner(command, externalApp) result = ProcessUtilities.outputExecutioner(command, externalApp)
if os.path.exists(ProcessUtilities.debugPath):
logging.writeToFile(str(result))
if result.find('Success:') == -1: if result.find('Success:') == -1:
raise BaseException(result) raise BaseException(result)
@@ -612,6 +621,9 @@ $parameters = array(
command = "wp plugin install litespeed-cache --allow-root --path=" + finalPath command = "wp plugin install litespeed-cache --allow-root --path=" + finalPath
result = ProcessUtilities.outputExecutioner(command, externalApp) result = ProcessUtilities.outputExecutioner(command, externalApp)
if os.path.exists(ProcessUtilities.debugPath):
logging.writeToFile(str(result))
if result.find('Success:') == -1: if result.find('Success:') == -1:
raise BaseException(result) raise BaseException(result)
@@ -622,6 +634,9 @@ $parameters = array(
command = "wp plugin activate litespeed-cache --allow-root --path=" + finalPath command = "wp plugin activate litespeed-cache --allow-root --path=" + finalPath
result = ProcessUtilities.outputExecutioner(command, externalApp) result = ProcessUtilities.outputExecutioner(command, externalApp)
if os.path.exists(ProcessUtilities.debugPath):
logging.writeToFile(str(result))
if result.find('Success:') == -1: if result.find('Success:') == -1:
raise BaseException(result) raise BaseException(result)
@@ -705,16 +720,17 @@ $parameters = array(
except BaseException as msg: except BaseException as msg:
# remove the downloaded files # remove the downloaded files
from filemanager.filemanager import FileManager if not os.path.exists(ProcessUtilities.debugPath):
fm = FileManager(None, None) from filemanager.filemanager import FileManager
fm.fixPermissions(self.masterDomain) fm = FileManager(None, None)
fm.fixPermissions(self.masterDomain)
try: try:
mysqlUtilities.deleteDatabase(dbName, dbUser) mysqlUtilities.deleteDatabase(dbName, dbUser)
db = Databases.objects.get(dbName=dbName) db = Databases.objects.get(dbName=dbName)
db.delete() db.delete()
except: except:
pass pass
statusFile = open(self.tempStatusPath, 'w') statusFile = open(self.tempStatusPath, 'w')
statusFile.writelines(str(msg) + " [404]") statusFile.writelines(str(msg) + " [404]")