Kernel path detection in image files
Bug #1087237 reported by
Javier Collado
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
UTAH |
Fix Released
|
Low
|
Javier Collado |
Bug Description
This is a follow-up of:
https:/
I'm concerned about the words `kernel` or `linux` appear anywhere in a line and getting a string that isn't a real kernel file path.
The proposed alternative is that instead of this:
if 'kernel' in line or 'linux' in line:
newkernel = line.split(
We use something like this:
import re
...
match = re.match(
if match:
newkernel = match.group('path')
Related branches
lp:~javier.collado/utah/bug1087237
- Max Brustkern (community): Approve
- Dimitri John Ledkov (community): Approve
-
Diff: 16 lines (+4/-2)1 file modifiedutah/iso.py (+4/-2)
Changed in utah: | |
status: | New → Triaged |
importance: | Undecided → Low |
Changed in utah: | |
status: | Triaged → Fix Committed |
Changed in utah: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
Ah, I see the rational of mis-detection. )[1].strip( './')
So:
if line.split()[0] in ('kernel', 'linux'):
newkernel = line.split(
Should satisfy that requirement? Split strips leading whitespace.
We could even introduce a temp variable to hold line.spit() list.....