mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-07-08 19:49:09 +00:00
parted: ignore MBR partition type codes in flags on SUSE systems (#12121)
* parted: ignore MBR partition type codes reported as flags by SUSE parted SUSE's patched parted reports MBR partition type codes (e.g., type=8e for Linux LVM) in the machine-parseable flags output. The module was trying to unset these pseudo-flags via 'parted set N type=8e off', which is not a valid parted command, causing the task to fail when using flags: [lvm] on msdos-labelled disks on SUSE systems. Fixes #6292 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat(changelog): add fragment for PR 12121 * Update changelogs/fragments/12121-parted-suse-msdos-type-code.yml Co-authored-by: Felix Fontein <felix@fontein.de> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
parent
5d62edc673
commit
6e6199ae3d
3 changed files with 103 additions and 3 deletions
|
|
@ -765,9 +765,12 @@ def main():
|
|||
if "esp" in flags and "boot" not in flags:
|
||||
flags.append("boot")
|
||||
|
||||
# Compute only the changes in flags status
|
||||
flags_off = list(set(partition["flags"]) - set(flags))
|
||||
flags_on = list(set(flags) - set(partition["flags"]))
|
||||
# Compute only the changes in flags status.
|
||||
# Some parted builds (e.g., SUSE) include MBR partition type codes (e.g.,
|
||||
# type=8e) in the flags output; these cannot be managed via the 'set' command.
|
||||
current_flags = [f for f in partition["flags"] if not re.match(r"^type=[0-9a-fA-F]+$", f)]
|
||||
flags_off = list(set(current_flags) - set(flags))
|
||||
flags_on = list(set(flags) - set(current_flags))
|
||||
|
||||
for f in flags_on:
|
||||
script += ["set", str(number), f, "on"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue