summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--RELEASE_NOTES.md12
-rwxr-xr-xbin/ohai2
-rw-r--r--lib/ohai/mixin/dmi_decode.rb2
-rw-r--r--lib/ohai/plugins/aix/memory.rb6
-rw-r--r--lib/ohai/plugins/c.rb4
-rw-r--r--lib/ohai/plugins/filesystem.rb8
-rw-r--r--lib/ohai/plugins/hostname.rb20
-rw-r--r--lib/ohai/plugins/vmware.rb2
-rw-r--r--lib/ohai/plugins/windows/network.rb2
-rw-r--r--lib/ohai/plugins/windows/platform.rb2
-rw-r--r--tasks/spellcheck.rb20
11 files changed, 46 insertions, 34 deletions
diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md
index e05fac21..5dfe416d 100644
--- a/RELEASE_NOTES.md
+++ b/RELEASE_NOTES.md
@@ -3,13 +3,13 @@
## filesystem2 Ohai Data on Windows
-Ohai 15.6 includes new `node['filesystem2']` data on Windows hosts. Filesystem2 presents filesystem data by both mountpoint and by device name. This data structure matches that of the filesystem plugin on Linux and other *nix operating systems. Thanks [@jaymzh](https://github.com/jaymzh) for this new data structure.
+Ohai 15.6 includes new `node['filesystem2']` data on Windows hosts. Filesystem2 presents filesystem data by both mount point and by device name. This data structure matches that of the filesystem plugin on Linux and other *nix operating systems. Thanks [@jaymzh](https://github.com/jaymzh) for this new data structure.
# Ohai Release Notes 15.3
## Passwd Is Once Again Optional
-The Passwd plugin, which provides information on all users and groups on a node, was intented to be made optional with the release of Ohai/Chef 14.0. However, due to the way data was used in the OpenStack plugin, the Passwd plugin was never actually disabled. The Passwd plugin has been historically problematic for users with nodes that are connected to LDAP or Active Directory. Due to this we've chosen to fix our OpenStack bug and once again disable the Passwd plugin. If you relied on the data in node['etc'] you'll need to set the `optional_plugins` configuration value in your `client.rb` config.
+The Passwd plugin, which provides information on all users and groups on a node, was intended to be made optional with the release of Ohai/Chef 14.0. However, due to the way data was used in the OpenStack plugin, the Passwd plugin was never actually disabled. The Passwd plugin has been historically problematic for users with nodes that are connected to LDAP or Active Directory. Due to this we've chosen to fix our OpenStack bug and once again disable the Passwd plugin. If you relied on the data in node['etc'] you'll need to set the `optional_plugins` configuration value in your `client.rb` config.
Example segment of client.rb
@@ -50,7 +50,7 @@ The Virtualbox plugin now gathers a large amount of data on Virtualbox hosts. Ad
### Improved Linux Platform / Platform Family Detection
-Platform and platform_family detection on Linux has been rewritten to utilize the latest config files on modern Linux distributions before falling back to slower and fragile legacy detection methods. Ohai will now begin by parsing the contents of /etc/os-release for OS information if available. This improves the reliability of detection on modern distros and allows detection of new distros as they're released.
+Platform and platform_family detection on Linux has been rewritten to utilize the latest config files on modern Linux distributions before falling back to slower and fragile legacy detection methods. Ohai will now begin by parsing the contents of /etc/os-release for OS information if available. This improves the reliability of detection on modern distributions and allows detection of new distributions as they're released.
With this change we now detect `sles_sap` as a member of the `suse` platform_family. Additionally this change corrects our detection of the platform_version on Cisco Nexus switches where we previously incorrectly appended the build number to the version string.
@@ -129,11 +129,11 @@ BSD-based systems can now detect guests running on KVM and Amazon's hypervisor w
## Filesystem Plugin on AIX and Solaris
-AIX and Solaris now ship with a filesystem2 plugin that updates the filesystem data to match that of Linux, macOS, amd BSD hosts. This new data structure makes accessing filesystem data in recipes easier and especially improves the layout and depth of data on ZFS filesystems. In Chef 15 (April 2019) we will begin wrting this same format of data to the existing `node['filesystem']` namespace. In Chef 16 (April 2020) we will remove the `node['filesystem2']` namespace, completing the transition to the new format. Thank you @jaymzh for continuing the updates to our filesystem plugins with this change.
+AIX and Solaris now ship with a filesystem2 plugin that updates the filesystem data to match that of Linux, macOS, amd BSD hosts. This new data structure makes accessing filesystem data in recipes easier and especially improves the layout and depth of data on ZFS filesystems. In Chef 15 (April 2019) we will begin writing this same format of data to the existing `node['filesystem']` namespace. In Chef 16 (April 2020) we will remove the `node['filesystem2']` namespace, completing the transition to the new format. Thank you @jaymzh for continuing the updates to our filesystem plugins with this change.
## macOS Improvements
-The system_profile plugin has been improved to skip over uncessary data, which reduces macOS node sizes on the Chef Server. Additionally the CPU plugin has been updated to limit what sysctl values it polls, which prevents hanging on some system configurations.
+The system_profile plugin has been improved to skip over unnecessary data, which reduces macOS node sizes on the Chef Server. Additionally the CPU plugin has been updated to limit what sysctl values it polls, which prevents hanging on some system configurations.
## SLES 15 Detection
@@ -347,7 +347,7 @@ Sample data now available under azure:
"metadata": {
"compute": {
"location": "westus",
- "name": "timtest",
+ "name": "tim_test",
"offer": "UbuntuServer",
"osType": "Linux",
"platformFaultDomain": "0",
diff --git a/bin/ohai b/bin/ohai
index d8e1cc89..840505fe 100755
--- a/bin/ohai
+++ b/bin/ohai
@@ -1,7 +1,5 @@
#!/usr/bin/env ruby
#
-# ./ohai - I'm in ur serverz, showin you the daters
-#
# Author:: Adam Jacob (<adam@chef.io>)
# Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
# License:: Apache License, Version 2.0
diff --git a/lib/ohai/mixin/dmi_decode.rb b/lib/ohai/mixin/dmi_decode.rb
index ce6924eb..aa5b2a89 100644
--- a/lib/ohai/mixin/dmi_decode.rb
+++ b/lib/ohai/mixin/dmi_decode.rb
@@ -40,7 +40,7 @@ module ::Ohai::Mixin::DmiDecode
case product
when /VirtualBox/
return "vbox"
- when /OpenStack/ # yes this is here twice. Product catches Redhat's version
+ when /OpenStack/ # yes this is here twice. Product catches Red Hat's version
return "openstack"
when /(KVM|RHEV)/
return "kvm"
diff --git a/lib/ohai/plugins/aix/memory.rb b/lib/ohai/plugins/aix/memory.rb
index 1b57d859..ed6fe975 100644
--- a/lib/ohai/plugins/aix/memory.rb
+++ b/lib/ohai/plugins/aix/memory.rb
@@ -29,8 +29,8 @@ Ohai.plugin(:Memory) do
memory[:total] = "#{total_in_mb.to_i * 1024}kB"
memory[:free] = "#{free_in_mb.to_i * 1024}kB"
- swapinfo = shell_out("swap -s").stdout.split # returns swap info in 4K blocks
- memory[:swap]["total"] = "#{(swapinfo[2].to_i) * 4}kB"
- memory[:swap]["free"] = "#{(swapinfo[10].to_i) * 4}kB"
+ swap_info = shell_out("swap -s").stdout.split # returns swap info in 4K blocks
+ memory[:swap]["total"] = "#{(swap_info[2].to_i) * 4}kB"
+ memory[:swap]["free"] = "#{(swap_info[10].to_i) * 4}kB"
end
end
diff --git a/lib/ohai/plugins/c.rb b/lib/ohai/plugins/c.rb
index 690e101c..e3eee7d7 100644
--- a/lib/ohai/plugins/c.rb
+++ b/lib/ohai/plugins/c.rb
@@ -137,7 +137,7 @@ Ohai.plugin(:C) do
logger.trace("Plugin C: 'xlc' binary could not be found. Skipping data.")
end
- def collect_sunpro
+ def collect_sun_pro
# sun pro
collect("cc -V -flags") do |so|
output = so.stderr.split
@@ -173,7 +173,7 @@ Ohai.plugin(:C) do
@c = Mash.new
collect_gcc
collect_glibc
- collect_sunpro
+ collect_sun_pro
languages[:c] = @c unless @c.empty?
end
end
diff --git a/lib/ohai/plugins/filesystem.rb b/lib/ohai/plugins/filesystem.rb
index ab3f8f99..77b77bad 100644
--- a/lib/ohai/plugins/filesystem.rb
+++ b/lib/ohai/plugins/filesystem.rb
@@ -590,16 +590,16 @@ Ohai.plugin(:Filesystem) do
end
end
- zfs.each do |fsname, attributes|
+ zfs.each do |fs_name, attributes|
mountpoint = attributes[:mountpoint][:value] if attributes[:mountpoint]
- key = "#{fsname},#{mountpoint}"
+ key = "#{fs_name},#{mountpoint}"
fs[key] ||= Mash.new
fs[key][:fs_type] = "zfs"
fs[key][:mount] = mountpoint if mountpoint
- fs[key][:device] = fsname
+ fs[key][:device] = fs_name
fs[key][:zfs_properties] = attributes
# find all zfs parents
- parents = fsname.split("/")
+ parents = fs_name.split("/")
zfs_parents = []
(0..parents.length - 1).to_a.each do |parent_index|
next_parent = parents[0..parent_index].join("/")
diff --git a/lib/ohai/plugins/hostname.rb b/lib/ohai/plugins/hostname.rb
index f68f95c9..f4f95054 100644
--- a/lib/ohai/plugins/hostname.rb
+++ b/lib/ohai/plugins/hostname.rb
@@ -99,19 +99,19 @@ Ohai.plugin(:Hostname) do
hostname from_cmd("hostname -s")
machinename from_cmd("hostname")
begin
- ourfqdn = resolve_fqdn
+ our_fqdn = resolve_fqdn
# Sometimes... very rarely, but sometimes, 'hostname --fqdn' falsely
# returns a blank string. WTF.
- if ourfqdn.nil? || ourfqdn.empty?
+ if our_fqdn.nil? || our_fqdn.empty?
logger.trace("Plugin Hostname: hostname returned an empty string, retrying once.")
- ourfqdn = resolve_fqdn
+ our_fqdn = resolve_fqdn
end
- if ourfqdn.nil? || ourfqdn.empty?
+ if our_fqdn.nil? || our_fqdn.empty?
logger.trace("Plugin Hostname: hostname returned an empty string twice and will" +
"not be set.")
else
- fqdn ourfqdn
+ fqdn our_fqdn
end
rescue
logger.trace(
@@ -132,20 +132,20 @@ Ohai.plugin(:Hostname) do
hostname from_cmd("hostname -s")
machinename from_cmd("hostname")
begin
- ourfqdn = from_cmd("hostname --fqdn")
+ our_fqdn = from_cmd("hostname --fqdn")
# Sometimes... very rarely, but sometimes, 'hostname --fqdn' falsely
# returns a blank string. WTF.
- if ourfqdn.nil? || ourfqdn.empty?
+ if our_fqdn.nil? || our_fqdn.empty?
logger.trace("Plugin Hostname: hostname --fqdn returned an empty string, retrying " +
"once.")
- ourfqdn = from_cmd("hostname --fqdn")
+ our_fqdn = from_cmd("hostname --fqdn")
end
- if ourfqdn.nil? || ourfqdn.empty?
+ if our_fqdn.nil? || our_fqdn.empty?
logger.trace("Plugin Hostname: hostname --fqdn returned an empty string twice and " +
"will not be set.")
else
- fqdn ourfqdn
+ fqdn our_fqdn
end
rescue
logger.trace("Plugin Hostname: hostname --fqdn returned an error, probably no domain set")
diff --git a/lib/ohai/plugins/vmware.rb b/lib/ohai/plugins/vmware.rb
index d5663700..e0e6aa0c 100644
--- a/lib/ohai/plugins/vmware.rb
+++ b/lib/ohai/plugins/vmware.rb
@@ -56,7 +56,7 @@ Ohai.plugin(:VMware) do
end
end
# vmware-toolbox-cmd <param> status commands
- # Iterate through each parameter supported by the "vwware-toolbox-cmd status" command, assign value
+ # Iterate through each parameter supported by the "vmware-toolbox-cmd status" command, assign value
# to attribute "vmware[:<parameter>]"
%w{upgrade timesync}.each do |param|
vmware[param] = from_cmd("#{vmtools_path} #{param} status")
diff --git a/lib/ohai/plugins/windows/network.rb b/lib/ohai/plugins/windows/network.rb
index 84802e60..d44d6079 100644
--- a/lib/ohai/plugins/windows/network.rb
+++ b/lib/ohai/plugins/windows/network.rb
@@ -93,7 +93,7 @@ Ohai.plugin(:Network) do
# Selects default interface and returns its information
#
- # @note Interface with least metric value should be prefered as default_route
+ # @note Interface with least metric value should be preferred as default_route
#
# @param configuration [Mash] Configuration of interfaces as iface_config
# [<interface_index> => {<interface_configurations>}]
diff --git a/lib/ohai/plugins/windows/platform.rb b/lib/ohai/plugins/windows/platform.rb
index ecdcb777..0d1fa27a 100644
--- a/lib/ohai/plugins/windows/platform.rb
+++ b/lib/ohai/plugins/windows/platform.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-# After long discussion in IRC the "powers that be" have come to a concensus
+# After long discussion in IRC the "powers that be" have come to a consensus
# that there is no other Windows platforms exist that were not based on the
# Windows_NT kernel, so we herby decree that "windows" will refer to all
# platforms built upon the Windows_NT kernel and have access to win32 or win64
diff --git a/tasks/spellcheck.rb b/tasks/spellcheck.rb
index 002518d9..076173fa 100644
--- a/tasks/spellcheck.rb
+++ b/tasks/spellcheck.rb
@@ -17,17 +17,31 @@
namespace :spellcheck do
task :fetch_common do
- sh "wget https://raw.githubusercontent.com/chef/chef_dictionary/master/chef.txt -O chef_dictionary.txt"
+ sh "wget -q https://raw.githubusercontent.com/chef/chef_dictionary/master/chef.txt -O chef_dictionary.txt"
end
- task run: :fetch_common do
+ task run: %i{config_check fetch_common} do
sh 'cspell "**/*"'
end
desc "List the unique unrecognized words in the project."
- task unknown_words: :fetch_common do
+ task unknown_words: %i{config_check fetch_common} do
sh 'cspell "**/*" --wordsOnly --no-summary | sort | uniq'
end
+
+ task :config_check do
+ require "json"
+
+ config_file = "cspell.json"
+
+ unless File.readable?(config_file)
+ abort "Spellcheck config file '#{config_file}' not found, skipping spellcheck"
+ end
+
+ unless (JSON.parse(File.read(config_file)) rescue false)
+ abort "Failed to parse config file '#{config_file}', skipping spellcheck"
+ end
+ end
end
desc "Run spellcheck on the project."