maas_ipmi_autodetect mistakes empty slot for taken slot
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MAAS |
Fix Released
|
Critical
|
Jason Hobbs |
Bug Description
Lord_Set reports that some systems are not enlisting. Running maas_ipmi_
raceback (most recent call last):
File "maas_ipmi_
main()
File "maas_ipmi_
apply_
File "maas_ipmi_
ipmi_
File "maas_ipmi_
raise IPMIError('No IPMI user slots available.')
__main__.IPMIError: No IPMI user slots available.
Yet there are clearly empty slots: User1, User2, User3 and so on.
Obtaining the user names for one of these slots as the script does it, produced:
# bmc-config --checkout --key-pair=
Section User5
## Give Username
Username
EndSection
(Indentation may not be correct: the text went through IRC).
The cause of the problem seems to be in bmc_user_get(). It matches that user query output to:
r'^\s*%s(?:[ \t])+([^# \t\r\n\
If that doesn't match, bmc_user_get() returns None. Otherwise, it returns the match. But it looks as if just indentation whitespace _can_ produce a match: in this case the returned user name for an empty slot consisted of just a single space!
I think either the regex needs fixing, or we need to strip the output and also consider the empty user name to indicate an empty slot.
Related branches
- Gavin Panella (community): Approve
-
Diff: 29 lines (+7/-1)2 files modifiedetc/maas/templates/commissioning-user-data/snippets/maas_ipmi_autodetect.py (+1/-1)
etc/maas/templates/commissioning-user-data/snippets/tests/test_maas_ipmi_autodetect.py (+6/-0)
description: | updated |
Changed in maas: | |
assignee: | nobody → Jason Hobbs (jason-hobbs) |
Changed in maas: | |
status: | Triaged → In Progress |
Changed in maas: | |
status: | In Progress → Fix Committed |
tags: | added: server-hwe |
Changed in maas: | |
status: | Fix Committed → Fix Released |