host-installer_old
host-installer_old copied to clipboard
fix installer on intel motherboard xeon server raid
name = re.match("([^_]*)(_\d+)?$", name).group(1)
Throws: AttributeError: 'NoneType' object has no attribute 'groups'
because sometimes there are more than numbers after the '_'.
Thanks for this contribution. Can you give me examples of a name that matches correctly and the one you saw did not match and caused the bug?
Ping?
Sorry, I was doing this in the office, but had to go forward with another solution. I can't rollback to check the details. The installer is just broken the way it's now. I followed the code to find the bug and prevent future users to end up like me. It's a minor change and the bug is probably introduced by the line 409 for the reasons explained on lines 407 and 408. It's a greedy approach, so I just took a more conservative path, instead of admitting that "mdadm may append an _ followed by a number", I'm taking into account that it might be the case, and update the name if its the case, but keeping the original name otherwise. Here's the error:
I trust your change, but I would like to be able to test the regexp myself at least once on the string that made the installer fail, so if you can provide it that would greatly help.
There's probably a way to extract that string from the host even if it's running another solution, since it's hardware-related.
You may want to try exempli gratia --name=company_namespace
or --name=alpha_n0
I need to understand the context more to be able to try to contribute your patch upstream.
- In what situations may device names have more than numbers after
_
? - Are those custom-named devices? What kind of devices? What's the use case?
With your patch, you avoid the error, but you don't adapt the regexp to match those devices (which should probably be preferred). Why this choice?
I know this may look like a lot of discussion for a small patch, but I really need to understand the context and the outcome clearly before merging it, especially since I did not write the code in the first place.