From 8cba9d9ce1d8d9c5e6b014e39597facee291f7c2 Mon Sep 17 00:00:00 2001 From: Mike Blume Date: Thu, 22 Aug 2013 14:37:50 -0700 Subject: [PATCH] only run this findall operation once --- configure-syslog.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/configure-syslog.py b/configure-syslog.py index 0799cf3..45db960 100644 --- a/configure-syslog.py +++ b/configure-syslog.py @@ -638,8 +638,9 @@ def get_syslog_ng_source(default_config_file_path): re.MULTILINE | re.IGNORECASE) output_list = output.split('}') for st in output_list: - if len(compiled_regex.findall(st.replace('\n',''))) > 0: - return compiled_regex.findall(st.replace('\n',''))[0] + result = compiled_regex.findall(st.replace('\n','')) + if result: + return result[0] return source def get_installed_syslog_configuration(syslog_id):