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

Keep OEM handler signatures in step with their base class

Four calls reached a base method with an argument list it does not accept,
so they raised TypeError about the argument count.

Three of them would have failed either way, since the base only raises
UnsupportedFunctionality. What changes there is that the failure becomes
the intended, catchable one rather than an argument count error the caller
cannot interpret. get_diagnostic_data grew an autosuffix argument
everywhere except the ipmi generic handler, which is the handler used for
unrecognized hardware. The redfish generic handler already had it. The two
storage super() calls dropped the cfgspec they were given.

The fourth is a real fallback rather than a message: the XCC user_delete
dropped the fishclient it receives from redfish/command.py, so deleting a
uid the XCC does not list raised TypeError instead of attempting the
generic Redfish delete.
This commit is contained in:
Markus Hilger
2026-08-11 05:26:25 +02:00
parent c27327dfe0
commit a22dd62f18
3 changed files with 8 additions and 4 deletions
+3 -1
View File
@@ -189,13 +189,15 @@ class OEMHandler(object):
if False:
yield None
async def get_diagnostic_data(self, savefile, progress=None):
async def get_diagnostic_data(self, savefile, progress=None,
autosuffix=False):
"""Download diagnostic data about target to a file
This should be a payload that the vendor's support team can use
to do diagnostics.
:param savefile: File object or filename to save to
:param progress: Callback to be informed about progress
:param autosuffix: Whether to append a vendor suffix to savefile
:return:
"""
raise exc.UnsupportedFunctionality(
@@ -222,7 +222,8 @@ class OEMHandler(generic.OEMHandler):
async def remove_storage_configuration(self, cfgspec):
if await self.has_xcc():
return await self.immhandler.remove_storage_configuration(cfgspec)
return await super(OEMHandler, self).remove_storage_configuration()
return await super(OEMHandler, self).remove_storage_configuration(
cfgspec)
async def get_ikvm_methods(self):
if await self.has_xcc():
@@ -241,7 +242,8 @@ class OEMHandler(generic.OEMHandler):
async def apply_storage_configuration(self, cfgspec):
if await self.has_xcc():
return await self.immhandler.apply_storage_configuration(cfgspec)
return await super(OEMHandler, self).apply_storage_configuration()
return await super(OEMHandler, self).apply_storage_configuration(
cfgspec)
async def check_storage_configuration(self, cfgspec):
if await self.has_xcc():
@@ -1739,7 +1739,7 @@ class OEMHandler(generic.OEMHandler):
deltarget = '{0},{1}'.format(uid, uidtonamemap[uid])
await wc.grab_json_response('/api/function', {"USER_UserDelete": deltarget})
return True
return await super(OEMHandler, self).user_delete(uid)
return await super(OEMHandler, self).user_delete(uid, fishclient)
async def get_user_expiration(self, uid):
wc = await self.wc()