summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2020-10-30 14:05:16 -0700
committerTim Smith <tsmith84@gmail.com>2020-10-30 14:05:16 -0700
commit011804b6af9da3b40f0d782e64c00eafd5bb2339 (patch)
tree5a92b29c45a1dfc01c3dc9788e6b1253961ba78f
parent6e3c3ccd228feb8249be9f6cd338e7f23dd98b99 (diff)
downloadohai-011804b6af9da3b40f0d782e64c00eafd5bb2339.tar.gz
Detect XVD disks as well
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--lib/ohai/plugins/zpools.rb2
-rw-r--r--spec/unit/plugins/zpools_spec.rb6
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/ohai/plugins/zpools.rb b/lib/ohai/plugins/zpools.rb
index e0a1a99b..033a0dbc 100644
--- a/lib/ohai/plugins/zpools.rb
+++ b/lib/ohai/plugins/zpools.rb
@@ -76,7 +76,7 @@ Ohai.plugin(:Zpools) do
# linux: http://rubular.com/r/J3wQC6E2lH
# solaris: http://rubular.com/r/FqOBzUQQ4p
# freebsd: http://rubular.com/r/RYkMNlytXl
- when /^\s+((sd|c|ad|da|nvme)[-_a-zA-Z0-9]+)\s+([-_a-zA-Z0-9]+)\s+(\d+)\s+(\d+)\s+(\d+)$/
+ when /^\s+((sd|c|ad|da|nvme|xvd)[-_a-zA-Z0-9]+)\s+([-_a-zA-Z0-9]+)\s+(\d+)\s+(\d+)\s+(\d+)$/
logger.trace("Plugin Zpools: Parsing zpool status line: #{line.chomp}")
pools[pool][:devices][$1] = Mash.new
pools[pool][:devices][$1][:state] = $3
diff --git a/spec/unit/plugins/zpools_spec.rb b/spec/unit/plugins/zpools_spec.rb
index 511e6c1a..0ed6c343 100644
--- a/spec/unit/plugins/zpools_spec.rb
+++ b/spec/unit/plugins/zpools_spec.rb
@@ -60,8 +60,8 @@ describe Ohai::System, "zpools plugin" do
NAME STATE READ WRITE CKSUM
rpool ONLINE 0 0 0
mirror-0 ONLINE 0 0 0
- sda ONLINE 0 0 0
- sdb ONLINE 0 0 0
+ xvda ONLINE 0 0 0
+ xvdb ONLINE 0 0 0
errors: No known data errors
EOSR
@@ -119,7 +119,7 @@ describe Ohai::System, "zpools plugin" do
it "Has the correct devices per zpool" do
plugin.run
- expect(plugin[:zpools][:rpool][:devices].keys).to match(%w{sda sdb})
+ expect(plugin[:zpools][:rpool][:devices].keys).to match(%w{xvda xvdb})
expect(plugin[:zpools][:tank][:devices].keys).to match(%w{sdc sdd sde sdf sdg sdh nvme0n1 nvme1n1 nvme2n1 nvme3n1 nvme4n1 nvme5n1})
end