-
Notifications
You must be signed in to change notification settings - Fork 449
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #998 from chef/backports
Additional backports + Release 8.24.0
- Loading branch information
Showing
8 changed files
with
35 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
# | ||
# Author:: Tim Smith <[email protected]> | ||
# Author:: Phil Dibowitz <[email protected]> | ||
# Copyright:: Copyright (c) 2013-2014, Limelight Networks, Inc. | ||
# Copyright:: Copyright (c) 2017 Facebook, Inc. | ||
# Plugin:: mdadm | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
|
@@ -52,22 +54,27 @@ def create_raid_device_mash(stdout) | |
collect_data(:linux) do | ||
# gather a list of all raid arrays | ||
if File.exist?("/proc/mdstat") | ||
devices = [] | ||
devices = {} | ||
File.open("/proc/mdstat").each do |line| | ||
devices << Regexp.last_match[1] if line =~ /(md[0-9]+)/ | ||
if line =~ /(md[0-9]+)/ | ||
device = Regexp.last_match[1] | ||
pieces = line.split(/\s+/) | ||
devices[device] = pieces[4..-1].map { |s| s.match(/(.+)\[\d\]/)[1] } | ||
end | ||
end | ||
|
||
# create the mdadm mash and gather individual information if devices are present | ||
unless devices.empty? | ||
mdadm Mash.new | ||
devices.sort.each do |device| | ||
devices.keys.sort.each do |device| | ||
mdadm[device] = Mash.new | ||
|
||
# gather detailed information on the array | ||
so = shell_out("mdadm --detail /dev/#{device}") | ||
|
||
# if the mdadm command was sucessful pass so.stdout to create_raid_device_mash to grab the tidbits we want | ||
mdadm[device] = create_raid_device_mash(so.stdout) if so.stdout | ||
mdadm[device]["members"] = devices[device] | ||
end | ||
end | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,5 +18,5 @@ | |
|
||
module Ohai | ||
OHAI_ROOT = File.expand_path(File.dirname(__FILE__)) | ||
VERSION = "8.23.0" | ||
VERSION = "8.24.0" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters