From 8d1960e66e1a083787c4df30d8577f2d53834e0b Mon Sep 17 00:00:00 2001 From: "David H. Irving" Date: Mon, 14 Oct 2024 10:08:02 -0700 Subject: [PATCH] Replace deprecated regex search with glob --- python/lsst/ctrl/mpexec/cli/script/cleanup.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/python/lsst/ctrl/mpexec/cli/script/cleanup.py b/python/lsst/ctrl/mpexec/cli/script/cleanup.py index 15601218..25de8cb9 100644 --- a/python/lsst/ctrl/mpexec/cli/script/cleanup.py +++ b/python/lsst/ctrl/mpexec/cli/script/cleanup.py @@ -141,8 +141,9 @@ def cleanup( collection, butler.registry.getCollectionType(collection).name ) return result - regex = re.compile(collection + ".+") - to_consider = set(butler.registry.queryCollections(regex)) + to_keep.add(collection) + glob = collection + "*" + to_consider = set(butler.registry.queryCollections(glob)) to_remove = to_consider - to_keep for r in to_remove: if butler.registry.getCollectionType(r) == CollectionType.RUN: