You could simply catch IndexError.
IndexError
Do we need to ensure the first char is an int?
int
I wonder if we should raise an error or at least log that product_version could not have been guessed.
It would be very helpful if this change had test(s) which showed the expected inputs and outputs.
Please write a unit test for the new code.
rebased onto 9d468c164aae8243aed6546b102d79890f67dffa
It should be a bit better now. Thanks for the reviews :)
Wouldn't it be better to use a regex and return the match?
match = re.search(r'\brhel\d+', toparse) if match: return match[0]
Looks like rhelX will match only very few modules in Brew (and no compose/package builds). Is that right?
rhelX
@mvadkert can you reply to @lholecek's question? I'm actually not sure about the answer.
It's not completely right, because we have to return not match, but "rhel-x" with the "-". But I'm sure there's a similar solution :) /me checks
rebased onto f494d3ef9e7f04083876e298c7fe5d878b9b2e23
rebased onto f163781703d10b33601a20e2c8f0701bbefc19b4
+1
Commit e483b0e2 fixes this pull-request
Pull-Request has been merged by gnaponie