Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog/69131.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed `kernelpkg.upgrade` on Debian 13 (trixie) and other distros that ship a kernelrelease containing characters outside `[\d.-]` (for example `6.12.86+deb13-amd64`). `kernelpkg_linux_apt._kernel_type` now parses such releases instead of raising `AttributeError: 'NoneType' object has no attribute 'group'`.
2 changes: 1 addition & 1 deletion salt/modules/kernelpkg_linux_apt.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ def _kernel_type():
"""
Parse the kernel name and return its type
"""
return re.match(r"^[\d.-]+-(.+)$", active()).group(1)
return re.match(r"^[\w.+\-~]+-([^-]+)$", active()).group(1)


def _cmp_version(item1, item2):
Expand Down
12 changes: 12 additions & 0 deletions tests/unit/modules/test_kernelpkg_linux_apt.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,15 @@ def test_remove_error(self):
self._kernelpkg.remove,
release=self.KERNEL_LIST[0],
)

def test_kernel_type_with_trixie_release(self):
"""
Test - _kernel_type handles a Debian 13 kernelrelease that contains '+'
"""
with patch.object(
self._kernelpkg, "active", return_value="6.12.86+deb13-amd64"
):
self.assertEqual(
self._kernelpkg._kernel_type(), # pylint: disable=protected-access
"amd64",
)
Loading