diff --git a/Pipfile b/Pipfile index e8630d6..0b8d051 100644 --- a/Pipfile +++ b/Pipfile @@ -13,4 +13,4 @@ flake8 = "*" mypy = "*" [requires] -python_version = "3.8" +python_version = "3.9" diff --git a/subscriber.py b/subscriber.py index 57ff1d3..a97a064 100644 --- a/subscriber.py +++ b/subscriber.py @@ -29,14 +29,15 @@ def build_groups_list( pattern: Optional[str] = None, prefix: Optional[str] = None, ): - # filter out the log groups based on the names, pattern, and prefix provided in the environment variables - groups = [] # ensure filter params have correct values - if pattern == "": + if not names: + names = None + if not pattern: pattern = None - elif prefix == "": + if not prefix: prefix = None - + # filter out the log groups based on the names, pattern, and prefix provided in the environment variables + groups = [] for g in all_groups: group = {"name": g["logGroupName"].strip(), "arn": g["arn"]} if names is None and pattern is None and prefix is None: diff --git a/unsubscriber.py b/unsubscriber.py index 211ddef..3a9a978 100644 --- a/unsubscriber.py +++ b/unsubscriber.py @@ -30,9 +30,11 @@ def build_groups_list( prefix: Optional[str] = None, ): # ensure filter params have correct values - if pattern == "": + if not names: + names = None + if not pattern: pattern = None - elif prefix == "": + if not prefix: prefix = None # filter out the log groups based on the names, pattern, and prefix provided in the environment variables groups = []