patchback[bot]
27ca6be10a
[PR #11813/edf8f249 backport][stable-12] parted: add unit_preserve_case option to fix unit case in return value ( #11875 )
...
parted: add unit_preserve_case option to fix unit case in return value (#11813 )
* parted: add unit_preserve_case option to fix unit case in return value
Adds O(unit_preserve_case) feature flag (bool, default None) to control
the case of the ``unit`` field in the module return value.
Previously the unit was always lowercased (e.g. ``kib``), making it
impossible to feed ``disk.unit`` back as the ``unit`` parameter without
a validation error. With O(unit_preserve_case=true) the unit is returned
in its original mixed case (e.g. ``KiB``), matching the accepted input
values.
The default (None) emits a deprecation notice; the default will become
V(true) in community.general 14.0.0.
Fixes #1860
* parted: add changelog fragment for PR #11813
* adjustments from review
* Comment 15.0.0 deprecation in option decription.
* parted: fix unit test calls to parse_partition_info after signature change
* parted: fix unit_preserve_case - parted outputs lowercase units in machine mode
Parted's machine-parseable output always uses lowercase unit suffixes
(e.g. ``kib``, ``mib``) regardless of what was passed to the ``unit``
parameter. Removing the explicit ``.lower()`` call was therefore not
enough to preserve case.
Add a ``canonical_unit()`` helper that maps a unit string to its canonical
mixed-case form using ``parted_units`` as the reference, and use it
instead of a bare identity when ``unit_preserve_case=true``.
Also fix a yamllint violation in the DOCUMENTATION block (missing space
after ``#`` in inline comments).
* Update plugins/modules/parted.py
* Update plugins/modules/parted.py
---------
(cherry picked from commit edf8f24959 )
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com >
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com >
Co-authored-by: Felix Fontein <felix@fontein.de >
2026-04-18 22:55:45 +02:00
..
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2025-10-10 19:52:04 +02:00
2025-11-01 13:46:53 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2025-11-01 13:46:53 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2025-11-01 13:46:53 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-03-27 21:34:35 +01:00
2026-03-27 21:34:35 +01:00
2026-01-09 19:36:52 +01:00
2025-10-10 19:52:04 +02:00
2026-01-09 19:36:52 +01:00
2025-11-01 13:46:53 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2025-10-10 19:52:04 +02:00
2026-01-09 19:36:52 +01:00
2025-10-10 19:52:04 +02:00
2026-01-09 19:36:52 +01:00
2025-10-10 19:52:04 +02:00
2026-01-09 19:36:52 +01:00
2025-10-10 19:52:04 +02:00
2026-01-09 19:36:52 +01:00
2025-10-10 19:52:04 +02:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-03-25 07:05:05 +01:00
2026-01-09 19:36:52 +01:00
2025-10-10 19:52:04 +02:00
2026-01-09 19:36:52 +01:00
2025-10-10 19:52:04 +02:00
2026-01-09 19:36:52 +01:00
2025-10-10 19:52:04 +02:00
2026-04-12 13:38:08 +02:00
2026-01-09 19:36:52 +01:00
2025-10-10 19:52:04 +02:00
2026-01-09 19:36:52 +01:00
2026-03-16 20:28:22 +01:00
2026-03-15 16:38:30 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-02-23 06:17:51 +01:00
2026-01-09 19:36:52 +01:00
2025-11-01 13:46:53 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2025-12-22 16:01:22 +01:00
2025-12-22 16:01:22 +01:00
2025-12-22 16:01:22 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-03-11 07:10:34 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2025-10-10 19:52:04 +02:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-04-17 18:32:36 +02:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-02-14 21:14:36 +01:00
2026-01-09 19:36:52 +01:00
2026-03-16 20:16:41 +01:00
2026-03-16 20:16:41 +01:00
2026-04-08 15:46:30 +02:00
2026-01-09 19:36:52 +01:00
2026-03-22 11:17:30 +01:00
2026-03-22 11:17:30 +01:00
2026-03-26 21:47:56 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-03-23 07:04:44 +01:00
2026-03-23 07:04:44 +01:00
2026-01-09 19:36:52 +01:00
2025-10-10 19:52:04 +02:00
2026-01-09 19:36:52 +01:00
2025-10-10 19:52:04 +02:00
2026-01-09 19:36:52 +01:00
2025-10-10 19:52:04 +02:00
2026-01-09 19:36:52 +01:00
2025-10-10 19:52:04 +02:00
2026-01-09 19:36:52 +01:00
2025-10-10 19:52:04 +02:00
2026-01-09 19:36:52 +01:00
2026-03-26 06:47:20 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-04-18 22:55:45 +02:00
2025-11-01 13:46:53 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-03-23 20:35:09 +01:00
2026-04-08 15:34:34 +02:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2025-12-22 16:02:13 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2025-10-10 19:52:04 +02:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2026-01-09 19:36:52 +01:00
2025-10-10 19:52:04 +02:00
2026-01-09 19:36:52 +01:00
2026-03-22 20:33:31 +01:00
2026-03-22 11:05:28 +01:00
2025-11-01 13:46:53 +01:00
2025-10-27 11:08:33 +13:00
2026-01-09 19:36:52 +01:00