Fix site_url_https missing .format

This commit is contained in:
VirtuBox
2019-07-30 21:39:53 +02:00
parent 7e55998d6e
commit 3a99e199a1
2 changed files with 8 additions and 7 deletions

View File

@@ -1300,13 +1300,14 @@ class WOSiteUpdateController(CementBaseController):
setupLetsEncrypt(self, wo_domain, False, True, setupLetsEncrypt(self, wo_domain, False, True,
True, wo_acme_dns) True, wo_acme_dns)
httpsRedirect(self, wo_domain, True, True) httpsRedirect(self, wo_domain, True, True)
site_url_https(self, wo_domain)
else: else:
WOFileUtils.mvfile(self, "{0}/conf/nginx/ssl.conf.disabled" WOFileUtils.mvfile(self, "{0}/conf/nginx/ssl.conf.disabled"
.format(wo_site_webroot), .format(wo_site_webroot),
'{0}/conf/nginx/ssl.conf' '{0}/conf/nginx/ssl.conf'
.format(wo_site_webroot)) .format(wo_site_webroot))
site_url_https(self, wo_domain)
site_url_https(self, wo_domain)
if not WOService.reload_service(self, 'nginx'): if not WOService.reload_service(self, 'nginx'):
Log.error(self, "service nginx reload failed. " Log.error(self, "service nginx reload failed. "
"check issues with `nginx -t` command") "check issues with `nginx -t` command")

View File

@@ -1311,9 +1311,9 @@ def removeAcmeConf(self, domain):
.format(domain)) .format(domain))
def site_url_https(self, wo_domain): def site_url_https(self, domain):
if os.path.isfile('/var/www/{0}/wp-config.php'): if os.path.isfile('/var/www/{0}/wp-config.php'.format(domain)):
wo_site_webroot = ('/var/www/{0}'.format(wo_domain)) wo_site_webroot = ('/var/www/{0}'.format(domain))
Log.info(self, "Checking if site url already " Log.info(self, "Checking if site url already "
"use https, please wait...") "use https, please wait...")
WOFileUtils.chdir(self, '{0}/htdocs/'.format(wo_site_webroot)) WOFileUtils.chdir(self, '{0}/htdocs/'.format(wo_site_webroot))
@@ -1326,16 +1326,16 @@ def site_url_https(self, wo_domain):
try: try:
WOShellExec.cmd_exec(self, "php {0} option update siteurl " WOShellExec.cmd_exec(self, "php {0} option update siteurl "
"\'https://{1}\' --allow-root".format( "\'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 " WOShellExec.cmd_exec(self, "php {0} option update home "
"\'https://{1}\' --allow-root".format( "\'https://{1}\' --allow-root".format(
WOVariables.wo_wpcli_path, wo_domain)) WOVariables.wo_wpcli_path, domain))
except CommandExecutionError as e: except CommandExecutionError as e:
Log.debug(self, "{0}".format(e)) Log.debug(self, "{0}".format(e))
raise SiteError("plugin activation failed") raise SiteError("plugin activation failed")
Log.info( Log.info(
self, "Site address updated " self, "Site address updated "
"successfully to https://{0}".format(wo_domain)) "successfully to https://{0}".format(domain))
else: else:
Log.info( Log.info(
self, "Site address was already using https") self, "Site address was already using https")