From 1b08481491624dbaa90b59c34b2c29d47f006346 Mon Sep 17 00:00:00 2001 From: Takashi Natsume Date: Sun, 21 Aug 2022 21:07:52 +0900 Subject: [PATCH] Fix a deprecation warning about threading.Thread Fix the following deprecation warning. * DeprecationWarning: setDaemon() is deprecated, set the daemon attribute instead Change-Id: I7af41eddf597e1ac78e8835a5af2e029d65a302a Closes-Bug: 1987191 Signed-off-by: Takashi Natsume --- glance/api/v2/cached_images.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glance/api/v2/cached_images.py b/glance/api/v2/cached_images.py index b0409dcb53..3c4bb2a2fc 100644 --- a/glance/api/v2/cached_images.py +++ b/glance/api/v2/cached_images.py @@ -257,7 +257,7 @@ class CacheWorker(threading.Thread): # NOTE(abhishekk): Setting daemon to True because if `atexit` event # handler is not called due to some reason the main process will # not hang for the thread which will never exit. - self.setDaemon(True) + self.daemon = True def submit(self, job): self.q.put(job)