Another fix for site_url_https

This commit is contained in:
VirtuBox
2019-07-29 23:02:17 +02:00
parent 6cbfa70764
commit a901cfbc5c

View File

@@ -1314,14 +1314,15 @@ def removeAcmeConf(self, domain):
def site_url_https(self, wo_domain): def site_url_https(self, wo_domain):
if os.path.isfile('/var/www/{0}/wp-config.php'): if os.path.isfile('/var/www/{0}/wp-config.php'):
wo_site_webroot = ('/var/www/{0}'.format(wo_domain)) wo_site_webroot = ('/var/www/{0}'.format(wo_domain))
Log.info(self, "Checking if site url already use https, please wait...") Log.info(self, "Checking if site url already "
"use https, please wait...")
WOFileUtils.chdir(self, '{0}/htdocs/'.format(wo_site_webroot)) WOFileUtils.chdir(self, '{0}/htdocs/'.format(wo_site_webroot))
siteurl = WOShellExec.cmd_exec(self, wo_siteurl = WOShellExec.cmd_exec(self,
"php {0} option get siteurl " "php {0} option get siteurl "
.format(WOVariables.wo_wpcli_path) + .format(WOVariables.wo_wpcli_path) +
"--allow-root --quiet") "--allow-root --quiet")
test_https = re.split(":", siteurl) test_url = re.split(":", wo_siteurl)
if not test_https[0] == 'https': if not (test_url[0] == 'https'):
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(