From 1d8dcae6b0e08a44b150f453ce09351957792bd2 Mon Sep 17 00:00:00 2001 From: Markus Hilger Date: Tue, 1 Sep 2026 23:52:25 +0200 Subject: [PATCH] Refuse plainly when a BMC lists no interfaces at all Same function, one line above. EthernetInterfaces is optional, and when it is absent the None went into a request and raised TypeError from the url library rather than saying what was missing. Kept beside the ambiguous case because the two are one question asked twice. --- confluent_server/aiohmi/redfish/command.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/confluent_server/aiohmi/redfish/command.py b/confluent_server/aiohmi/redfish/command.py index 6f845911..644822e5 100644 --- a/confluent_server/aiohmi/redfish/command.py +++ b/confluent_server/aiohmi/redfish/command.py @@ -820,6 +820,11 @@ class Command(object): async def _get_bmc_nic_url(self, name=None): bmcinfo = await self._do_web_request(await self.get_bmcurl()) nicurl = bmcinfo.get('EthernetInterfaces', {}).get('@odata.id', None) + if not nicurl: + # Also optional. The None went straight into a request and + # raised TypeError out of the url library. + raise exc.UnsupportedFunctionality( + 'BMC publishes no network interface collection of its own') niclist = await self._do_web_request(nicurl) candidates = [] oem = await self.oem()