Add a docstring to mdraid.mdexamine

Signed-off-by: mulhern <amulhern@redhat.com>
Factor canonicalize_UUID() into separate method.

Signed-off-by: mulhern <amulhern@redhat.com>
Be more robust in the face of possible changes to mdadm's UUIDs.

Signed-off-by: mulhern <amulhern@redhat.com>
Extend mdadm() to capture output

Use it in mdexamine()

Signed-off-by: mulhern <amulhern@redhat.com>
Add a method to extract information about an mdraid array

mdadm --detail can give useful information about the number of spare devices
and other things that mdadm --examine can not. According to the man page
--examine applies to devices which are components of an array, while --detail
applies to a whole array which is currently active.

Signed-off-by: mulhern <amulhern@redhat.com>
Refactor mdraid tests.

Also, add some mddetail test cases and extend tests for mdremove and mdadd.

Signed-off-by: mulhern <amulhern@redhat.com>
Split mdadd into separate functions.

Incremental mode is really considerably different from add mode.

For one thing, it may cause the array to be started if it was not already,
based on the number of devices in the array and the number that ought
to be in the array.

Signed-off-by: mulhern <amulhern@redhat.com>
Break once metadata value is found.

Signed-off-by: mulhern <amulhern@redhat.com>
Fix mdnominate error message.

Signed-off-by: mulhern <amulhern@redhat.com>
Use long messages for unittest errors.
Still attempt to destroy even if remove failed.
Add a test for mddetail on containers.

Signed-off-by: mulhern <amulhern@redhat.com>
Add a test for activation.
Canonicalize MD_UUID* values in udev.py (#1147087)

Resolves: fed#1147087

Sometimes, MD_UUID* are obtained, not from mdraid methods, but
from udev methods. Since these did not pass through the mdraid methods,
they are not canonicalized, leading to uncanonicalized forms being used for
lookup. Now, they are canonicalized on lookup in blivet.util.py. Since
the canonicalize_UUID method is shared, it is moved up into blivet.utils.py.

Signed-off-by: mulhern <amulhern@redhat.com>