Make docstring more precise.

Signed-off-by: mulhern <amulhern@redhat.com>
Remove commented out import.

Signed-off-by: mulhern <amulhern@redhat.com>
Use super() instead of explicit parent name

Signed-off-by: mulhern <amulhern@redhat.com>
Generalize the error message for the array level

Signed-off-by: mulhern <amulhern@redhat.com>
Remove all references to mdMinor in current code base.

It seems to have become obsolete a while ago and it does not
seem to be a value that can be obtained from mdexamine.

Signed-off-by: mulhern <amulhern@redhat.com>
Remove DeviceFormat.probe() method

These functions haven't been changed since the split from anaconda and they
weren't in use then.
I expect that their use was replace by udev/pyudev, etc.
MDRaidMember.probe() would raise a KeyError if it were ever run,
since mdexamine() result has no 'uuid' value.

Signed-off-by: mulhern <amulhern@redhat.com>
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>