Skip to content
Snippets Groups Projects

Implement filtering by severity and release channel

Merged Emanuele Aina requested to merge wip/em/filtering into master
+ 7
9
import collections.abc
import collections
import concurrent.futures
import logging
import sys
@@ -7,16 +7,14 @@ import sys
def item_id(item):
itemid = None
if logging.root.level <= logging.DEBUG:
keys = ("path_with_namespace", "id", "name")
for k in keys:
if itemid is None:
itemid = getattr(item, k, None)
for k in keys:
if itemid is None and isinstance(item, collections.abc.Mapping):
itemid = item.get(k)
itemid = getattr(item, "path_with_namespace", None)
if itemid is None:
itemid = getattr(item, "id", None)
if itemid is None:
itemid = getattr(item, "name", None)
if itemid is None and isinstance(item, str):
itemid = item
if itemid is None and isinstance(item, collections.abc.Sequence):
if itemid is None and isinstance(item, collections.Sequence):
itemid = tuple(item_id(i) for i in item)
if itemid is None:
itemid = item
Loading