From d6a71f495f58af71d4d0d6fea1b1d3e1722c33a3 Mon Sep 17 00:00:00 2001 From: Jan Dittberner Date: Mon, 2 Mar 2020 10:11:02 +0100 Subject: [PATCH 1/3] Remove disfunctional create_web_php_fpm_pool_config code --- gvaweb/webtasks/tasks.py | 27 +++++++-------------------- 1 file changed, 7 insertions(+), 20 deletions(-) diff --git a/gvaweb/webtasks/tasks.py b/gvaweb/webtasks/tasks.py index 61ddb66..bd2d28e 100644 --- a/gvaweb/webtasks/tasks.py +++ b/gvaweb/webtasks/tasks.py @@ -40,6 +40,11 @@ def log_and_raise(exception, message, *args): raise Exception(message % args) +def log_without_raise(exception, message, *args): + logargs = list(args) + [exception.returncode, exception.output] + _LOGGER.error(message + "\nreturncode: %d\noutput:\n%s", *logargs) + + def _build_vhost_config_path(sitename): return os.path.join(settings.GVAWEB_NGINX_SITES_AVAILABLE, sitename) @@ -178,25 +183,7 @@ def create_web_php_fpm_pool_config(username): :rtype: boolean """ - conftmpl = _get_template('fpmpool.conf') - confdata = conftmpl.render(user=username) - conffile = None - try: - fpmtemp, filename = mkstemp() - conffile = os.fdopen(fpmtemp, 'w') - conffile.write(confdata.encode('utf8')) - finally: - if conffile: - conffile.close() - try: - subprocess.check_output([ - SUDO_CMD, INSTALL_CMD, '-o', 'root', '-g', 'root', '-m', '0644', - filename, _build_php_fpm_pool_file(username)], - stderr=subprocess.STDOUT) - subprocess.check_output([ - SUDO_CMD, RM_CMD, filename], stderr=subprocess.STDOUT) - except subprocess.CalledProcessError as cpe: - log_and_raise(cpe, 'could not configure PHP FPM for %s', username) + # TODO: implement PHP FPM docker management return True @@ -215,6 +202,6 @@ def delete_web_php_fpm_pool_config(username): SUDO_CMD, RM_CMD, "-f", _build_php_fpm_pool_file(username)], stderr=subprocess.STDOUT) except subprocess.CalledProcessError as cpe: - log_and_raise( + log_without_raise( cpe, 'could not delete PHP FPM configuration for %s', username) return True From ed37864721348a63e9a3e3b12edeebef33ad3c2c Mon Sep 17 00:00:00 2001 From: Jan Dittberner Date: Mon, 2 Mar 2020 10:12:45 +0100 Subject: [PATCH 2/3] Update changelog --- docs/changelog.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/changelog.rst b/docs/changelog.rst index bda43a6..cc75f0a 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -1,6 +1,9 @@ Changelog ========= +* :release:`0.1.6 <2020-03-02>` +* :bug:`-` remove disfunctional code in create_web_php_fpm_pool_config + * :release:`0.1.5 <2020-02-29>` * :bug:`-` fix path to systemctl * :bug:`-` reduce template for nginx vhosts to the bare minimum to use From df925c17a8d3c6f959350566f65f3fff60ebd780 Mon Sep 17 00:00:00 2001 From: Jan Dittberner Date: Mon, 2 Mar 2020 10:13:19 +0100 Subject: [PATCH 3/3] Bump version --- docs/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index a01dc84..6c94f66 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -62,7 +62,7 @@ copyright = u'2015-2020, Jan Dittberner' # The short X.Y version. version = '0.1' # The full version, including alpha/beta/rc tags. -release = '0.1.5' +release = '0.1.6' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages.