diff --git a/wo/cli/plugins/stack.py b/wo/cli/plugins/stack.py index 537ffd5..95e24bf 100644 --- a/wo/cli/plugins/stack.py +++ b/wo/cli/plugins/stack.py @@ -192,7 +192,7 @@ class WOStackController(CementBaseController): if pargs.redis: pargs.php = True if not WOAptGet.is_installed(self, 'redis-server'): - apt_packages = apt_packages + ["redis-server"] + apt_packages = apt_packages + WOVariables.wo_redis else: Log.info(self, "Redis already installed") @@ -201,11 +201,8 @@ class WOStackController(CementBaseController): if pargs.php: Log.debug(self, "Setting apt_packages variable for PHP 7.2") if not (WOAptGet.is_installed(self, 'php7.2-fpm')): - if not (WOAptGet.is_installed(self, 'php7.3-fpm')): - apt_packages = (apt_packages + WOVariables.wo_php + - WOVariables.wo_php_extra) - else: - apt_packages = apt_packages + WOVariables.wo_php + apt_packages = (apt_packages + WOVariables.wo_php + + WOVariables.wo_php_extra) else: Log.debug(self, "PHP 7.2 already installed") Log.info(self, "PHP 7.2 already installed") @@ -214,12 +211,9 @@ class WOStackController(CementBaseController): if pargs.php73: Log.debug(self, "Setting apt_packages variable for PHP 7.3") if not WOAptGet.is_installed(self, 'php7.3-fpm'): - if not (WOAptGet.is_installed(self, 'php7.2-fpm')): - apt_packages = (apt_packages + WOVariables.wo_php + - WOVariables.wo_php73 + - WOVariables.wo_php_extra) - else: - apt_packages = apt_packages + WOVariables.wo_php73 + apt_packages = (apt_packages + WOVariables.wo_php + + WOVariables.wo_php73 + + WOVariables.wo_php_extra) else: Log.debug(self, "PHP 7.3 already installed") Log.info(self, "PHP 7.3 already installed") diff --git a/wo/cli/plugins/stack_pref.py b/wo/cli/plugins/stack_pref.py index d921382..5be5dad 100644 --- a/wo/cli/plugins/stack_pref.py +++ b/wo/cli/plugins/stack_pref.py @@ -137,7 +137,7 @@ def pre_pref(self, apt_packages): Log.debug(self, 'Adding deb.sury GPG key') WORepo.add_key(self, WOVariables.wo_php_key) # add redis repository - if set(['redis-server']).issubset(set(apt_packages)): + if set(WOVariables.wo_redis).issubset(set(apt_packages)): Log.info(self, "Adding repository for Redis, please wait...") if WOVariables.wo_distro == 'ubuntu': Log.debug(self, 'Adding ppa for redis') @@ -837,7 +837,7 @@ def post_pref(self, apt_packages, packages, upgrade=False): WOService.restart_service(self, 'php7.3-fpm') # create mysql config if it doesn't exist - if set(["mariadb-server"]).issubset(set(apt_packages)): + if "mariadb-server" in apt_packages: if not os.path.isfile("/etc/mysql/my.cnf"): config = ("[mysqld]\nwait_timeout = 30\n" "interactive_timeout=60\nperformance_schema = 0" @@ -914,7 +914,7 @@ def post_pref(self, apt_packages, packages, upgrade=False): WOService.reload_service(self, 'fail2ban') # Proftpd configuration - if set(["proftpd-basic"]).issubset(set(apt_packages)): + if "proftpd-basic" in apt_packages: if os.path.isfile("/etc/proftpd/proftpd.conf"): Log.info(self, "Configuring ProFTPd") Log.debug(self, "Setting up Proftpd configuration") @@ -1002,7 +1002,7 @@ def post_pref(self, apt_packages, packages, upgrade=False): WOService.reload_service(self, 'proftpd') # Redis configuration - if set(['redus-server']).issubset(set(apt_packages)): + if "redis-server" in apt_packages: if os.path.isfile("/etc/nginx/conf.d/upstream.conf"): if not WOFileUtils.grep(self, "/etc/nginx/conf.d/" "upstream.conf",