From 1b84cd43fe6833997c580f632138b159f5d534de Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Tue, 13 Nov 2018 15:55:24 -0500 Subject: [PATCH] Fix the auto-healing support There was a mismatch between the handlers signature and expectation by the discovery core. --- confluent_server/confluent/discovery/core.py | 3 ++- confluent_server/confluent/discovery/handlers/generic.py | 3 ++- confluent_server/confluent/discovery/handlers/xcc.py | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/confluent_server/confluent/discovery/core.py b/confluent_server/confluent/discovery/core.py index ba853299..0d451077 100644 --- a/confluent_server/confluent/discovery/core.py +++ b/confluent_server/confluent/discovery/core.py @@ -579,7 +579,8 @@ def detected(info): break else: # no nodehandler, ignore for now return - if not handler.adequate(info) and info.get('protocol', None): + if (handler and not handler.NodeHandler.adequate(info) and + info.get('protocol', None)): eventlet.spawn_after(10, info['protocol'].fix_info, info, safe_detected) return diff --git a/confluent_server/confluent/discovery/handlers/generic.py b/confluent_server/confluent/discovery/handlers/generic.py index fe126276..81085246 100644 --- a/confluent_server/confluent/discovery/handlers/generic.py +++ b/confluent_server/confluent/discovery/handlers/generic.py @@ -40,7 +40,8 @@ class NodeHandler(object): targsa = info['addresses'][0] self.ipaddr = targsa[0] - def adequate(self, info): + @classmethod + def adequate(cls, info): # Check if the referenced info is really enough, if false, a rescan # may occur against the target in a short while return True diff --git a/confluent_server/confluent/discovery/handlers/xcc.py b/confluent_server/confluent/discovery/handlers/xcc.py index 34125fcb..574c1b09 100644 --- a/confluent_server/confluent/discovery/handlers/xcc.py +++ b/confluent_server/confluent/discovery/handlers/xcc.py @@ -23,7 +23,8 @@ import pyghmi.ipmi.oem.lenovo.imm as imm class NodeHandler(immhandler.NodeHandler): devname = 'XCC' - def adequate(self, info): + @classmethod + def adequate(cls, info): # We can sometimes receive a partially initialized SLP packet # This is not adequate for being satisfied return bool(info['attributes'])