Commit 180f58bc authored by erdnaxe's avatar erdnaxe 🎇

Merge branch 'patch-1' into 'master'

Update filters.py for multiple groups

See merge request erdnaxe/saphsync!1
parents e0809689 8be2f92f
......@@ -27,16 +27,17 @@ def filter_group(event, selected_groups) -> bool:
summary_search = re.search('([0-9]{3}) - ([A-Z]{2}) \(grpe : ([^\)]*)\)', summary, re.IGNORECASE)
if summary_search:
ue, group = 'ue_' + summary_search.group(1), summary_search.group(3)
ue, groups = 'ue_' + summary_search.group(1), summary_search.group(3).split(' - ')
if ue in selected_groups:
# UE is configured
if group in selected_groups[ue]:
# Group was selected
return True
else:
# Group is not the one selected
logger.info('Removed {} because it had not been chosen'.format(summary))
return False
for group in groups:
if group in selected_groups[ue]:
# Group was selected
return True
# Group is not the one selected
logger.info('Removed {} because it had not been chosen'.format(summary))
return False
# If there is not a group specified do not filter
return True
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment