From a5df37424bec381ff888b35594de23850ef31a42 Mon Sep 17 00:00:00 2001 From: enricobacis Date: Wed, 14 Oct 2015 10:45:32 -0600 Subject: [PATCH] use '[\s,;]+' as package separator --- doraemon.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doraemon.py b/doraemon.py index b1b3cc0..459c316 100644 --- a/doraemon.py +++ b/doraemon.py @@ -112,8 +112,8 @@ class MyApp: db = Popen(['/sbin/e-smith/db', 'roles', 'getjson'], stdout=PIPE).communicate()[0] for data in json.loads(db): if data['name'] == role: - retval['addpkg'] = data['props']['Addpkg'].split() - retval['delpkg'] = data['props']['Delpkg'].split() + retval['addpkg'] = re.split(r'[\s,;]+', data['props']['Addpkg']) + retval['delpkg'] = re.split(r'[\s,;]+', data['props']['Delpkg']) continue except: pass return retval