From 24e8cd7e001a752ee992d4ab8b0cef753f9e2ed4 Mon Sep 17 00:00:00 2001 From: Markus Hilger Date: Sat, 15 Aug 2026 12:58:16 +0200 Subject: [PATCH] Check for a deleted account without the cache The delete that failed left the account collection cached as it was, so asking whether the account is gone could only ever answer no. --- confluent_server/aiohmi/redfish/command.py | 9 +++++---- confluent_server/aiohmi/redfish/oem/generic.py | 5 ++++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/confluent_server/aiohmi/redfish/command.py b/confluent_server/aiohmi/redfish/command.py index b97b229a..31545b1f 100644 --- a/confluent_server/aiohmi/redfish/command.py +++ b/confluent_server/aiohmi/redfish/command.py @@ -321,17 +321,18 @@ class Command(object): } return names - async def _account_url_info_by_id(self, uid): + async def _account_url_info_by_id(self, uid, cache=True): srvurl = await self._accountserviceurl() oem = await self.oem() if srvurl: - srvinfo = await self._do_web_request(srvurl) + srvinfo = await self._do_web_request(srvurl, cache=cache) srvurl = srvinfo.get('Accounts', {}).get('@odata.id', None) if srvurl: - srvinfo = await self._do_web_request(srvurl) + srvinfo = await self._do_web_request(srvurl, cache=cache) accounts = srvinfo.get('Members', []) for account in accounts: - accinfo = await self._do_web_request(account['@odata.id']) + accinfo = await self._do_web_request(account['@odata.id'], + cache=cache) currid = accinfo.get('Id', None) if str(currid) == str(uid): accinfo['expiration'] = await oem.get_user_expiration( diff --git a/confluent_server/aiohmi/redfish/oem/generic.py b/confluent_server/aiohmi/redfish/oem/generic.py index 942b1ffa..23d08719 100644 --- a/confluent_server/aiohmi/redfish/oem/generic.py +++ b/confluent_server/aiohmi/redfish/oem/generic.py @@ -795,7 +795,10 @@ class OEMHandler(object): # that is for break await asyncio.sleep(3) - if not await fishclient._account_url_info_by_id(uid): + # Uncached: a delete that failed left the account collection in the + # url cache as it was before, and answering this from that snapshot + # could only ever say the account is still there + if not await fishclient._account_url_info_by_id(uid, cache=False): return True try: await fishclient.set_user_password(uid, base64.b64encode(os.urandom(15)))