From 7c6b60188cecad54d9f30853a62dd0df076e52ce Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Wed, 30 Oct 2019 06:14:38 +0100 Subject: [PATCH] Check if file exist before parsing --- wo/cli/plugins/info.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/wo/cli/plugins/info.py b/wo/cli/plugins/info.py index 2d04b0e..602a6ce 100644 --- a/wo/cli/plugins/info.py +++ b/wo/cli/plugins/info.py @@ -78,7 +78,10 @@ class WOInfoController(CementBaseController): upload_max_filesize = config['PHP']['upload_max_filesize'] max_execution_time = config['PHP']['max_execution_time'] - config.read('/etc/{0}/fpm/pool.d/www.conf'.format("php/7.2")) + if os.path.exists('/etc/php/7.2/fpm/pool.d/www.conf'): + config.read('/etc/php/7.2/fpm/pool.d/www.conf') + else: + Log.error(self, 'php-fpm pool config not found') if config.has_section('www'): wconfig = config['www'] elif config.has_section('www-php72'): @@ -162,7 +165,10 @@ class WOInfoController(CementBaseController): upload_max_filesize = config['PHP']['upload_max_filesize'] max_execution_time = config['PHP']['max_execution_time'] - config.read('/etc/php/7.3/fpm/pool.d/www.conf') + if os.path.exists('/etc/php/7.3/fpm/pool.d/www.conf'): + config.read('/etc/php/7.3/fpm/pool.d/www.conf') + else: + Log.error(self, 'php-fpm pool config not found') if config.has_section('www'): wconfig = config['www'] elif config.has_section('www-php73'):