From bb2fe7440d24c3728c9ffcf171310f48a6bfbdd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaroslav=20=C5=A0karvada?= Date: Thu, 30 Mar 2017 14:56:44 +0200 Subject: [PATCH] variables: fixed parsing of function parameters containing undefined variables MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixed parsing of e.g.: ${f:a:${var1}:${var2}} If var1 wasn't defined it was incorrectly parsed as: f:a:${var1 I.e. it resulted in invalid number of parameters error, as the called function was missing the second parameter. Now with bot variables undefined it parses as: f:a:${var1}:${var2} I.e. it resulted in correct number of parameters even with undefined variables. Signed-off-by: Jaroslav Škarvada --- tuned/profiles/functions/functions.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tuned/profiles/functions/functions.py b/tuned/profiles/functions/functions.py index 3489cf6..71bf112 100644 --- a/tuned/profiles/functions/functions.py +++ b/tuned/profiles/functions/functions.py @@ -43,6 +43,6 @@ class Functions(): def expand(self, s): if s is None: return s - r = re.compile(r'(?