2
0
mirror of https://github.com/xcat2/confluent.git synced 2026-01-11 02:22:31 +00:00

Add a more helpful error when bmc not set

When doing a configbmc, need to present
a more reasonable message about lack of address.
This commit is contained in:
Jarrod Johnson
2025-10-08 14:20:44 -04:00
parent 7cdfcd4913
commit 50243b67d5

View File

@@ -261,6 +261,10 @@ def handle_request(env, start_response):
res['bmcvlan'] = vlan
bmcaddr = hmattr.get('hardwaremanagement.manager', {}).get('value',
None)
if not bmcaddr:
start_response('500 Internal Server Error', [])
yield 'Missing value in hardwaremanagement.manager'
return
bmcaddr = bmcaddr.split('/', 1)[0]
bmcaddr = socket.getaddrinfo(bmcaddr, 0)[0]
bmcaddr = bmcaddr[-1][0]