From 6e657b798746c8949b3c3179cd2c7ea0276650d2 Mon Sep 17 00:00:00 2001 From: Erik Johnson Date: Mon, 22 Oct 2012 12:40:43 -0500 Subject: [PATCH] Tolerate trailing whitespace in package metadata This is an addendum to pull req #2306 that will make _parse_pkg_meta() tolerant of trailing whitespace, should there be any. --- salt/modules/pacman.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/salt/modules/pacman.py b/salt/modules/pacman.py index ee41e620ab..527e1ac2fd 100644 --- a/salt/modules/pacman.py +++ b/salt/modules/pacman.py @@ -36,12 +36,12 @@ def _parse_pkg_meta(path): if result['retcode'] == 0: for line in result['stdout'].split('\n'): if not name: - m = re.match('^Name\s*:\s*(.+)$',line) + m = re.match('^Name\s*:\s*(.+)\s*$',line) if m: name = m.group(1) continue if not version: - m = re.match('^Version\s*:\s*(.+)$',line) + m = re.match('^Version\s*:\s*(.+)\s*$',line) if m: version = m.group(1) continue