cluster-validation icon indicating copy to clipboard operation
cluster-validation copied to clipboard

fixing issue with fdisk GPT message

Open jgronowski opened this issue 4 years ago • 1 comments

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)

jgronowski avatar May 19 '20 07:05 jgronowski

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.

edwbuck avatar Jan 22 '21 23:01 edwbuck