2
0
mirror of https://github.com/xcat2/confluent.git synced 2025-01-28 11:57:37 +00:00

Fix the auto-healing support

There was a mismatch between the handlers signature and expectation by
the discovery core.
This commit is contained in:
Jarrod Johnson 2018-11-13 15:55:24 -05:00
parent 39839a9f2a
commit 1b84cd43fe
3 changed files with 6 additions and 3 deletions

View File

@ -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

View File

@ -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

View File

@ -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'])