From 6b5cfbacd6b1196f01168f9e31aa223b8008ca9c Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Tue, 24 Sep 2019 19:10:13 +0200 Subject: [PATCH] Update stack_upgrade --- setup.py | 1 + wo/cli/plugins/site_functions.py | 15 +++------------ wo/cli/plugins/stack_upgrade.py | 8 ++++++++ wo/core/aptget.py | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/setup.py b/setup.py index cf655c2..7e3e85c 100644 --- a/setup.py +++ b/setup.py @@ -56,6 +56,7 @@ setup(name='wo', 'SQLAlchemy', 'requests', 'distro', + 'apt-mirror-updater', ], data_files=[('/etc/wo', ['config/wo.conf']), ('/etc/wo/plugins.d', conf), diff --git a/wo/cli/plugins/site_functions.py b/wo/cli/plugins/site_functions.py index 920a4a9..9f2d641 100644 --- a/wo/cli/plugins/site_functions.py +++ b/wo/cli/plugins/site_functions.py @@ -930,16 +930,9 @@ def updatewpuserpassword(self, wo_domain, wo_site_webroot): wo_wp_pass = '' WOFileUtils.chdir(self, '{0}/htdocs/'.format(wo_site_webroot)) - # Check if wo_domain is wordpress install - try: - is_wp = WOShellExec.cmd_exec(self, "wp --allow-root core" - " 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: + if not WOShellExec.cmd_exec(self, "wp --allow-root core" + " is-installed"): + # Exit if wo_domain is not wordpress install Log.error(self, "{0} does not seem to be a WordPress site" .format(wo_domain)) @@ -1333,8 +1326,6 @@ def doCleanupAction(self, domain='', webroot='', dbname='', dbuser='', if os.path.isfile('/etc/nginx/sites-available/{0}' .format(domain)): removeNginxConf(self, domain) - if os.path.isdir('/etc/letsencrypt/renewal/{0}_ecc' - .format(domain)): removeAcmeConf(self, domain) if webroot: diff --git a/wo/cli/plugins/stack_upgrade.py b/wo/cli/plugins/stack_upgrade.py index 77cbd28..6114059 100644 --- a/wo/cli/plugins/stack_upgrade.py +++ b/wo/cli/plugins/stack_upgrade.py @@ -209,9 +209,17 @@ class WOStackUpgradeController(CementBaseController): if ["php7.2-fpm"] in apt_packages: WOAptGet.remove(self, ['php7.2-fpm'], 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: WOAptGet.remove(self, ['php7.3-fpm'], 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 if os.path.isfile( diff --git a/wo/core/aptget.py b/wo/core/aptget.py index e41a4f6..d3c2a81 100644 --- a/wo/core/aptget.py +++ b/wo/core/aptget.py @@ -18,7 +18,7 @@ class WOAptGet(): """ try: 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, stdin=None, stdout=f, stderr=subprocess.PIPE,