Merge pull request #572 from WordOps/updating-configuration

Fix wo site update not updating php version
This commit is contained in:
VirtuBox
2023-09-16 12:25:56 +02:00
committed by GitHub
3 changed files with 14 additions and 7 deletions

View File

@@ -159,13 +159,13 @@ _wo_complete()
"create") "create")
COMPREPLY=( $(compgen \ COMPREPLY=( $(compgen \
-W "--user --pass --email --html --php --php72 --php73 --php74 --php80 --php81 --php82 --mysql --wp --wpsubdir --wpsubdomain --wpfc --wpsc --proxy= --wpredis --wprocket --wpce -le --letsencrypt --letsencrypt=wildcard -le=wildcard --dns --dns=dns_cf --dns=dns_dgon" \ -W "--user --pass --email --html --php --php72 --php73 --php74 --php80 --php81 --php82 --mysql --wp --wpsubdir --wpsubdomain --wpfc --wpsc --proxy= --alias --wpredis --wprocket --wpce -le --letsencrypt --letsencrypt=wildcard -le=wildcard --dns --dns=dns_cf --dns=dns_dgon" \
-- $cur) ) -- $cur) )
;; ;;
"update") "update")
COMPREPLY=( $(compgen \ COMPREPLY=( $(compgen \
-W "--password --php --php72 --php73 --php74 --php80 --php81 --php82 --mysql --wp --wpsubdir --wpsubdomain --wpfc --wpsc --wpredis --wprocket --wpce -le -le=off --letsencrypt --letsencrypt=off --letsencrypt=clean -le=wildcard -le=clean --dns --dns=dns_cf --dns=dns_dgon --ngxblocker --ngxblocker=off" \ -W "--password --php --php72 --php73 --php74 --php80 --php81 --php82 --mysql --wp --wpsubdir --wpsubdomain --wpfc --wpsc --wpredis --wprocket --wpce --alias -le -le=off --letsencrypt --letsencrypt=off --letsencrypt=clean -le=wildcard -le=clean --dns --dns=dns_cf --dns=dns_dgon --ngxblocker --ngxblocker=off" \
-- $cur) ) -- $cur) )
;; ;;
"delete") "delete")

View File

@@ -64,7 +64,7 @@ setup(name='wordops',
'cement == 2.10.12', 'cement == 2.10.12',
'pystache', 'pystache',
'pynginxconfig', 'pynginxconfig',
'PyMySQL == 1.1.0', 'PyMySQL >= 1.0.2',
'psutil', 'psutil',
'sh', 'sh',
'SQLAlchemy == 1.4.49', 'SQLAlchemy == 1.4.49',

View File

@@ -386,15 +386,20 @@ class WOSiteUpdateController(CementBaseController):
for pargs_version, version in WOVar.wo_php_versions.items(): for pargs_version, version in WOVar.wo_php_versions.items():
old_version_var = bool(check_php_version == version) old_version_var = bool(check_php_version == version)
Log.debug(self, f"old_version_var for {version} = {old_version_var}")
if getattr(pargs, pargs_version): if getattr(pargs, pargs_version):
if globals()[pargs_version] is old_version_var: if globals()[pargs_version] is old_version_var:
Log.info(self, f"PHP {version} is already enabled for given site") Log.info(
self, f"PHP {version} is already enabled for given site")
setattr(pargs, pargs_version, False) setattr(pargs, pargs_version, False)
if (data and not getattr(pargs, pargs_version)): if (data and (not pargs.php73) and
(not pargs.php74) and (not pargs.php72) and
(not pargs.php80) and (not pargs.php81) and (not pargs.php82)):
data[pargs_version] = bool(old_version_var is True) data[pargs_version] = bool(old_version_var is True)
Log.debug(self, f"data {pargs_version} = {data[pargs_version]}") Log.debug(
self, f"data {pargs_version} = {data[pargs_version]}")
globals()[pargs_version] = bool(old_version_var is True) globals()[pargs_version] = bool(old_version_var is True)
if pargs.letsencrypt: if pargs.letsencrypt:
@@ -485,7 +490,9 @@ class WOSiteUpdateController(CementBaseController):
for pargs_version, version in WOVar.wo_php_versions.items(): for pargs_version, version in WOVar.wo_php_versions.items():
if globals()[pargs_version] is True: if globals()[pargs_version] is True:
data['wo_php'] = pargs_version data['wo_php'] = pargs_version
Log.debug(self, f"data wo_php set to {pargs_version}")
check_php_version = version check_php_version = version
Log.debug(self, f"check_php_versions et to {version}")
break break
if pargs.hsts: if pargs.hsts:
@@ -792,7 +799,7 @@ class WOSiteUpdateController(CementBaseController):
# Setup WordPress if old sites are html/php/mysql sites # Setup WordPress if old sites are html/php/mysql sites
if data['wp'] and oldsitetype in ['html', 'proxy', 'php', 'php72', if data['wp'] and oldsitetype in ['html', 'proxy', 'php', 'php72',
'mysql', 'php73', 'php74', 'php80', 'mysql', 'php73', 'php74', 'php80',
'php81', ]: 'php81', 'php82']:
try: try:
wo_wp_creds = setupwordpress(self, data) wo_wp_creds = setupwordpress(self, data)
except SiteError as e: except SiteError as e: