From 6069eceb23195242405bb52da4c8737fe5f94381 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 30 Apr 2014 13:07:31 -0400 Subject: [PATCH] Provide better trace capture for AttributeErrors under ipmi The ipmi plugin would erroneously treat all AttributeErrors following from 'next()' as indicating the top level was not a generator/iterator. --- plugins/hardwaremanagement/ipmi.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/hardwaremanagement/ipmi.py b/plugins/hardwaremanagement/ipmi.py index c1bbdb21..9fba5953 100644 --- a/plugins/hardwaremanagement/ipmi.py +++ b/plugins/hardwaremanagement/ipmi.py @@ -21,7 +21,6 @@ import eventlet.green.threading as threading import eventlet.greenpool as greenpool import eventlet.queue import pyghmi.constants as pygconstants -import pyghmi.exceptions as pygexc import pyghmi.ipmi.console as console import pyghmi.ipmi.command as ipmicommand import socket @@ -184,6 +183,10 @@ class IpmiIterator(object): try: retdata = self.currdata.next() except AttributeError: + if hasattr(self.currdata, 'next'): + # the attribute error is not the immediate + # one, raise it to be caught as normal + raise retdata = self.currdata self.currdata = None return retdata