diff --git a/barbican/tasks/keystone_consumer.py b/barbican/tasks/keystone_consumer.py index 7e7057f5d..e41b6fa5c 100644 --- a/barbican/tasks/keystone_consumer.py +++ b/barbican/tasks/keystone_consumer.py @@ -49,13 +49,13 @@ class KeystoneEventConsumer(resources.BaseTask): self.db_start() super(KeystoneEventConsumer, self).process(*args, **kwargs) self.db_commit() - except Exception as e: + except Exception: """Exceptions that reach here needs to revert the entire transaction. No need to log error message as its already done earlier. """ self.db_rollback() - raise e + raise finally: self.db_clear() diff --git a/barbican/tasks/resources.py b/barbican/tasks/resources.py index 983e4c07f..dbefc5679 100644 --- a/barbican/tasks/resources.py +++ b/barbican/tasks/resources.py @@ -91,11 +91,11 @@ class BaseTask(object): # Retrieve the target entity (such as an models.Order instance). try: entity = self.retrieve_entity(*args, **kwargs) - except Exception as e: + except Exception: # Serious error! LOG.exception(u._LE("Could not retrieve information needed to " "process task '%s'."), name) - raise e + raise # Process the target entity. try: @@ -119,10 +119,10 @@ class BaseTask(object): # Handle successful conclusion of processing. try: self.handle_success(entity, result, *args, **kwargs) - except Exception as e: + except Exception: LOG.exception(u._LE("Could not process after successfully " "executing task '%s'."), name) - raise e + raise return result