Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
filesystem: handle sorting disks without required metadata
If there are at least two disks and one of them is missing any metadata used during sorting installer will crash. Issue can be reproduced using already available machine .json file: examples/machines/existing-partitions.json in which /dev/vda does not have serial value. This patch makes sure that all values used in sorting are initialized 2025-01-21 15:41:33,340 ERROR root:38 finish: subiquity/apply_autoinstall_config: FAIL: '<' not supported between instances of 'str' and 'NoneType' 2025-01-21 15:41:33,340 ERROR subiquity.server.server:503 top level error Traceback (most recent call last): File "/home/rmalz/repos/subiquity/subiquity/server/server.py", line 1021, in start await self.apply_autoinstall_config() File "/home/rmalz/repos/subiquity/subiquitycore/context.py", line 165, in decorated_async return await meth(self, **kw) File "/home/rmalz/repos/subiquity/subiquity/server/server.py", line 575, in apply_autoinstall_config await controller.apply_autoinstall_config() File "/home/rmalz/repos/subiquity/subiquitycore/context.py", line 165, in decorated_async return await meth(self, **kw) File "/home/rmalz/repos/subiquity/subiquity/server/controllers/filesystem.py", line 484, in apply_autoinstall_config await self.convert_autoinstall_config(context=context) File "/home/rmalz/repos/subiquity/subiquitycore/context.py", line 165, in decorated_async return await meth(self, **kw) File "/home/rmalz/repos/subiquity/subiquity/server/controllers/filesystem.py", line 1745, in convert_autoinstall_config await self.run_autoinstall_guided(self.ai_data["layout"]) File "/home/rmalz/repos/subiquity/subiquity/server/controllers/filesystem.py", line 1684, in run_autoinstall_guided disk = self.get_bootable_matching_disk(match) File "/home/rmalz/repos/subiquity/subiquity/server/controllers/filesystem.py", line 1594, in get_bootable_matching_disk matching_disks = self.get_bootable_matching_disks(match) File "/home/rmalz/repos/subiquity/subiquity/server/controllers/filesystem.py", line 1582, in get_bootable_matching_disks matching_disks = self.model.disks_for_match(disks, match) File "/home/rmalz/repos/subiquity/subiquity/models/filesystem.py", line 1800, in disks_for_match candidates, _ = self._matching_disks(disks, match) File "/home/rmalz/repos/subiquity/subiquity/models/filesystem.py", line 1791, in _matching_disks candidates = self._sorted_matches(candidates, m) File "/home/rmalz/repos/subiquity/subiquity/models/filesystem.py", line 1769, in _sorted_matches disks.sort(key=lambda d: d.sort_key) TypeError: '<' not supported between instances of 'str' and 'NoneType' Fixes: #2050
- Loading branch information