Fix for wo upgrade
This commit is contained in:
@@ -8,7 +8,8 @@ from wo.core.domainvalidate import ValidateDomain
|
||||
from wo.core.fileutils import WOFileUtils
|
||||
from wo.cli.plugins.site_functions import *
|
||||
from wo.core.services import WOService
|
||||
from wo.cli.plugins.sitedb import *
|
||||
from wo.cli.plugins.sitedb import (addNewSite, getSiteInfo,
|
||||
updateSiteInfo, deleteSiteInfo, getAllsites)
|
||||
from wo.core.git import WOGit
|
||||
from subprocess import Popen
|
||||
from wo.core.nginxhashbucket import hashbucket
|
||||
@@ -1027,7 +1028,7 @@ class WOSiteUpdateController(CementBaseController):
|
||||
data = dict(site_name=wo_domain, www_domain=wo_www_domain,
|
||||
static=False, basic=True, wp=False, wpfc=False,
|
||||
wpsc=False, wpredis=False, wprocket=False, wpce=False,
|
||||
multisite=False,wpsubdir=False, webroot=wo_site_webroot,
|
||||
multisite=False, wpsubdir=False, webroot=wo_site_webroot,
|
||||
wo_db_name='', wo_db_user='', wo_db_pass='',
|
||||
wo_db_host='',
|
||||
currsitetype=oldsitetype, currcachetype=oldcachetype)
|
||||
|
||||
@@ -8,15 +8,15 @@ import string
|
||||
import subprocess
|
||||
from subprocess import CalledProcessError
|
||||
|
||||
from wo.cli.plugins.sitedb import *
|
||||
from wo.cli.plugins.sitedb import getSiteInfo
|
||||
from wo.cli.plugins.stack import WOStackController
|
||||
from wo.core.aptget import WOAptGet
|
||||
from wo.core.fileutils import WOFileUtils
|
||||
from wo.core.git import WOGit
|
||||
from wo.core.logging import Log
|
||||
from wo.core.mysql import *
|
||||
from wo.core.mysql import WOMysql
|
||||
from wo.core.services import WOService
|
||||
from wo.cli.plugins.stack_pref import pre_pref, post_pref
|
||||
from wo.cli.plugins.stack_pref import post_pref
|
||||
from wo.core.shellexec import CommandExecutionError, WOShellExec
|
||||
from wo.core.sslutils import SSL
|
||||
from wo.core.variables import WOVariables
|
||||
|
||||
@@ -800,7 +800,7 @@ def post_pref(self, apt_packages, packages):
|
||||
encoding='utf-8', mode='w') as myfile:
|
||||
myfile.write("<?php\nphpinfo();\n?>")
|
||||
|
||||
WOFileUtils.chown(self, "{0}22222"
|
||||
WOFileUtils.chown(self, "{0}22222/htdocs"
|
||||
.format(WOVariables.wo_webroot),
|
||||
WOVariables.wo_php_user,
|
||||
WOVariables.wo_php_user, recursive=True)
|
||||
@@ -964,7 +964,7 @@ def post_pref(self, apt_packages, packages):
|
||||
encoding='utf-8', mode='w') as myfile:
|
||||
myfile.write("<?php\nphpinfo();\n?>")
|
||||
|
||||
WOFileUtils.chown(self, "{0}22222"
|
||||
WOFileUtils.chown(self, "{0}22222/htdocs"
|
||||
.format(WOVariables.wo_webroot),
|
||||
WOVariables.wo_php_user,
|
||||
WOVariables.wo_php_user, recursive=True)
|
||||
@@ -1304,8 +1304,10 @@ def post_pref(self, apt_packages, packages):
|
||||
"[\'Servers\'][$i][\'host\'] = \'{0}\';"
|
||||
.format(WOVariables.wo_mysql_host))
|
||||
Log.debug(self, 'Setting Privileges of webroot permission to '
|
||||
'{0}22222/htdocs/db/pma file '.format(WOVariables.wo_webroot))
|
||||
WOFileUtils.chown(self, '{0}22222'.format(WOVariables.wo_webroot),
|
||||
'{0}22222/htdocs/db/pma file '
|
||||
.format(WOVariables.wo_webroot))
|
||||
WOFileUtils.chown(self, '{0}22222/htdocs'
|
||||
.format(WOVariables.wo_webroot),
|
||||
WOVariables.wo_php_user,
|
||||
WOVariables.wo_php_user,
|
||||
recursive=True)
|
||||
@@ -1405,7 +1407,7 @@ def post_pref(self, apt_packages, packages):
|
||||
Log.debug(self, "Setting Privileges to "
|
||||
"{0}22222/htdocs"
|
||||
.format(WOVariables.wo_webroot))
|
||||
WOFileUtils.chown(self, '{0}22222'
|
||||
WOFileUtils.chown(self, '{0}22222/htdocs'
|
||||
.format(WOVariables.wo_webroot),
|
||||
WOVariables.wo_php_user,
|
||||
WOVariables.wo_php_user,
|
||||
@@ -1428,7 +1430,7 @@ def post_pref(self, apt_packages, packages):
|
||||
Log.debug(self, "Setting Privileges to "
|
||||
"{0}22222/htdocs/files"
|
||||
.format(WOVariables.wo_webroot))
|
||||
WOFileUtils.chown(self, '{0}22222'
|
||||
WOFileUtils.chown(self, '{0}22222/htdocs'
|
||||
.format(WOVariables.wo_webroot),
|
||||
WOVariables.wo_php_user,
|
||||
WOVariables.wo_php_user,
|
||||
@@ -1473,7 +1475,7 @@ def post_pref(self, apt_packages, packages):
|
||||
Log.debug(self, "Setting Privileges of webroot permission to "
|
||||
"{0}22222/htdocs/php/webgrind/ file "
|
||||
.format(WOVariables.wo_webroot))
|
||||
WOFileUtils.chown(self, '{0}22222'
|
||||
WOFileUtils.chown(self, '{0}22222/htdocs'
|
||||
.format(WOVariables.wo_webroot),
|
||||
WOVariables.wo_php_user,
|
||||
WOVariables.wo_php_user,
|
||||
@@ -1550,7 +1552,7 @@ def post_pref(self, apt_packages, packages):
|
||||
.format(WOVariables.wo_webroot))
|
||||
os.makedirs('{0}22222/htdocs/cache/redis/phpRedisAdmin'
|
||||
.format(WOVariables.wo_webroot))
|
||||
WOFileUtils.chown(self, '{0}22222'
|
||||
WOFileUtils.chown(self, '{0}22222/htdocs'
|
||||
.format(WOVariables.wo_webroot),
|
||||
WOVariables.wo_php_user,
|
||||
WOVariables.wo_php_user,
|
||||
@@ -1565,7 +1567,7 @@ def post_pref(self, apt_packages, packages):
|
||||
Log.debug(self, 'Setting Privileges of webroot permission to '
|
||||
'{0}22222/htdocs/cache/file '
|
||||
.format(WOVariables.wo_webroot))
|
||||
WOFileUtils.chown(self, '{0}22222'
|
||||
WOFileUtils.chown(self, '{0}22222/htdocs'
|
||||
.format(WOVariables.wo_webroot),
|
||||
WOVariables.wo_php_user,
|
||||
WOVariables.wo_php_user,
|
||||
|
||||
@@ -229,6 +229,10 @@ class WOStackUpgradeController(CementBaseController):
|
||||
'wo-dashboard.tar.gz',
|
||||
'{0}22222/htdocs'
|
||||
.format(WOVariables.wo_webroot))
|
||||
WOFileUtils.chown(self, "{0}22222/htdocs"
|
||||
.format(WOVariables.wo_webroot),
|
||||
WOVariables.wo_php_user,
|
||||
WOVariables.wo_php_user, recursive=True)
|
||||
|
||||
if pargs.composer:
|
||||
Log.info(self, "Upgrading Composer, please wait...")
|
||||
@@ -257,6 +261,10 @@ class WOStackUpgradeController(CementBaseController):
|
||||
.format(WOVariables.wo_phpmyadmin),
|
||||
'{0}22222/htdocs/db/pma/'
|
||||
.format(WOVariables.wo_webroot))
|
||||
WOFileUtils.chown(self, "{0}22222/htdocs"
|
||||
.format(WOVariables.wo_webroot),
|
||||
WOVariables.wo_php_user,
|
||||
WOVariables.wo_php_user, recursive=True)
|
||||
|
||||
Log.info(self, "Successfully updated packages")
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user