From 7295d8fdd2a708128c792eb63de38268fc55ad0d Mon Sep 17 00:00:00 2001 From: Ala Rezmerita <ala.rezmerita@cloudwatt.com> Date: Fri, 24 Jan 2014 12:06:03 +0100 Subject: [PATCH] Fix UnboundLocalError error This change corrects the UnboundLocalError exception that can occur if something bad happens on reconnect to RabbitMQ Closes-Bug: #1272271 Change-Id: I9e157810caa7a45e9a61ec571cfe9024fabacf93 --- oslo/messaging/_drivers/impl_rabbit.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/oslo/messaging/_drivers/impl_rabbit.py b/oslo/messaging/_drivers/impl_rabbit.py index dfc8d194d..48393e963 100644 --- a/oslo/messaging/_drivers/impl_rabbit.py +++ b/oslo/messaging/_drivers/impl_rabbit.py @@ -530,9 +530,9 @@ class Connection(object): try: self._connect(params) return - except IOError: + except IOError as e: pass - except self.connection_errors: + except self.connection_errors as e: pass except Exception as e: # NOTE(comstud): Unfortunately it's possible for amqplib