Additional fix for redis

This commit is contained in:
VirtuBox
2019-08-06 12:10:50 +02:00
parent 89ebbe9cd6
commit 9e4cdbd05b

View File

@@ -290,7 +290,7 @@ def setupwordpress(self, data):
Log.debug(self, "Setting up wp-config file") Log.debug(self, "Setting up wp-config file")
if not data['multisite']: if not data['multisite']:
Log.debug(self, "Generating wp-config for WordPress Single site") Log.debug(self, "Generating wp-config for WordPress Single site")
Log.debug(self, "bash -c \"php {0} --allow-root " Log.debug(self, "/bin/bash -c \"{0} --allow-root "
.format(WOVariables.wo_wpcli_path) + .format(WOVariables.wo_wpcli_path) +
"config create " + "config create " +
"--dbname=\'{0}\' --dbprefix=\'{1}\' --dbuser=\'{2}\' " "--dbname=\'{0}\' --dbprefix=\'{1}\' --dbuser=\'{2}\' "
@@ -302,7 +302,7 @@ def setupwordpress(self, data):
.format(data['wo_db_pass'], .format(data['wo_db_pass'],
"\n\ndefine(\'WP_DEBUG\', false);")) "\n\ndefine(\'WP_DEBUG\', false);"))
try: try:
if WOShellExec.cmd_exec(self, "bash -c \"php {0} --allow-root" if WOShellExec.cmd_exec(self, "/bin/bash -c \"{0} --allow-root"
.format(WOVariables.wo_wpcli_path) + .format(WOVariables.wo_wpcli_path) +
" config create " + " config create " +
"--dbname=\'{0}\' --dbprefix=\'{1}\' " "--dbname=\'{0}\' --dbprefix=\'{1}\' "
@@ -325,7 +325,7 @@ def setupwordpress(self, data):
raise SiteError("generate wp-config failed for wp single site") raise SiteError("generate wp-config failed for wp single site")
else: else:
Log.debug(self, "Generating wp-config for WordPress multisite") Log.debug(self, "Generating wp-config for WordPress multisite")
Log.debug(self, "bash -c \"php {0} --allow-root " Log.debug(self, "/bin/bash -c \"{0} --allow-root "
.format(WOVariables.wo_wpcli_path) + .format(WOVariables.wo_wpcli_path) +
"config create " + "config create " +
"--dbname=\'{0}\' --dbprefix=\'{1}\' --dbhost=\'{2}\' " "--dbname=\'{0}\' --dbprefix=\'{1}\' --dbhost=\'{2}\' "
@@ -340,7 +340,7 @@ def setupwordpress(self, data):
" false);", " false);",
"\n\ndefine(\'WP_DEBUG\', false);")) "\n\ndefine(\'WP_DEBUG\', false);"))
try: try:
if WOShellExec.cmd_exec(self, "bash -c \"php {0} --allow-root" if WOShellExec.cmd_exec(self, "/bin/bash -c \"{0} --allow-root"
.format(WOVariables.wo_wpcli_path) + .format(WOVariables.wo_wpcli_path) +
" config create " + " config create " +
"--dbname=\'{0}\' --dbprefix=\'{1}\' " "--dbname=\'{0}\' --dbprefix=\'{1}\' "
@@ -365,36 +365,36 @@ def setupwordpress(self, data):
try: try:
WOShellExec.cmd_exec(self, "bash -c \"php {0} --allow-root " WOShellExec.cmd_exec(self, "/bin/bash -c \"{0} --allow-root "
.format(WOVariables.wo_wpcli_path) + .format(WOVariables.wo_wpcli_path) +
"config set WP_CACHE_KEY_SALT " "config set WP_CACHE_KEY_SALT "
"\'{0}:\'\"".format(wo_domain_name)) "\'{0}:\'\"".format(wo_domain_name))
WOShellExec.cmd_exec(self, "bash -c \"php {0} --allow-root " WOShellExec.cmd_exec(self, "/bin/bash -c \"{0} --allow-root "
.format(WOVariables.wo_wpcli_path) + .format(WOVariables.wo_wpcli_path) +
"config set WP_MEMORY_LIMIT " "config set WP_MEMORY_LIMIT "
"\'128M\'\"") "\'128M\'\"")
WOShellExec.cmd_exec(self, "bash -c \"php {0} --allow-root " WOShellExec.cmd_exec(self, "/bin/bash -c \"{0} --allow-root "
.format(WOVariables.wo_wpcli_path) + .format(WOVariables.wo_wpcli_path) +
"config set WP_MAX_MEMORY_LIMIT " "config set WP_MAX_MEMORY_LIMIT "
"\'256M\'\"") "\'256M\'\"")
WOShellExec.cmd_exec(self, "bash -c \"php {0} --allow-root " WOShellExec.cmd_exec(self, "/bin/bash -c \"{0} --allow-root "
.format(WOVariables.wo_wpcli_path) + .format(WOVariables.wo_wpcli_path) +
"config set CONCATENATE_SCRIPTS " "config set CONCATENATE_SCRIPTS "
"false --raw\"") "false --raw\"")
WOShellExec.cmd_exec(self, "bash -c \"php {0} --allow-root " WOShellExec.cmd_exec(self, "/bin/bash -c \"{0} --allow-root "
.format(WOVariables.wo_wpcli_path) + .format(WOVariables.wo_wpcli_path) +
"config set WP_POST_REVISIONS " "config set WP_POST_REVISIONS "
"\'10\'\"") "\'10\'\"")
WOShellExec.cmd_exec(self, "bash -c \"php {0} --allow-root " WOShellExec.cmd_exec(self, "/bin/bash -c \"{0} --allow-root "
.format(WOVariables.wo_wpcli_path) + .format(WOVariables.wo_wpcli_path) +
"config set MEDIA_TRASH " "config set MEDIA_TRASH "
"true --raw\"") "true --raw\"")
WOShellExec.cmd_exec(self, "bash -c \"php {0} --allow-root " WOShellExec.cmd_exec(self, "/bin/bash -c \"{0} --allow-root "
.format(WOVariables.wo_wpcli_path) + .format(WOVariables.wo_wpcli_path) +
"config set EMPTY_TRASH_DAYS " "config set EMPTY_TRASH_DAYS "
"\'15\'\"") "\'15\'\"")
WOShellExec.cmd_exec(self, "bash -c \"php {0} --allow-root " WOShellExec.cmd_exec(self, "/bin/bash -c \"{0} --allow-root "
.format(WOVariables.wo_wpcli_path) + .format(WOVariables.wo_wpcli_path) +
"config set WP_AUTO_UPDATE_CORE " "config set WP_AUTO_UPDATE_CORE "
"minor\"") "minor\"")
@@ -456,14 +456,14 @@ def setupwordpress(self, data):
if not data['multisite']: if not data['multisite']:
Log.debug(self, "Creating tables for WordPress Single site") Log.debug(self, "Creating tables for WordPress Single site")
Log.debug(self, "php {0} --allow-root core install " Log.debug(self, "{0} --allow-root core install "
.format(WOVariables.wo_wpcli_path) + .format(WOVariables.wo_wpcli_path) +
"--url=\'{0}\' --title=\'{0}\' --admin_name=\'{1}\' " "--url=\'{0}\' --title=\'{0}\' --admin_name=\'{1}\' "
.format(data['www_domain'], wo_wp_user) + .format(data['www_domain'], wo_wp_user) +
"--admin_password= --admin_email=\'{1}\'" "--admin_password= --admin_email=\'{1}\'"
.format(wo_wp_pass, wo_wp_email)) .format(wo_wp_pass, wo_wp_email))
try: try:
if WOShellExec.cmd_exec(self, "php {0} --allow-root core " if WOShellExec.cmd_exec(self, "{0} --allow-root core "
.format(WOVariables.wo_wpcli_path) + .format(WOVariables.wo_wpcli_path) +
"install --url=\'{0}\' --title=\'{0}\' " "install --url=\'{0}\' --title=\'{0}\' "
"--admin_name=\'{1}\' " "--admin_name=\'{1}\' "
@@ -480,7 +480,7 @@ def setupwordpress(self, data):
raise SiteError("setup WordPress tables failed for single site") raise SiteError("setup WordPress tables failed for single site")
else: else:
Log.debug(self, "Creating tables for WordPress multisite") Log.debug(self, "Creating tables for WordPress multisite")
Log.debug(self, "php {0} --allow-root " Log.debug(self, "{0} --allow-root "
.format(WOVariables.wo_wpcli_path) + .format(WOVariables.wo_wpcli_path) +
"core multisite-install " "core multisite-install "
"--url=\'{0}\' --title=\'{0}\' --admin_name=\'{1}\' " "--url=\'{0}\' --title=\'{0}\' --admin_name=\'{1}\' "
@@ -491,7 +491,7 @@ def setupwordpress(self, data):
subdomains='--subdomains' subdomains='--subdomains'
if not data['wpsubdir'] else '')) if not data['wpsubdir'] else ''))
try: try:
if WOShellExec.cmd_exec(self, "php {0} --allow-root " if WOShellExec.cmd_exec(self, "{0} --allow-root "
.format(WOVariables.wo_wpcli_path) + .format(WOVariables.wo_wpcli_path) +
"core multisite-install " "core multisite-install "
"--url=\'{0}\' --title=\'{0}\' " "--url=\'{0}\' --title=\'{0}\' "
@@ -513,7 +513,7 @@ def setupwordpress(self, data):
Log.debug(self, "Updating WordPress permalink") Log.debug(self, "Updating WordPress permalink")
try: try:
WOShellExec.cmd_exec(self, " php {0} --allow-root " WOShellExec.cmd_exec(self, " {0} --allow-root "
.format(WOVariables.wo_wpcli_path) + .format(WOVariables.wo_wpcli_path) +
"rewrite structure " "rewrite structure "
"/%year%/%monthnum%/%day%/%postname%/") "/%year%/%monthnum%/%day%/%postname%/")
@@ -619,7 +619,7 @@ def installwp_plugin(self, plugin_name, data):
.format(plugin_name)) .format(plugin_name))
WOFileUtils.chdir(self, '{0}/htdocs/'.format(wo_site_webroot)) WOFileUtils.chdir(self, '{0}/htdocs/'.format(wo_site_webroot))
try: try:
WOShellExec.cmd_exec(self, "php {0} plugin " WOShellExec.cmd_exec(self, "{0} plugin "
.format(WOVariables.wo_wpcli_path) + .format(WOVariables.wo_wpcli_path) +
"--allow-root install " "--allow-root install "
"{0}".format(plugin_name)) "{0}".format(plugin_name))
@@ -628,7 +628,7 @@ def installwp_plugin(self, plugin_name, data):
raise SiteError("plugin installation failed") raise SiteError("plugin installation failed")
try: try:
WOShellExec.cmd_exec(self, "php {0} plugin " WOShellExec.cmd_exec(self, "{0} plugin "
.format(WOVariables.wo_wpcli_path) + .format(WOVariables.wo_wpcli_path) +
"--allow-root activate " "--allow-root activate "
"{0} {na}" "{0} {na}"
@@ -856,7 +856,7 @@ def site_package_check(self, stype):
if (os.path.isfile("/etc/nginx/nginx.conf") and if (os.path.isfile("/etc/nginx/nginx.conf") and
not os.path.isfile("/etc/nginx/common/redis-php72.conf")): not os.path.isfile("/etc/nginx/common/redis-php72.conf")):
data = dict() data = dict(upstream="php72")
Log.debug(self, 'Writting the nginx configuration to ' Log.debug(self, 'Writting the nginx configuration to '
'file /etc/nginx/common/redis-php72.conf') 'file /etc/nginx/common/redis-php72.conf')
wo_nginx = open('/etc/nginx/common/redis-php72.conf', wo_nginx = open('/etc/nginx/common/redis-php72.conf',