On Thu, 2014-07-03 at 11:19 -0400, mulhern wrote:
Related: rhbz#1070095
Examined alternatives are:
- To make use of the uuid.UUID class to store uuids. The difficulty
with this idea is that some things that are labeled uuids are not proper uuids at all. 2) To make the udev_info dict more object oriented, and have it sanitize uuids when they are added. A lot of work for very limited benefit. 3) To canonicalize uuids everytime they are extracted from the info. Brittle, since you can't stop code from accessing the entries directly, and annoyingly inefficient.
This alternative is pretty simple, and to a certain extent it's a workaround for a bug in mdadm, so it wins.
Signed-off-by: mulhern amulhern@redhat.com
blivet/devicelibs/mdraid.py | 9 +++++++++ tests/devicelibs_test/mdraid_test.py | 6 ++++++ 2 files changed, 15 insertions(+)
diff --git a/blivet/devicelibs/mdraid.py b/blivet/devicelibs/mdraid.py index f46571a..31e5b80 100644 --- a/blivet/devicelibs/mdraid.py +++ b/blivet/devicelibs/mdraid.py @@ -242,6 +242,15 @@ def mdexamine(device): if name == "metadata": info["MD_METADATA"] = value
- # mdadm's UUIDs are actual 128 bit uuids, but it formats them strangely.
- # This converts the uuids to canonical form.
- # Example:
- # mdadm UUID: '3386ff85:f5012621:4a435f06:1eb47236'
- # canonical UUID: '3386ff85-f501-2621-4a43-5f061eb47236'
- import uuid
Any reason for the local import? If yes, it should either be fixed or documented.