diff options
author | Tim Smith <tsmith84@gmail.com> | 2020-10-29 15:03:27 -0700 |
---|---|---|
committer | Tim Smith <tsmith84@gmail.com> | 2020-10-29 15:10:21 -0700 |
commit | 3bc62dd32defaa16ded539cbf4365f83c7323b6a (patch) | |
tree | 8abe64e3e9b708fefd216756a0a165bd42773404 /lib/ohai/plugins/zpools.rb | |
parent | 7b700df35ec1d884ac6507016bf2319d70dffa36 (diff) | |
download | ohai-3bc62dd32defaa16ded539cbf4365f83c7323b6a.tar.gz |
Gather zpool disks even if we use labels/guidsmore_zpool
We were expecting the disk name for each device in the pool, but it's
actually better to add them by disk id or guid. That entirely breaks out
regex so use -L on linux to make sure we get the underlying disk.
Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'lib/ohai/plugins/zpools.rb')
-rw-r--r-- | lib/ohai/plugins/zpools.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/ohai/plugins/zpools.rb b/lib/ohai/plugins/zpools.rb index 0bf40a73..e27bf610 100644 --- a/lib/ohai/plugins/zpools.rb +++ b/lib/ohai/plugins/zpools.rb @@ -65,7 +65,9 @@ Ohai.plugin(:Zpools) do if platform_family == "solaris2" command = "su adm -c \"zpool status #{pool}\"" else - command = "zpool status #{pool}" + # -L is used to give us real device names not label or uuid + # for example sda instead of ata-WDC_WD60EZAZ-00SF3B0_WD-WX32D203UXYK + command = "zpool status #{pool} -L" end so = shell_out(command) |