From 3a99e199a12428bed5c4cffe79fceca9302cc49f Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Tue, 30 Jul 2019 21:39:53 +0200 Subject: [PATCH] Fix site_url_https missing .format --- wo/cli/plugins/site.py | 3 ++- wo/cli/plugins/site_functions.py | 12 ++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/wo/cli/plugins/site.py b/wo/cli/plugins/site.py index 45c6cf0..901173d 100644 --- a/wo/cli/plugins/site.py +++ b/wo/cli/plugins/site.py @@ -1300,13 +1300,14 @@ class WOSiteUpdateController(CementBaseController): setupLetsEncrypt(self, wo_domain, False, True, True, wo_acme_dns) httpsRedirect(self, wo_domain, True, True) + site_url_https(self, wo_domain) else: WOFileUtils.mvfile(self, "{0}/conf/nginx/ssl.conf.disabled" .format(wo_site_webroot), '{0}/conf/nginx/ssl.conf' .format(wo_site_webroot)) + site_url_https(self, wo_domain) - site_url_https(self, wo_domain) if not WOService.reload_service(self, 'nginx'): Log.error(self, "service nginx reload failed. " "check issues with `nginx -t` command") diff --git a/wo/cli/plugins/site_functions.py b/wo/cli/plugins/site_functions.py index f5c3070..e36ec8f 100644 --- a/wo/cli/plugins/site_functions.py +++ b/wo/cli/plugins/site_functions.py @@ -1311,9 +1311,9 @@ def removeAcmeConf(self, domain): .format(domain)) -def site_url_https(self, wo_domain): - if os.path.isfile('/var/www/{0}/wp-config.php'): - wo_site_webroot = ('/var/www/{0}'.format(wo_domain)) +def site_url_https(self, domain): + if os.path.isfile('/var/www/{0}/wp-config.php'.format(domain)): + wo_site_webroot = ('/var/www/{0}'.format(domain)) Log.info(self, "Checking if site url already " "use https, please wait...") WOFileUtils.chdir(self, '{0}/htdocs/'.format(wo_site_webroot)) @@ -1326,16 +1326,16 @@ def site_url_https(self, wo_domain): try: WOShellExec.cmd_exec(self, "php {0} option update siteurl " "\'https://{1}\' --allow-root".format( - WOVariables.wo_wpcli_path, wo_domain)) + WOVariables.wo_wpcli_path, domain)) WOShellExec.cmd_exec(self, "php {0} option update home " "\'https://{1}\' --allow-root".format( - WOVariables.wo_wpcli_path, wo_domain)) + WOVariables.wo_wpcli_path, domain)) except CommandExecutionError as e: Log.debug(self, "{0}".format(e)) raise SiteError("plugin activation failed") Log.info( self, "Site address updated " - "successfully to https://{0}".format(wo_domain)) + "successfully to https://{0}".format(domain)) else: Log.info( self, "Site address was already using https")