diff options
-rw-r--r-- | lib/ohai/plugins/zpools.rb | 4 | ||||
-rw-r--r-- | spec/unit/plugins/zpools_spec.rb | 4 |
2 files changed, 5 insertions, 3 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) diff --git a/spec/unit/plugins/zpools_spec.rb b/spec/unit/plugins/zpools_spec.rb index 5ed5a559..931689b7 100644 --- a/spec/unit/plugins/zpools_spec.rb +++ b/spec/unit/plugins/zpools_spec.rb @@ -71,8 +71,8 @@ describe Ohai::System, "zpools plugin" do allow(plugin).to receive(:platform_family).and_return("rhel") allow(plugin).to receive(:collect_os).and_return(:linux) allow(plugin).to receive(:shell_out).with("zpool list -H -o name,size,alloc,free,cap,dedup,health,version").and_return(mock_shell_out(0, zpool_out, "")) - allow(plugin).to receive(:shell_out).with("zpool status rpool").and_return(mock_shell_out(0, zpool_status_rpool, "")) - allow(plugin).to receive(:shell_out).with("zpool status tank").and_return(mock_shell_out(0, zpool_status_tank, "")) + allow(plugin).to receive(:shell_out).with("zpool status rpool -L").and_return(mock_shell_out(0, zpool_status_rpool, "")) + allow(plugin).to receive(:shell_out).with("zpool status tank -L").and_return(mock_shell_out(0, zpool_status_tank, "")) end it "Has entries for both zpools" do |