2
0
mirror of https://github.com/xcat2/confluent.git synced 2026-09-04 20:17:58 +00:00

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.
This commit is contained in:
Markus Hilger
2026-09-01 23:52:25 +02:00
parent 6909d1b5df
commit 1d8dcae6b0
@@ -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()