Skip to content

Commit 73f4222

Browse files
committed
break at the right time
Signed-off-by: Zen <[email protected]>
1 parent 04c70e9 commit 73f4222

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/ugrd/base/test.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,15 @@
1313
def find_kernel_path(self):
1414
from pathlib import Path
1515
self.logger.info("Trying to find the kernel path for: %s", self['kernel_version'])
16+
kernel_path = Path(self['_kmod_dir']) / 'vmlinuz' # try this first
1617
if not (self['_kmod_dir'] / 'vmlinuz').exists():
1718
for search_dir in ['/boot', '/efi']:
1819
for prefix in ['vmlinuz', 'kernel', 'linux', 'bzImage']:
1920
kernel_path = Path(search_dir) / f'{prefix}-{self["kernel_version"]}'
20-
self.logger.warning("Trying kernel path: %s", kernel_path)
21-
if kernel_path.exists():
22-
break
21+
if kernel_path.exists():
22+
break
2323
else:
2424
raise FileNotFoundError("Kernel not found: %s" % self['kernel_version'])
25-
else:
26-
kernel_path = Path(self['_kmod_dir']) / 'vmlinuz'
2725

2826
self.logger.info("Found kernel at: %s", kernel_path)
2927
self['test_kernel'] = kernel_path

0 commit comments

Comments
 (0)