From 9cffd032c49126cf0e18c2062e7f5febb7f4c68c Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Mon, 19 Aug 2019 18:45:30 +0200 Subject: [PATCH] Fix variable ngxroot --- wo/cli/plugins/stack_pref.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/wo/cli/plugins/stack_pref.py b/wo/cli/plugins/stack_pref.py index 7f5af9f..a210b6d 100644 --- a/wo/cli/plugins/stack_pref.py +++ b/wo/cli/plugins/stack_pref.py @@ -549,6 +549,7 @@ def post_pref(self, apt_packages, packages): "\"$http_user_agent\"';\n") if set(WOVariables.wo_php).issubset(set(apt_packages)): + ngxroot = '/var/www/' # Create log directories if not os.path.exists('/var/log/php/7.2/'): Log.debug(self, 'Creating directory /var/log/php/7.2/') @@ -720,6 +721,7 @@ def post_pref(self, apt_packages, packages): # PHP7.3 configuration if set(WOVariables.wo_php73).issubset(set(apt_packages)): + ngxroot = '/var/www/' # Create log directories if not os.path.exists('/var/log/php/7.3/'): Log.debug(self, 'Creating directory /var/log/php/7.3/') @@ -854,35 +856,35 @@ def post_pref(self, apt_packages, packages): # PHP and Debug pull configuration if not os.path.exists('{0}22222/htdocs/fpm/status/' - .format(WOVariables.wo_webroot)): + .format(ngxroot)): Log.debug(self, 'Creating directory ' '{0}22222/htdocs/fpm/status/ ' - .format(WOVariables.wo_webroot)) + .format(ngxroot)) os.makedirs('{0}22222/htdocs/fpm/status/' - .format(WOVariables.wo_webroot)) + .format(ngxroot)) open('{0}22222/htdocs/fpm/status/debug73' - .format(WOVariables.wo_webroot), + .format(ngxroot), encoding='utf-8', mode='a').close() open('{0}22222/htdocs/fpm/status/php73' - .format(WOVariables.wo_webroot), + .format(ngxroot), encoding='utf-8', mode='a').close() # Write info.php if not os.path.exists('{0}22222/htdocs/php/' - .format(WOVariables.wo_webroot)): + .format(ngxroot)): Log.debug(self, 'Creating directory ' '{0}22222/htdocs/php/ ' - .format(WOVariables.wo_webroot)) + .format(ngxroot)) os.makedirs('{0}22222/htdocs/php' - .format(WOVariables.wo_webroot)) + .format(ngxroot)) with open("{0}22222/htdocs/php/info.php" - .format(WOVariables.wo_webroot), + .format(ngxroot), encoding='utf-8', mode='w') as myfile: myfile.write("") WOFileUtils.chown(self, "{0}22222/htdocs" - .format(WOVariables.wo_webroot), + .format(ngxroot), WOVariables.wo_php_user, WOVariables.wo_php_user, recursive=True)