2
0
mirror of https://github.com/xcat2/confluent.git synced 2026-09-01 15:06:06 +00:00

Normalize scan to async

Also, for lots of pending nodes, yield between nodes for responsiveness
This commit is contained in:
Jarrod Johnson
2026-08-28 15:51:13 -04:00
parent 306fa83fd7
commit aec404e134
5 changed files with 6 additions and 5 deletions
@@ -716,6 +716,7 @@ async def _recheck_nodes_backend(nodeattribs, configmanager):
# now we go through ones that were identified, but could not pass
# policy or hadn't been able to verify key
for nodename in pending_nodes:
await asyncio.sleep(0)
info = pending_nodes[nodename]
try:
if info['handler'] is None:
@@ -96,7 +96,7 @@ class NodeHandler(object):
# A no-op by default
return
def scan(self):
async def scan(self):
# Do completely passive things to enhance data.
# Probe is permitted to for example attempt a login
# scan *only* does what it can without a login attempt
@@ -28,7 +28,7 @@ class NodeHandler(bmchandler.NodeHandler):
# This is not adequate for being satisfied
return bool(info.get('attributes', {}))
def scan(self):
async def scan(self):
slpattrs = self.info.get('attributes', {})
self.isdense = False
try:
@@ -75,7 +75,7 @@ class NodeHandler(bmchandler.NodeHandler):
async def probe(self):
if self.info.get('enclosure.bay', 0) == 0:
self.scan()
await self.scan()
if self.info.get('enclosure.bay', 0) != 0:
# scan has already populated info
return
@@ -72,7 +72,7 @@ class NodeHandler(bmchandler.NodeHandler):
devname = 'SMM'
maxmacs = 14 # support an enclosure, but try to avoid catching daisy chain
def scan(self):
async def scan(self):
# the UUID is in a weird order, fix it up to match
# ipmi return and property value
uuid = self.info.get('attributes', {}).get('uuid', None)
@@ -22,7 +22,7 @@ class NodeHandler(redfishbmc.NodeHandler):
maxmacs = 18 # support an enclosure, but try to avoid catching daisy chain
is_enclosure = True
def scan(self):
async def scan(self):
attrs = self.info.get('attributes', {})
mtm = attrs.get('enclosure-machinetype-model', None)
if mtm: