Update stack_upgrade
This commit is contained in:
1
setup.py
1
setup.py
@@ -56,6 +56,7 @@ setup(name='wo',
|
|||||||
'SQLAlchemy',
|
'SQLAlchemy',
|
||||||
'requests',
|
'requests',
|
||||||
'distro',
|
'distro',
|
||||||
|
'apt-mirror-updater',
|
||||||
],
|
],
|
||||||
data_files=[('/etc/wo', ['config/wo.conf']),
|
data_files=[('/etc/wo', ['config/wo.conf']),
|
||||||
('/etc/wo/plugins.d', conf),
|
('/etc/wo/plugins.d', conf),
|
||||||
|
|||||||
@@ -930,16 +930,9 @@ def updatewpuserpassword(self, wo_domain, wo_site_webroot):
|
|||||||
wo_wp_pass = ''
|
wo_wp_pass = ''
|
||||||
WOFileUtils.chdir(self, '{0}/htdocs/'.format(wo_site_webroot))
|
WOFileUtils.chdir(self, '{0}/htdocs/'.format(wo_site_webroot))
|
||||||
|
|
||||||
# Check if wo_domain is wordpress install
|
if not WOShellExec.cmd_exec(self, "wp --allow-root core"
|
||||||
try:
|
" is-installed"):
|
||||||
is_wp = WOShellExec.cmd_exec(self, "wp --allow-root core"
|
# Exit if wo_domain is not wordpress install
|
||||||
" version")
|
|
||||||
except CommandExecutionError as e:
|
|
||||||
Log.debug(self, "{0}".format(e))
|
|
||||||
raise SiteError("is WordPress site? check command failed ")
|
|
||||||
|
|
||||||
# Exit if wo_domain is not wordpress install
|
|
||||||
if not is_wp:
|
|
||||||
Log.error(self, "{0} does not seem to be a WordPress site"
|
Log.error(self, "{0} does not seem to be a WordPress site"
|
||||||
.format(wo_domain))
|
.format(wo_domain))
|
||||||
|
|
||||||
@@ -1333,8 +1326,6 @@ def doCleanupAction(self, domain='', webroot='', dbname='', dbuser='',
|
|||||||
if os.path.isfile('/etc/nginx/sites-available/{0}'
|
if os.path.isfile('/etc/nginx/sites-available/{0}'
|
||||||
.format(domain)):
|
.format(domain)):
|
||||||
removeNginxConf(self, domain)
|
removeNginxConf(self, domain)
|
||||||
if os.path.isdir('/etc/letsencrypt/renewal/{0}_ecc'
|
|
||||||
.format(domain)):
|
|
||||||
removeAcmeConf(self, domain)
|
removeAcmeConf(self, domain)
|
||||||
|
|
||||||
if webroot:
|
if webroot:
|
||||||
|
|||||||
@@ -209,9 +209,17 @@ class WOStackUpgradeController(CementBaseController):
|
|||||||
if ["php7.2-fpm"] in apt_packages:
|
if ["php7.2-fpm"] in apt_packages:
|
||||||
WOAptGet.remove(self, ['php7.2-fpm'],
|
WOAptGet.remove(self, ['php7.2-fpm'],
|
||||||
auto=False, purge=True)
|
auto=False, purge=True)
|
||||||
|
WOFileUtils.rm(
|
||||||
|
self, '/etc/php/7.2/fpm/pool.d/www.conf')
|
||||||
|
WOFileUtils.rm(
|
||||||
|
self, '/etc/php/7.2/fpm/pool.d/www-two.conf')
|
||||||
if ["php7.3-fpm"] in apt_packages:
|
if ["php7.3-fpm"] in apt_packages:
|
||||||
WOAptGet.remove(self, ['php7.3-fpm'],
|
WOAptGet.remove(self, ['php7.3-fpm'],
|
||||||
auto=False, purge=True)
|
auto=False, purge=True)
|
||||||
|
WOFileUtils.rm(
|
||||||
|
self, '/etc/php/7.3/fpm/pool.d/www.conf')
|
||||||
|
WOFileUtils.rm(
|
||||||
|
self, '/etc/php/7.3/fpm/pool.d/www-two.conf')
|
||||||
|
|
||||||
# check if nginx upgrade is blocked
|
# check if nginx upgrade is blocked
|
||||||
if os.path.isfile(
|
if os.path.isfile(
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ class WOAptGet():
|
|||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
with open('/var/log/wo/wordops.log', 'a') as f:
|
with open('/var/log/wo/wordops.log', 'a') as f:
|
||||||
proc = subprocess.Popen('apt-get update',
|
proc = subprocess.Popen('apt-mirror-updater -u',
|
||||||
shell=True,
|
shell=True,
|
||||||
stdin=None, stdout=f,
|
stdin=None, stdout=f,
|
||||||
stderr=subprocess.PIPE,
|
stderr=subprocess.PIPE,
|
||||||
|
|||||||
Reference in New Issue
Block a user