cluster-validation
cluster-validation copied to clipboard
fixing issue with fdisk GPT message
In function find_unused_disks() there is a potential bug. In some situation message from the fdisk about GPT support is delayed:
WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion.
This affecting possibility to do awk on the specific disks
following code:
fdisks=$(fdisk -l |& awk '/^Disk .* bytes/{print $2}' |sort)
can be replaced with
(fdisk -l 2>/dev/null | awk '/^Disk .* bytes/{print $2}' |sort)
Redirecting standard error out of the awk command is the right thing to do. We need to probably process STDERR in the long run, but at least this prevents it from creating other failures.