From 2b69a518ed7853fa5b52c95b09bcf47d09144193 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Mon, 30 Nov 2015 17:18:11 +0000 Subject: [PATCH] Report correct size for directly connected diaks --- cookbooks/hardware/templates/default/ohai.rb.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cookbooks/hardware/templates/default/ohai.rb.erb b/cookbooks/hardware/templates/default/ohai.rb.erb index 1b08dbfc6..6a09804ab 100644 --- a/cookbooks/hardware/templates/default/ohai.rb.erb +++ b/cookbooks/hardware/templates/default/ohai.rb.erb @@ -150,7 +150,7 @@ Ohai.plugin(:Hardware) do block = Dir.glob("#{device}/block/*").first vendor = read_sysctl_file("#{device}/vendor") model = read_sysctl_file("#{device}/model") - size = read_sysctl_file("#{block}/size").to_i * 512 + size = read_sysctl_file("#{block}/size").to_f / 2 if vendor == "ATA" && model =~ /^(\S+)\s+(.*)$/ vendor = Regexp.last_match(1) -- 2.39.5