From ace5cb255d89ebd85e2270b4efa28d9752d866b4 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Fri, 30 Apr 2021 23:41:05 +0500 Subject: [PATCH] bug fix: remove skip-name-resolve --- plogical/mysqlUtilities.py | 3 +-- websiteFunctions/StagingSetup.py | 23 +++++++++++++++++++---- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/plogical/mysqlUtilities.py b/plogical/mysqlUtilities.py index 0310ff4ae..f03a2ddb3 100755 --- a/plogical/mysqlUtilities.py +++ b/plogical/mysqlUtilities.py @@ -931,7 +931,7 @@ password=%s data = open(cnfPath, 'r').read() - if data.find('bind-address') > -1 and data.find('skip-name-resolve') > -1: + if data.find('bind-address'): print('1,None') return 1 else: @@ -943,7 +943,6 @@ password=%s mysqldContent = ''' [mysqld] bind-address=%s -skip-name-resolve ''' % (ipAddressLocal) writeToFile = open(cnfPath, 'a') diff --git a/websiteFunctions/StagingSetup.py b/websiteFunctions/StagingSetup.py index 449b92be8..ab18d7f08 100644 --- a/websiteFunctions/StagingSetup.py +++ b/websiteFunctions/StagingSetup.py @@ -191,12 +191,18 @@ class StagingSetup(multi.Thread): logging.statusWriter(tempStatusPath, 'Syncing databases..,10') command = 'wp --allow-root --skip-plugins --skip-themes --path=%s db export %s/dbexport-stage.sql' % (child.path, masterPath) - ProcessUtilities.executioner(command) + result = ProcessUtilities.outputExecutioner(command) + + if os.path.exists(ProcessUtilities.debugPath): + logging.writeToFile(result) ## Restore to master domain command = 'wp --allow-root --skip-plugins --skip-themes --path=%s --quiet db import %s/dbexport-stage.sql' % (masterPath, masterPath) - ProcessUtilities.executioner(command) + result = ProcessUtilities.outputExecutioner(command) + + if os.path.exists(ProcessUtilities.debugPath): + logging.writeToFile(result) try: command = 'rm -f %s/dbexport-stage.sql' % (masterPath) @@ -211,6 +217,9 @@ class StagingSetup(multi.Thread): command = 'wp theme path --allow-root --skip-plugins --skip-themes --path=%s' % (masterPath) WpContentPath = ProcessUtilities.outputExecutioner(command).splitlines()[-1].replace('wp-content/themes', '') + if os.path.exists(ProcessUtilities.debugPath): + logging.writeToFile(WpContentPath) + command = 'cp -R %s/wp-content/ %s' % (child.path, WpContentPath) ProcessUtilities.executioner(command) @@ -222,10 +231,16 @@ class StagingSetup(multi.Thread): ## Search and replace url command = 'wp search-replace --allow-root --skip-plugins --skip-themes --path=%s "%s" "%s"' % (masterPath, child.domain, replaceDomain) - ProcessUtilities.executioner(command) + result = ProcessUtilities.outputExecutioner(command) + + if os.path.exists(ProcessUtilities.debugPath): + logging.writeToFile(result) command = 'wp search-replace --allow-root --skip-plugins --skip-themes --path=%s "www.%s" "%s"' % (masterPath, child.domain, replaceDomain) - ProcessUtilities.executioner(command) + result = ProcessUtilities.outputExecutioner(command) + + if os.path.exists(ProcessUtilities.debugPath): + logging.writeToFile(result) from filemanager.filemanager import FileManager