The test gave the same path twice and piped prepare into grep, so it
passed without the "return 1" and never went through a symlink. Give the
fast device as a symlink to the data disk and fail on a zero exit.
prepare resolves symlinks in the device list, so a skipped disk was
listed by its real device name rather than by the path the caller
gave, like /dev/disk/by-id/*. List it by the path as given, so the
caller can match the skipped disks to its arguments.
A prepare that skips every disk, for example because they are already
partitioned, has nothing to do rather than failing. Exit with 0 then;
the skipped disks are listed in the JSON output. An OSD that fails to
initialize still makes prepare exit with 1.
With --dry-run --json and no suitable disk, prepare printed the JSON of
a real run instead of {"devices": []}. Also test the JSON output and
the exit code when no disk is suitable.
prepare with a device list exited with 0 when every disk was skipped,
for example as already partitioned, although no OSD was created, and
the JSON output didn't mention the skipped disks.
Exit with 1 when no OSD is created, and list each skipped disk with the
reason in "skipped" of the JSON output. A disk skipped while OSDs are
created on other disks still gives exit code 0.
prepare with a device list ignored the result of prepare_one() and
always exited with 0, even when none of the OSDs was initialized. The
failure was only visible in stderr and in "errors" of the JSON output.
Keep initializing the remaining OSDs, but exit with 1 if any of them
failed.