diff --git a/rbac/management/cache.py b/rbac/management/cache.py index bdc0ca0ec..68d93fcaf 100644 --- a/rbac/management/cache.py +++ b/rbac/management/cache.py @@ -197,17 +197,16 @@ def delete_all_policies_for_tenant(self): logger.info("Deleting entire policy cache for tenant %s", self.tenant) try: key = self.key_for("*") - logger.info("value of key", key) + logger.info(f"value of key: {key}") except Exception as e: - logger.error('error from key = self.key_for("*")', e) - raise e + logger.error(f'error from key = self.key_for("*") with error message: {e}') + keys = [] 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 + logger.error(f"error from keys = self.connection.keys(key): {e}") if keys: try: @@ -217,7 +216,7 @@ def delete_all_policies_for_tenant(self): f"An exception occurred inside delete_all_policies_for_tenant() for tenant {self.tenant} " f"withing line 'if keys': {e}" ) - raise e + logger.info(f"End of 'with self.delete_handler' for tenant {self.tenant}") logger.info(f"End of 'delete_all_policies_for_tenant' for tenant {self.tenant}") diff --git a/rbac/management/seeds.py b/rbac/management/seeds.py index 664b1b08e..8db88dbbb 100644 --- a/rbac/management/seeds.py +++ b/rbac/management/seeds.py @@ -31,19 +31,17 @@ def on_complete(progress, tenant): cache = AccessCache(tenant.org_id) except Exception as e: logger.error(f"An exception occurred inside on_complete() for line 1: {e}") - raise e try: cache.delete_all_policies_for_tenant() except Exception as e: logger.error(f"An exception occurred inside on_complete() for line 2: {e}") - raise e try: connections.close_all() except Exception as e: logger.error(f"An exception occurred inside on_complete() for line 3: {e}") - raise e + logger.info(f"Finished purging policy cache for tenant {tenant.org_id} [{progress}].") @@ -92,4 +90,3 @@ def purge_cache(): executor.submit(on_complete, progress, tenant) except Exception as e: logger.error(f"An exception occurred inside purge_cache() for {tenant}: {e}") - raise e