summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2020-10-30 16:43:27 -0700
committerGitHub <noreply@github.com>2020-10-30 16:43:27 -0700
commit9fc84b6b6119938004d3806afd4bc29dd9462d95 (patch)
tree8979f54237f581bae01e624ed0e406757ec60968
parent8e01d0ccec1d40a817c380e71871b17ce0695edc (diff)
parent4e7cf7045714da141d2d35efe2b508ed7479c269 (diff)
downloadohai-9fc84b6b6119938004d3806afd4bc29dd9462d95.tar.gz
Merge branch 'master' into frozen_strings_v2
-rw-r--r--CHANGELOG.md8
-rw-r--r--VERSION2
-rw-r--r--lib/ohai/plugins/aix/uptime.rb4
-rw-r--r--lib/ohai/plugins/solaris2/virtualization.rb2
-rw-r--r--lib/ohai/plugins/zpools.rb2
-rw-r--r--lib/ohai/version.rb2
-rw-r--r--spec/unit/plugins/zpools_spec.rb22
7 files changed, 22 insertions, 20 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0224ee5e..42656c1a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,16 +1,18 @@
# Change Log
-<!-- latest_release 16.7.6 -->
-## [v16.7.6](https://github.com/chef/ohai/tree/v16.7.6) (2020-10-30)
+<!-- latest_release 16.7.8 -->
+## [v16.7.8](https://github.com/chef/ohai/tree/v16.7.8) (2020-10-30)
#### Merged Pull Requests
-- Gather zpool disks even if zpools uses disk labels/guids [#1547](https://github.com/chef/ohai/pull/1547) ([tas50](https://github.com/tas50))
+- Properly detect NVME/XVD devices in ZFS zpools [#1549](https://github.com/chef/ohai/pull/1549) ([tas50](https://github.com/tas50))
<!-- latest_release -->
<!-- release_rollup since=16.6.5 -->
### Changes not yet released to rubygems.org
#### Merged Pull Requests
+- Properly detect NVME/XVD devices in ZFS zpools [#1549](https://github.com/chef/ohai/pull/1549) ([tas50](https://github.com/tas50)) <!-- 16.7.8 -->
+- Split on strings intead of regex for 3x speedup [#1550](https://github.com/chef/ohai/pull/1550) ([tas50](https://github.com/tas50)) <!-- 16.7.7 -->
- Gather zpool disks even if zpools uses disk labels/guids [#1547](https://github.com/chef/ohai/pull/1547) ([tas50](https://github.com/tas50)) <!-- 16.7.6 -->
- Simplify regexes by removing extra character classes [#1548](https://github.com/chef/ohai/pull/1548) ([tas50](https://github.com/tas50)) <!-- 16.7.5 -->
- Properly detect OpenIndiana and its version numbers [#1545](https://github.com/chef/ohai/pull/1545) ([tas50](https://github.com/tas50)) <!-- 16.7.4 -->
diff --git a/VERSION b/VERSION
index 5f940b37..ae6b01d4 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-16.7.6 \ No newline at end of file
+16.7.8 \ No newline at end of file
diff --git a/lib/ohai/plugins/aix/uptime.rb b/lib/ohai/plugins/aix/uptime.rb
index a341d0c3..a273465f 100644
--- a/lib/ohai/plugins/aix/uptime.rb
+++ b/lib/ohai/plugins/aix/uptime.rb
@@ -41,9 +41,9 @@ Ohai.plugin(:Uptime) do
when /^\d+-\d/
(d, h, m, s) = so.split(/[-:]/)
when /^\d+:\d+:\d/
- (h, m, s) = so.split(/:/)
+ (h, m, s) = so.split(":")
else
- (m, s) = so.split(/:/)
+ (m, s) = so.split(":")
end
elapsed_seconds = ((d.to_i * 86400) + (h.to_i * 3600) + (m.to_i * 60) + s.to_i)
diff --git a/lib/ohai/plugins/solaris2/virtualization.rb b/lib/ohai/plugins/solaris2/virtualization.rb
index 18e0911e..6a7fc2ec 100644
--- a/lib/ohai/plugins/solaris2/virtualization.rb
+++ b/lib/ohai/plugins/solaris2/virtualization.rb
@@ -56,7 +56,7 @@ Ohai.plugin(:Virtualization) do
if File.executable?("/usr/sbin/zoneadm")
zones = Mash.new
shell_out("zoneadm list -pc").stdout.lines do |line|
- info = line.chomp.split(/:/)
+ info = line.chomp.split(":")
zones[info[1]] = {
"id" => info[0],
"state" => info[2],
diff --git a/lib/ohai/plugins/zpools.rb b/lib/ohai/plugins/zpools.rb
index bcf7574b..bd6ced99 100644
--- a/lib/ohai/plugins/zpools.rb
+++ b/lib/ohai/plugins/zpools.rb
@@ -77,7 +77,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)[-_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/lib/ohai/version.rb b/lib/ohai/version.rb
index 022880b9..4c57dc15 100644
--- a/lib/ohai/version.rb
+++ b/lib/ohai/version.rb
@@ -19,5 +19,5 @@
module Ohai
OHAI_ROOT = File.expand_path(__dir__)
- VERSION = "16.7.6"
+ VERSION = "16.7.8"
end
diff --git a/spec/unit/plugins/zpools_spec.rb b/spec/unit/plugins/zpools_spec.rb
index 931689b7..0ed6c343 100644
--- a/spec/unit/plugins/zpools_spec.rb
+++ b/spec/unit/plugins/zpools_spec.rb
@@ -36,12 +36,12 @@ describe Ohai::System, "zpools plugin" do
sdg ONLINE 0 0 0
sdh ONLINE 0 0 0
raidz2-1 ONLINE 0 0 0
- sdi ONLINE 0 0 0
- sdj ONLINE 0 0 0
- sdk ONLINE 0 0 0
- sdl ONLINE 0 0 0
- sdm ONLINE 0 0 0
- sdn ONLINE 0 0 0
+ nvme0n1 ONLINE 0 0 0
+ nvme1n1 ONLINE 0 0 0
+ nvme2n1 ONLINE 0 0 0
+ nvme3n1 ONLINE 0 0 0
+ nvme4n1 ONLINE 0 0 0
+ nvme5n1 ONLINE 0 0 0
EOST
end
let(:zpool_out) do
@@ -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
@@ -117,10 +117,10 @@ describe Ohai::System, "zpools plugin" do
expect(plugin[:zpools][:tank][:health]).to match("ONLINE")
end
- it "Has the correct number of devices" do
+ it "Has the correct devices per zpool" do
plugin.run
- expect(plugin[:zpools][:rpool][:devices].keys.size).to match(2)
- expect(plugin[:zpools][:tank][:devices].keys.size).to match(12)
+ 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
it "Won't have a version number" do