From 1a9f41ced4e59ba44128146c5743d293bf37f40b Mon Sep 17 00:00:00 2001 From: Hung-te Liang Date: Wed, 24 Oct 2012 19:20:57 +0800 Subject: [PATCH] Fix pecl list if no package installed --- salt/modules/pecl.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/salt/modules/pecl.py b/salt/modules/pecl.py index c25fce231a..9c1af73afd 100644 --- a/salt/modules/pecl.py +++ b/salt/modules/pecl.py @@ -55,12 +55,19 @@ def list(): List installed pecl extensions. ''' + pecls = {} lines = _pecl('list').splitlines() lines.pop(0) + ''' + Only one line if no package installed: + (no packages installed from channel pecl.php.net) + ''' + if not lines: + return pecls + lines.pop(0) lines.pop(0) - pecls = {} for line in lines: m = re.match('^([^ ]+)[ ]+([^ ]+)[ ]+([^ ]+)', line) if m: