From 4b2703bf65b4f70ef1ebd2e3e51b860b4992dce8 Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Wed, 3 Jul 2019 15:09:58 +0200 Subject: [PATCH] Revert changes for MariaDB --- wo/cli/plugins/maintenance.py | 4 +--- wo/cli/plugins/site.py | 8 ++++++-- wo/cli/plugins/stack.py | 5 +++-- wo/cli/plugins/update.py | 9 +++++++++ 4 files changed, 19 insertions(+), 7 deletions(-) diff --git a/wo/cli/plugins/maintenance.py b/wo/cli/plugins/maintenance.py index 666668d..adf945c 100644 --- a/wo/cli/plugins/maintenance.py +++ b/wo/cli/plugins/maintenance.py @@ -7,10 +7,8 @@ from wo.core.variables import WOVariables from wo.core.aptget import WOAptGet from wo.core.apt_repo import WORepo from wo.core.services import WOService -from wo.core.fileutils import WOFileUtils from wo.core.shellexec import WOShellExec -from wo.core.git import WOGit -from wo.core.download import WODownload + def wo_maintenance_hook(app): diff --git a/wo/cli/plugins/site.py b/wo/cli/plugins/site.py index 73944c5..e8c1db7 100644 --- a/wo/cli/plugins/site.py +++ b/wo/cli/plugins/site.py @@ -839,6 +839,9 @@ class WOSiteUpdateController(CementBaseController): action='store_true')), (['--all'], dict(help="update all sites", action='store_true')), + (['--force'], + dict(help="force letsencrypt certificate renewal", + action='store_true')), ] @expose(help="Update site type or cache") @@ -1082,7 +1085,7 @@ class WOSiteUpdateController(CementBaseController): expiry_days = SSL.getExpirationDays(self, wo_domain) min_expiry_days = 30 if check_ssl: - if (expiry_days <= min_expiry_days): + if (expiry_days <= min_expiry_days) or pargs.force: renewLetsEncrypt(self, wo_domain) else: Log.error( @@ -1119,7 +1122,8 @@ class WOSiteUpdateController(CementBaseController): if expiry_days < 0: return 0 min_expiry_days = 30 - if (expiry_days <= min_expiry_days): + if (expiry_days <= min_expiry_days) or pargs.force: + renewLetsEncrypt(self, ee_domain) Log.info(self, "Certificate was successfully renewed") if not WOService.reload_service(self, 'nginx'): Log.error(self, "service nginx reload failed. " diff --git a/wo/cli/plugins/stack.py b/wo/cli/plugins/stack.py index 12b1150..42813a2 100644 --- a/wo/cli/plugins/stack.py +++ b/wo/cli/plugins/stack.py @@ -1193,7 +1193,7 @@ class WOStackController(CementBaseController): WOMysql.execute(self, "flush privileges;", log=False) - except StatementExcecutionError as e: + except CommandExecutionError as e: Log.info( self, "fail to setup mysql user for netdata") WOService.restart_service(self, 'netdata') @@ -1312,7 +1312,8 @@ class WOStackController(CementBaseController): Log.debug(self, "Extracting file anemometer.tar.gz to " "location /var/lib/wo/tmp/ ") WOExtract.extract( - self, '/var/lib/wo/tmp/anemometer.tar.gz', '/var/lib/wo/tmp/') + self, '/var/lib/wo/tmp/anemometer.tar.gz', + '/var/lib/wo/tmp/') if not os.path.exists('{0}22222/htdocs/db/' .format(WOVariables.wo_webroot)): Log.debug(self, "Creating directory") diff --git a/wo/cli/plugins/update.py b/wo/cli/plugins/update.py index 815a40f..b7a6934 100644 --- a/wo/cli/plugins/update.py +++ b/wo/cli/plugins/update.py @@ -58,6 +58,9 @@ class WOUpdateController(CementBaseController): except OSError as e: Log.debug(self, str(e)) Log.error(self, "WordOps update failed !") + except Exception as e: + Log.debug(self, str(e)) + Log.error(self, "WordOps update failed !") elif self.app.pargs.preserve: try: Log.info(self, "updating WordOps, please wait...") @@ -65,6 +68,9 @@ class WOUpdateController(CementBaseController): except OSError as e: Log.debug(self, str(e)) Log.error(self, "WordOps update failed !") + except Exception as e: + Log.debug(self, str(e)) + Log.error(self, "WordOps update failed !") else: try: Log.info(self, "updating WordOps, please wait...") @@ -72,6 +78,9 @@ class WOUpdateController(CementBaseController): except OSError as e: Log.debug(self, str(e)) Log.error(self, "WordOps update failed !") + except Exception as e: + Log.debug(self, str(e)) + Log.error(self, "WordOps update failed !") def load(app):