From 46e5301f476b274af1a9b684ca052d903012198a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petra=20C=CC=8Ci=CC=81halova=CC=81?= Date: Thu, 27 Jun 2024 08:02:26 +0200 Subject: [PATCH] temporary logs for debugging the purge_cache() issue --- rbac/management/cache.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/rbac/management/cache.py b/rbac/management/cache.py index 7085bd471..bdc0ca0ec 100644 --- a/rbac/management/cache.py +++ b/rbac/management/cache.py @@ -195,8 +195,20 @@ def delete_all_policies_for_tenant(self): err_msg = f"Error deleting all policies for tenant {self.tenant}" with self.delete_handler(err_msg): logger.info("Deleting entire policy cache for tenant %s", self.tenant) - keys = self.connection.keys(self.key_for("*")) - logger.info(f"Content of 'keys' variable: {keys}") + try: + key = self.key_for("*") + logger.info("value of key", key) + except Exception as e: + logger.error('error from key = self.key_for("*")', e) + raise e + + try: + keys = self.connection.keys(key) + logger.info(f"Content of 'keys' variable: {keys}") + except Exception as e: + logger.error("error from keys = self.connection.keys(key)", e) + raise e + if keys: try: self.connection.delete(*keys)