summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2019-01-24 10:40:00 -0800
committerGitHub <noreply@github.com>2019-01-24 10:40:00 -0800
commitda5b6ff4541e9dac366033737fba38645fe5e45c (patch)
treef381b79a8225a5c607709c7d292e96f805e9dd5f
parentf3a3e878e78c193ddde205d6a08f98813dabf9e0 (diff)
parent6a4f3c624090fdbd4e6b35c0a38e8b4382e7a5e3 (diff)
downloadohai-da5b6ff4541e9dac366033737fba38645fe5e45c.tar.gz
Merge pull request #1337 from chef/chefstyle
Chefstyle fixes for Chefstyle 0.12
-rw-r--r--lib/ohai/common/dmi.rb86
-rw-r--r--lib/ohai/loader.rb2
-rw-r--r--lib/ohai/mixin/softlayer_metadata.rb10
-rw-r--r--lib/ohai/plugins/aix/virtualization.rb8
-rw-r--r--lib/ohai/plugins/hostname.rb2
-rw-r--r--lib/ohai/plugins/linux/network.rb2
-rw-r--r--lib/ohai/plugins/solaris2/dmi.rb96
-rw-r--r--lib/ohai/runner.rb4
-rw-r--r--spec/functional/loader_spec.rb2
-rw-r--r--spec/functional/plugins/powershell_spec.rb2
-rw-r--r--spec/functional/plugins/windows/uptime_spec.rb2
-rw-r--r--spec/unit/hints_spec.rb2
-rw-r--r--spec/unit/loader_spec.rb18
-rw-r--r--spec/unit/plugins/aix/cpu_spec.rb6
-rw-r--r--spec/unit/plugins/aix/filesystem_spec.rb8
-rw-r--r--spec/unit/plugins/aix/network_spec.rb10
-rw-r--r--spec/unit/plugins/aix/virtualization_spec.rb2
-rw-r--r--spec/unit/plugins/bsd/filesystem_spec.rb6
-rw-r--r--spec/unit/plugins/bsd/virtualization_spec.rb4
-rw-r--r--spec/unit/plugins/darwin/cpu_spec.rb2
-rw-r--r--spec/unit/plugins/darwin/filesystem_spec.rb8
-rw-r--r--spec/unit/plugins/darwin/hardware_system_profiler_output.rb6
-rw-r--r--spec/unit/plugins/fail_spec.rb6
-rw-r--r--spec/unit/plugins/joyent_spec.rb4
-rw-r--r--spec/unit/plugins/linux/filesystem_spec.rb40
-rw-r--r--spec/unit/plugins/linux/hostnamectl_spec.rb2
-rw-r--r--spec/unit/plugins/linux/kernel_spec.rb14
-rw-r--r--spec/unit/plugins/linux/lsb_spec.rb4
-rw-r--r--spec/unit/plugins/linux/lspci_spec.rb2
-rw-r--r--spec/unit/plugins/linux/mdadm_spec.rb2
-rw-r--r--spec/unit/plugins/linux/network_spec.rb72
-rw-r--r--spec/unit/plugins/linux/platform_spec.rb14
-rw-r--r--spec/unit/plugins/linux/sessions_spec.rb2
-rw-r--r--spec/unit/plugins/linux/systemd_paths_spec.rb2
-rw-r--r--spec/unit/plugins/linux/virtualization_spec.rb20
-rw-r--r--spec/unit/plugins/mono_spec.rb2
-rw-r--r--spec/unit/plugins/openstack_spec.rb2
-rw-r--r--spec/unit/plugins/php_spec.rb10
-rw-r--r--spec/unit/plugins/powershell_spec.rb4
-rw-r--r--spec/unit/plugins/rackspace_spec.rb2
-rw-r--r--spec/unit/plugins/scsi_spec.rb2
-rw-r--r--spec/unit/plugins/solaris2/cpu_spec.rb4
-rw-r--r--spec/unit/plugins/solaris2/filesystem.rb6
-rw-r--r--spec/unit/plugins/solaris2/network_spec.rb10
-rw-r--r--spec/unit/plugins/solaris2/platform_spec.rb4
-rw-r--r--spec/unit/plugins/solaris2/virtualization_spec.rb2
-rw-r--r--spec/unit/plugins/ssh_host_keys_spec.rb4
-rw-r--r--spec/unit/plugins/sysconf_spec.rb2
-rw-r--r--spec/unit/plugins/windows/filesystem_spec.rb2
-rw-r--r--spec/unit/plugins/windows/memory_spec.rb2
-rw-r--r--spec/unit/plugins/zpools_spec.rb12
-rw-r--r--spec/unit/system_spec.rb18
52 files changed, 280 insertions, 280 deletions
diff --git a/lib/ohai/common/dmi.rb b/lib/ohai/common/dmi.rb
index 14d2682d..1c9a80af 100644
--- a/lib/ohai/common/dmi.rb
+++ b/lib/ohai/common/dmi.rb
@@ -25,49 +25,49 @@ module Ohai
# 128-255 are 'oem_data_[id]'
# Everything else is 'unknown'
ID_TO_DESCRIPTION = {
- 0 => "bios",
- 1 => "system",
- 2 => "base_board",
- 3 => "chassis",
- 4 => "processor",
- 5 => "memory_controller",
- 6 => "memory_module",
- 7 => "cache",
- 8 => "port_connector",
- 9 => "system_slots",
- 10 => "on_board_devices",
- 11 => "oem_strings",
- 12 => "system_configuration_options",
- 13 => "bios_language",
- 14 => "group_associations",
- 15 => "system_event_log",
- 16 => "physical_memory_array",
- 17 => "memory_device",
- 18 => "32_bit_memory_error",
- 19 => "memory_array_mapped_address",
- 20 => "memory_device_mapped_address",
- 21 => "built_in_pointing_device",
- 22 => "portable_battery",
- 23 => "system_reset",
- 24 => "hardware_security",
- 25 => "system_power_controls",
- 26 => "voltage_probe",
- 27 => "cooling_device",
- 28 => "temperature_probe",
- 29 => "electrical_current_probe",
- 30 => "out_of_band_remote_access",
- 31 => "boot_integrity_services",
- 32 => "system_boot",
- 33 => "64_bit_memory_error",
- 34 => "management_device",
- 35 => "management_device_component",
- 36 => "management_device_threshold_data",
- 37 => "memory_channel",
- 38 => "ipmi_device",
- 39 => "power_supply",
- 40 => "additional_information",
- 41 => "onboard_devices_extended_information",
- 42 => "management_controller_host_interfaces",
+ 0 => "bios",
+ 1 => "system",
+ 2 => "base_board",
+ 3 => "chassis",
+ 4 => "processor",
+ 5 => "memory_controller",
+ 6 => "memory_module",
+ 7 => "cache",
+ 8 => "port_connector",
+ 9 => "system_slots",
+ 10 => "on_board_devices",
+ 11 => "oem_strings",
+ 12 => "system_configuration_options",
+ 13 => "bios_language",
+ 14 => "group_associations",
+ 15 => "system_event_log",
+ 16 => "physical_memory_array",
+ 17 => "memory_device",
+ 18 => "32_bit_memory_error",
+ 19 => "memory_array_mapped_address",
+ 20 => "memory_device_mapped_address",
+ 21 => "built_in_pointing_device",
+ 22 => "portable_battery",
+ 23 => "system_reset",
+ 24 => "hardware_security",
+ 25 => "system_power_controls",
+ 26 => "voltage_probe",
+ 27 => "cooling_device",
+ 28 => "temperature_probe",
+ 29 => "electrical_current_probe",
+ 30 => "out_of_band_remote_access",
+ 31 => "boot_integrity_services",
+ 32 => "system_boot",
+ 33 => "64_bit_memory_error",
+ 34 => "management_device",
+ 35 => "management_device_component",
+ 36 => "management_device_threshold_data",
+ 37 => "memory_channel",
+ 38 => "ipmi_device",
+ 39 => "power_supply",
+ 40 => "additional_information",
+ 41 => "onboard_devices_extended_information",
+ 42 => "management_controller_host_interfaces",
126 => "disabled_entries",
127 => "end_of_table_marker",
}.freeze
diff --git a/lib/ohai/loader.rb b/lib/ohai/loader.rb
index 47b228f6..663d1d4e 100644
--- a/lib/ohai/loader.rb
+++ b/lib/ohai/loader.rb
@@ -42,7 +42,7 @@ module Ohai
# @return [Array<String>]
def plugin_files_by_dir(plugin_dir = Ohai.config[:plugin_path])
Array(plugin_dir).map do |path|
- if Dir.exist?(path)
+ if Dir.exist?(path)
Ohai::Log.trace("Searching for Ohai plugins in #{path}")
escaped = ChefConfig::PathHelper.escape_glob_dir(path)
diff --git a/lib/ohai/mixin/softlayer_metadata.rb b/lib/ohai/mixin/softlayer_metadata.rb
index 2c6e686b..cc2b25f6 100644
--- a/lib/ohai/mixin/softlayer_metadata.rb
+++ b/lib/ohai/mixin/softlayer_metadata.rb
@@ -29,11 +29,11 @@ module ::Ohai::Mixin::SoftlayerMetadata
# @return [Hash]
def fetch_metadata
{
- "public_fqdn" => fetch_metadata_item("getFullyQualifiedDomainName.txt"),
- "local_ipv4" => fetch_metadata_item("getPrimaryBackendIpAddress.txt"),
- "public_ipv4" => fetch_metadata_item("getPrimaryIpAddress.txt"),
- "region" => fetch_metadata_item("getDatacenter.txt"),
- "instance_id" => fetch_metadata_item("getId.txt"),
+ "public_fqdn" => fetch_metadata_item("getFullyQualifiedDomainName.txt"),
+ "local_ipv4" => fetch_metadata_item("getPrimaryBackendIpAddress.txt"),
+ "public_ipv4" => fetch_metadata_item("getPrimaryIpAddress.txt"),
+ "region" => fetch_metadata_item("getDatacenter.txt"),
+ "instance_id" => fetch_metadata_item("getId.txt"),
}
end
diff --git a/lib/ohai/plugins/aix/virtualization.rb b/lib/ohai/plugins/aix/virtualization.rb
index d79fc252..71d8bfc6 100644
--- a/lib/ohai/plugins/aix/virtualization.rb
+++ b/lib/ohai/plugins/aix/virtualization.rb
@@ -61,8 +61,8 @@ Ohai.plugin(:Virtualization) do
splat = line.strip.split
key = splat[0].downcase
value = {
- "address" => splat[1],
- "netmask" => splat[2],
+ "address" => splat[1],
+ "netmask" => splat[2],
"broadcast" => splat[3],
}
wpars[wpar_name][title][key] = value
@@ -72,7 +72,7 @@ Ohai.plugin(:Virtualization) do
key = splat[2].downcase
value = {
"destination" => splat[0],
- "gateway" => splat[1],
+ "gateway" => splat[1],
}
wpars[wpar_name][title][key] = value
when "file systems"
@@ -81,7 +81,7 @@ Ohai.plugin(:Virtualization) do
key = splat[1].downcase
value = {
"mountpoint" => splat[0],
- "device" => splat[1],
+ "device" => splat[1],
"vfs" => splat[2],
"options" => splat[3].split(","),
}
diff --git a/lib/ohai/plugins/hostname.rb b/lib/ohai/plugins/hostname.rb
index e1e3b7cf..f333bf4a 100644
--- a/lib/ohai/plugins/hostname.rb
+++ b/lib/ohai/plugins/hostname.rb
@@ -175,7 +175,7 @@ Ohai.plugin(:Hostname) do
else
# host is not in dns. optionally use:
# C:\WINDOWS\system32\drivers\etc\hosts
- info[3..info.length].reverse.each do |addr|
+ info[3..info.length].reverse_each do |addr|
hostent = Socket.gethostbyaddr(addr)
if hostent.first =~ /.+?\.(.*)/
fqdn hostent.first
diff --git a/lib/ohai/plugins/linux/network.rb b/lib/ohai/plugins/linux/network.rb
index dcfadbf5..a0fca04d 100644
--- a/lib/ohai/plugins/linux/network.rb
+++ b/lib/ohai/plugins/linux/network.rb
@@ -491,7 +491,7 @@ Ohai.plugin(:Network) do
# Match the lead line for an interface from iproute2
# 3: eth0.11@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP
# The '@eth0:' portion doesn't exist on primary interfaces and thus is optional in the regex
- IPROUTE_INT_REGEX = /^(\d+): ([0-9a-zA-Z@:\.\-_]*?)(@[0-9a-zA-Z]+|):\s/ unless defined? IPROUTE_INT_REGEX
+ IPROUTE_INT_REGEX = /^(\d+): ([0-9a-zA-Z@:\.\-_]*?)(@[0-9a-zA-Z]+|):\s/.freeze unless defined? IPROUTE_INT_REGEX
if which("ip")
# families to get default routes from
diff --git a/lib/ohai/plugins/solaris2/dmi.rb b/lib/ohai/plugins/solaris2/dmi.rb
index f8de480c..51f5fb05 100644
--- a/lib/ohai/plugins/solaris2/dmi.rb
+++ b/lib/ohai/plugins/solaris2/dmi.rb
@@ -35,57 +35,57 @@ Ohai.plugin(:DMI) do
# this is what the *real* IDs are:
# pulled from http://src.opensolaris.org/source/xref/nwam/nwam1/usr/src/uts/common/sys/smbios.h
smb_to_id = {
- "SMB_TYPE_BIOS" => 0, # BIOS information (R)
- "SMB_TYPE_SYSTEM" => 1, # system information (R)
- "SMB_TYPE_BASEBOARD" => 2, # base board
- "SMB_TYPE_CHASSIS" => 3, # system enclosure or chassis (R)
- "SMB_TYPE_PROCESSOR" => 4, # processor (R)
- "SMB_TYPE_MEMCTL" => 5, # memory controller (O)
- "SMB_TYPE_MEMMOD" => 6, # memory module (O)
- "SMB_TYPE_CACHE" => 7, # processor cache (R)
- "SMB_TYPE_PORT" => 8, # port connector
- "SMB_TYPE_SLOT" => 9, # upgradeable system slot (R)
- "SMB_TYPE_OBDEVS" => 10, # on-board devices
- "SMB_TYPE_OEMSTR" => 11, # OEM string table
- "SMB_TYPE_SYSCONFSTR" => 12, # system configuration string table
- "SMB_TYPE_LANG" => 13, # BIOS language information
- "SMB_TYPE_GROUP" => 14, # group associations
- "SMB_TYPE_EVENTLOG" => 15, # system event log
- "SMB_TYPE_MEMARRAY" => 16, # physical memory array (R)
- "SMB_TYPE_MEMDEVICE" => 17, # memory device (R)
- "SMB_TYPE_MEMERR32" => 18, # 32-bit memory error information
- "SMB_TYPE_MEMARRAYMAP" => 19, # memory array mapped address (R)
+ "SMB_TYPE_BIOS" => 0, # BIOS information (R)
+ "SMB_TYPE_SYSTEM" => 1, # system information (R)
+ "SMB_TYPE_BASEBOARD" => 2, # base board
+ "SMB_TYPE_CHASSIS" => 3, # system enclosure or chassis (R)
+ "SMB_TYPE_PROCESSOR" => 4, # processor (R)
+ "SMB_TYPE_MEMCTL" => 5, # memory controller (O)
+ "SMB_TYPE_MEMMOD" => 6, # memory module (O)
+ "SMB_TYPE_CACHE" => 7, # processor cache (R)
+ "SMB_TYPE_PORT" => 8, # port connector
+ "SMB_TYPE_SLOT" => 9, # upgradeable system slot (R)
+ "SMB_TYPE_OBDEVS" => 10, # on-board devices
+ "SMB_TYPE_OEMSTR" => 11, # OEM string table
+ "SMB_TYPE_SYSCONFSTR" => 12, # system configuration string table
+ "SMB_TYPE_LANG" => 13, # BIOS language information
+ "SMB_TYPE_GROUP" => 14, # group associations
+ "SMB_TYPE_EVENTLOG" => 15, # system event log
+ "SMB_TYPE_MEMARRAY" => 16, # physical memory array (R)
+ "SMB_TYPE_MEMDEVICE" => 17, # memory device (R)
+ "SMB_TYPE_MEMERR32" => 18, # 32-bit memory error information
+ "SMB_TYPE_MEMARRAYMAP" => 19, # memory array mapped address (R)
"SMB_TYPE_MEMDEVICEMAP" => 20, # memory device mapped address (R)
- "SMB_TYPE_POINTDEV" => 21, # built-in pointing device
- "SMB_TYPE_BATTERY" => 22, # portable battery
- "SMB_TYPE_RESET" => 23, # system reset settings
- "SMB_TYPE_SECURITY" => 24, # hardware security settings
- "SMB_TYPE_POWERCTL" => 25, # system power controls
- "SMB_TYPE_VPROBE" => 26, # voltage probe
- "SMB_TYPE_COOLDEV" => 27, # cooling device
- "SMB_TYPE_TPROBE" => 28, # temperature probe
- "SMB_TYPE_IPROBE" => 29, # current probe
- "SMB_TYPE_OOBRA" => 30, # out-of-band remote access facility
- "SMB_TYPE_BIS" => 31, # boot integrity services
- "SMB_TYPE_BOOT" => 32, # system boot status (R)
- "SMB_TYPE_MEMERR64" => 33, # 64-bit memory error information
- "SMB_TYPE_MGMTDEV" => 34, # management device
- "SMB_TYPE_MGMTDEVCP" => 35, # management device component
- "SMB_TYPE_MGMTDEVDATA" => 36, # management device threshold data
- "SMB_TYPE_MEMCHAN" => 37, # memory channel
- "SMB_TYPE_IPMIDEV" => 38, # IPMI device information
- "SMB_TYPE_POWERSUP" => 39, # system power supply
- "SMB_TYPE_ADDINFO" => 40, # additional information
- "SMB_TYPE_OBDEVEXT" => 41, # on-board device extended info
- "SMB_TYPE_MCHI" => 42, # mgmt controller host interface
- "SMB_TYPE_INACTIVE" => 126, # inactive table entry
- "SMB_TYPE_EOT" => 127, # end of table
- "SMB_TYPE_OEM_LO" => 128, # start of OEM-specific type range
+ "SMB_TYPE_POINTDEV" => 21, # built-in pointing device
+ "SMB_TYPE_BATTERY" => 22, # portable battery
+ "SMB_TYPE_RESET" => 23, # system reset settings
+ "SMB_TYPE_SECURITY" => 24, # hardware security settings
+ "SMB_TYPE_POWERCTL" => 25, # system power controls
+ "SMB_TYPE_VPROBE" => 26, # voltage probe
+ "SMB_TYPE_COOLDEV" => 27, # cooling device
+ "SMB_TYPE_TPROBE" => 28, # temperature probe
+ "SMB_TYPE_IPROBE" => 29, # current probe
+ "SMB_TYPE_OOBRA" => 30, # out-of-band remote access facility
+ "SMB_TYPE_BIS" => 31, # boot integrity services
+ "SMB_TYPE_BOOT" => 32, # system boot status (R)
+ "SMB_TYPE_MEMERR64" => 33, # 64-bit memory error information
+ "SMB_TYPE_MGMTDEV" => 34, # management device
+ "SMB_TYPE_MGMTDEVCP" => 35, # management device component
+ "SMB_TYPE_MGMTDEVDATA" => 36, # management device threshold data
+ "SMB_TYPE_MEMCHAN" => 37, # memory channel
+ "SMB_TYPE_IPMIDEV" => 38, # IPMI device information
+ "SMB_TYPE_POWERSUP" => 39, # system power supply
+ "SMB_TYPE_ADDINFO" => 40, # additional information
+ "SMB_TYPE_OBDEVEXT" => 41, # on-board device extended info
+ "SMB_TYPE_MCHI" => 42, # mgmt controller host interface
+ "SMB_TYPE_INACTIVE" => 126, # inactive table entry
+ "SMB_TYPE_EOT" => 127, # end of table
+ "SMB_TYPE_OEM_LO" => 128, # start of OEM-specific type range
"SUN_OEM_EXT_PROCESSOR" => 132, # processor extended info
- "SUN_OEM_PCIEXRC" => 138, # PCIE RootComplex/RootPort info
- "SUN_OEM_EXT_MEMARRAY" => 144, # phys memory array extended info
+ "SUN_OEM_PCIEXRC" => 138, # PCIE RootComplex/RootPort info
+ "SUN_OEM_EXT_MEMARRAY" => 144, # phys memory array extended info
"SUN_OEM_EXT_MEMDEVICE" => 145, # memory device extended info
- "SMB_TYPE_OEM_HI" => 256, # end of OEM-specific type range
+ "SMB_TYPE_OEM_HI" => 256, # end of OEM-specific type range
}
# all output lines should fall within one of these patterns
diff --git a/lib/ohai/runner.rb b/lib/ohai/runner.rb
index 7fb84bf7..f11d936a 100644
--- a/lib/ohai/runner.rb
+++ b/lib/ohai/runner.rb
@@ -62,8 +62,8 @@ module Ohai
def run_v7_plugin(plugin)
return true if plugin.optional? &&
- !Ohai.config[:run_all_plugins] &&
- !Ohai.config[:optional_plugins].include?(plugin.name)
+ !Ohai.config[:run_all_plugins] &&
+ !Ohai.config[:optional_plugins].include?(plugin.name)
visited = [ plugin ]
until visited.empty?
diff --git a/spec/functional/loader_spec.rb b/spec/functional/loader_spec.rb
index 2b74e7b0..64024e68 100644
--- a/spec/functional/loader_spec.rb
+++ b/spec/functional/loader_spec.rb
@@ -32,7 +32,7 @@ RSpec.describe "Ohai::Loader" do
Ohai.plugin(:Foo) do
provides 'foo'
end
-EOF
+ EOF
File.open(File.join(plugin_directory, "foo.rb"), "w+") do |f|
f.write(plugin_content)
end
diff --git a/spec/functional/plugins/powershell_spec.rb b/spec/functional/plugins/powershell_spec.rb
index 38fab45d..766449c6 100644
--- a/spec/functional/plugins/powershell_spec.rb
+++ b/spec/functional/plugins/powershell_spec.rb
@@ -19,7 +19,7 @@
require_relative "../../spec_helper.rb"
describe Ohai::System, "languages plugin" do
- VERSION_MATCHING_REGEX = /^(?:[\d]+\.)+[\d]+$/
+ VERSION_MATCHING_REGEX = /^(?:[\d]+\.)+[\d]+$/.freeze
describe "powershell plugin", :windows_only do
RSpec.shared_examples "a version looking thing" do
it "should be present" do
diff --git a/spec/functional/plugins/windows/uptime_spec.rb b/spec/functional/plugins/windows/uptime_spec.rb
index 1b3f205c..c613c1f6 100644
--- a/spec/functional/plugins/windows/uptime_spec.rb
+++ b/spec/functional/plugins/windows/uptime_spec.rb
@@ -28,7 +28,7 @@ describe Ohai::System, "Windows plugin uptime" do
end
let(:wmi) do
- double("wmi", { first_of: { "lastbootuptime" => "20160912103128.597219+0000" },
+ double("wmi", { first_of: { "lastbootuptime" => "20160912103128.597219+0000" },
})
end
diff --git a/spec/unit/hints_spec.rb b/spec/unit/hints_spec.rb
index 52d90b20..07c1651f 100644
--- a/spec/unit/hints_spec.rb
+++ b/spec/unit/hints_spec.rb
@@ -44,7 +44,7 @@ describe "Ohai::Hints" do
when_plugins_directory "contains empty and full hints" do
with_plugin("cloud.json", <<~EOF)
{"name":"circus"}
-EOF
+ EOF
with_plugin("cloud_empty.json", <<EOF)
EOF
diff --git a/spec/unit/loader_spec.rb b/spec/unit/loader_spec.rb
index a35a1421..d752531d 100644
--- a/spec/unit/loader_spec.rb
+++ b/spec/unit/loader_spec.rb
@@ -38,13 +38,13 @@ describe Ohai::Loader do
Ohai.plugin(:Alpha) do
provides "alpha"
end
-EOF
+ EOF
with_plugin("cookbook_b/beta.rb", <<~EOF)
Ohai.plugin(:Beta) do
provides "beta"
end
-EOF
+ EOF
describe "#load_additional" do
it "adds the plugins to the map" do
@@ -63,13 +63,13 @@ EOF
Ohai.plugins(:ExtraS) do
provides "the_letter_s"
end
-EOF
+ EOF
with_plugin("no_method.rb", <<~EOF)
Ohai.plugin(:NoMethod) do
really_wants "this_attribute"
end
-EOF
+ EOF
with_plugin("illegal_def.rb", <<~EOF)
Ohai.plugin(:Zoo) do
@@ -78,32 +78,32 @@ EOF
collect_data(:darwin) do
end
end
-EOF
+ EOF
with_plugin("unexpected_error.rb", <<~EOF)
Ohai.plugin(:Zoo) do
raise "You aren't expecting this."
end
-EOF
+ EOF
with_plugin("bad_symbol.rb", <<~EOF)
Ohai.plugin(:1nval!d) do
provides "not_a_symbol"
end
-EOF
+ EOF
with_plugin("no_end.rb", <<~EOF)
Ohai.plugin(:NoEnd) do
provides "fish_oil"
collect_data do
end
-EOF
+ EOF
with_plugin("bad_name.rb", <<~EOF)
Ohai.plugin(:you_give_plugins_a_bad_name) do
provides "that/one/song"
end
-EOF
+ EOF
describe "load_plugin() method" do
describe "when the plugin uses Ohai.plugin instead of Ohai.plugins" do
diff --git a/spec/unit/plugins/aix/cpu_spec.rb b/spec/unit/plugins/aix/cpu_spec.rb
index f571afa8..f0ea1490 100644
--- a/spec/unit/plugins/aix/cpu_spec.rb
+++ b/spec/unit/plugins/aix/cpu_spec.rb
@@ -23,7 +23,7 @@ describe Ohai::System, "AIX cpu plugin" do
@lsdev_cc_processor = <<~LSDEV_CC_PROCESSOR
proc0 Available 00-00 Processor
proc4 Defined 00-04 Processor
-LSDEV_CC_PROCESSOR
+ LSDEV_CC_PROCESSOR
@lsattr_el_proc0 = <<~LSATTR_EL
frequency 1654344000 Processor Speed False
@@ -31,14 +31,14 @@ LSDEV_CC_PROCESSOR
smt_threads 2 Processor SMT threads False
state enable Processor state False
type PowerPC_POWER5 Processor type False
-LSATTR_EL
+ LSATTR_EL
@pmcycles_m = <<~PMCYCLES_M
CPU 0 runs at 1654 MHz
CPU 1 runs at 1654 MHz
CPU 2 runs at 1654 MHz
CPU 3 runs at 1654 MHz
-PMCYCLES_M
+ PMCYCLES_M
@plugin = get_plugin("cpu")
allow(@plugin).to receive(:collect_os).and_return(:aix)
diff --git a/spec/unit/plugins/aix/filesystem_spec.rb b/spec/unit/plugins/aix/filesystem_spec.rb
index 6502d618..aaa2b146 100644
--- a/spec/unit/plugins/aix/filesystem_spec.rb
+++ b/spec/unit/plugins/aix/filesystem_spec.rb
@@ -45,7 +45,7 @@ describe Ohai::System, "AIX filesystem plugin" do
/dev/fslv10 5242880 42884 5199996 1% /wpars/toolchain-tester-5c969f/tmp
/dev/fslv11 5242880 2725048 2517832 52% /wpars/toolchain-tester-5c969f/usr
/dev/fslv12 10485760 272376 10213384 3% /wpars/toolchain-tester-5c969f/var
-DF_PK
+ DF_PK
@df_pk_wpar = <<~DF_PK
Filesystem 1024-blocks Used Available Capacity Mounted on
@@ -56,7 +56,7 @@ DF_PK
Global 5242880 42884 5199996 1% /tmp
Global 5242880 2725048 2517832 52% /usr
Global 10485760 272376 10213384 3% /var
-DF_PK
+ DF_PK
@mount_lpar = <<~MOUNT
node mounted mounted over vfs date options
@@ -70,7 +70,7 @@ DF_PK
/proc /proc procfs Jul 17 13:22 rw
/dev/hd10opt /opt jfs2 Jul 17 13:22 rw,log=/dev/hd8
192.168.1.11 /stage/middleware1 /stage/middleware2 nfs3 Jul 17 13:24 ro,bg,hard,intr,sec=sys
-MOUNT
+ MOUNT
@mount_wpar = <<~MOUNT
node mounted mounted over vfs date options
@@ -83,7 +83,7 @@ MOUNT
Global /usr jfs2 Nov 23 21:03 rw,log=NULL
Global /var jfs2 Nov 23 21:03 rw,log=NULL
192.168.1.11 /stage/middleware3 /stage/middleware4 nfs3 Jul 17 13:24 ro,bg,hard,intr,sec=sys
-MOUNT
+ MOUNT
@plugin = get_plugin("filesystem")
allow(@plugin).to receive(:collect_os).and_return(:aix)
diff --git a/spec/unit/plugins/aix/network_spec.rb b/spec/unit/plugins/aix/network_spec.rb
index 0f000b97..5896a7b5 100644
--- a/spec/unit/plugins/aix/network_spec.rb
+++ b/spec/unit/plugins/aix/network_spec.rb
@@ -23,7 +23,7 @@ describe Ohai::System, "AIX network plugin" do
before(:each) do
@netstat_rn_grep_default = <<~NETSTAT_RN_GREP_DEFAULT
default 172.31.8.1 UG 2 121789 en0 - -
-NETSTAT_RN_GREP_DEFAULT
+ NETSTAT_RN_GREP_DEFAULT
@ifconfig = <<~IFCONFIG
en0: flags=1e080863,480<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,CHECKSUM_OFFLOAD(ACTIVE),CHAIN> metric 1
@@ -39,7 +39,7 @@ NETSTAT_RN_GREP_DEFAULT
inet 127.0.0.1 netmask 0xff000000 broadcast 127.255.255.255
inet6 ::1%1/0
tcp_sendspace 131072 tcp_recvspace 131072 rfc1323 1
-IFCONFIG
+ IFCONFIG
@netstat_nrf_inet = <<~NETSTAT_NRF_INET
Destination Gateway Flags Refs Use If Exp Groups
@@ -48,14 +48,14 @@ IFCONFIG
172.29.128.0 172.29.174.58 UHSb 0 0 en0 - - =>
172.29.128/18 172.29.174.58 U 7 1035485 en0 - -
172.29.191.255 172.29.174.58 UHSb 0 1 en0 - -
-NETSTAT_NRF_INET
+ NETSTAT_NRF_INET
@entstat_err = <<~ENSTAT_ERR
entstat: 0909-002 Unable to open device en0, errno = 13
grep: 0652-033 Cannot open Address".
-ENSTAT_ERR
+ ENSTAT_ERR
@aix_arp_an = <<~ARP_AN
? (172.29.131.16) at 6e:87:70:0:40:3 [ethernet] stored in bucket 16
@@ -72,7 +72,7 @@ ENSTAT_ERR
bucket: 0 contains: 0 entries
There are 6 entries in the arp table.
-ARP_AN
+ ARP_AN
@plugin = get_plugin("aix/network")
allow(@plugin).to receive(:collect_os).and_return(:aix)
diff --git a/spec/unit/plugins/aix/virtualization_spec.rb b/spec/unit/plugins/aix/virtualization_spec.rb
index 3c9e2ce2..1373f319 100644
--- a/spec/unit/plugins/aix/virtualization_spec.rb
+++ b/spec/unit/plugins/aix/virtualization_spec.rb
@@ -244,7 +244,7 @@ describe Ohai::System, "AIX virtualization plugin" do
/dev/nvram pseudo EXPORTED
-LSWPAR_L
+ LSWPAR_L
end
diff --git a/spec/unit/plugins/bsd/filesystem_spec.rb b/spec/unit/plugins/bsd/filesystem_spec.rb
index 4f3e2fcd..c64981d8 100644
--- a/spec/unit/plugins/bsd/filesystem_spec.rb
+++ b/spec/unit/plugins/bsd/filesystem_spec.rb
@@ -35,14 +35,14 @@ describe Ohai::System, "BSD filesystem plugin" do
Filesystem 1K-blocks Used Avail Capacity Mounted on
/dev/ada0p2 9637788 3313504 5553264 37% /
devfs 1 1 0 100% /dev
-DF
+ DF
allow(plugin).to receive(:shell_out).with("df").and_return(mock_shell_out(0, @stdout, ""))
@inode_stdout = <<~DFI
Filesystem 512-blocks Used Avail Capacity iused ifree %iused Mounted on
/dev/ada0p2 15411832 5109256 9069632 36% 252576 790750 24% /
devfs 2 2 0 100% 0 0 100% /dev
-DFI
+ DFI
allow(plugin).to receive(:shell_out).with("df -iP").and_return(mock_shell_out(0, @inode_stdout, ""))
end
@@ -106,7 +106,7 @@ DFI
@stdout = <<~MOUNT
/dev/ada0p2 on / (ufs, local, journaled soft-updates)
devfs on /dev (devfs, local, multilabel)
-MOUNT
+ MOUNT
allow(plugin).to receive(:shell_out).with("mount -l").and_return(mock_shell_out(0, @stdout, ""))
end
diff --git a/spec/unit/plugins/bsd/virtualization_spec.rb b/spec/unit/plugins/bsd/virtualization_spec.rb
index 584915e0..e8922dd8 100644
--- a/spec/unit/plugins/bsd/virtualization_spec.rb
+++ b/spec/unit/plugins/bsd/virtualization_spec.rb
@@ -78,7 +78,7 @@ describe Ohai::System, "BSD virtualization plugin" do
Id Refs Address Size Name
1 40 0xffffffff80100000 d20428 kernel
7 3 0xffffffff81055000 41e88 vboxguest.ko
-OUT
+ OUT
allow(plugin).to receive(:shell_out).with((Ohai.abs_path("/sbin/kldstat")).to_s).and_return(mock_shell_out(0, @vbox_guest, ""))
end
@@ -96,7 +96,7 @@ OUT
Id Refs Address Size Name
1 40 0xffffffff80100000 d20428 kernel
7 3 0xffffffff81055000 41e88 vboxdrv.ko
-OUT
+ OUT
allow(plugin).to receive(:shell_out).with("/sbin/kldstat").and_return(mock_shell_out(0, @stdout, ""))
end
diff --git a/spec/unit/plugins/darwin/cpu_spec.rb b/spec/unit/plugins/darwin/cpu_spec.rb
index aa30a17e..a1c54e54 100644
--- a/spec/unit/plugins/darwin/cpu_spec.rb
+++ b/spec/unit/plugins/darwin/cpu_spec.rb
@@ -75,7 +75,7 @@ describe Ohai::System, "Darwin cpu plugin" do
machdep.cpu.vendor: GenuineIntel
machdep.cpu.max_ext: 2147483656
machdep.cpu.max_basic: 13
-CTL
+ CTL
allow(@plugin).to receive(:collect_os).and_return(:darwin)
allow(@plugin).to receive(:shell_out).with("sysctl hw machdep").and_return(mock_shell_out(0, @stdout, ""))
diff --git a/spec/unit/plugins/darwin/filesystem_spec.rb b/spec/unit/plugins/darwin/filesystem_spec.rb
index aaafbd13..a9ce95d4 100644
--- a/spec/unit/plugins/darwin/filesystem_spec.rb
+++ b/spec/unit/plugins/darwin/filesystem_spec.rb
@@ -37,7 +37,7 @@ describe Ohai::System, "darwin filesystem plugin" do
map -hosts 0 0 0 100% 0 0 100% /net
map -static 0 0 0 100% 0 0 100% /mobile_symbol
deweyfs@osxfuse0 0 0 0 100% 0 0 100% /mnt/dewey
-DF
+ DF
allow(plugin).to receive(:shell_out).with("df -i").and_return(mock_shell_out(0, @stdout, ""))
end
@@ -77,7 +77,7 @@ DF
map -hosts on /net (autofs, nosuid, automounted, nobrowse)
map -static on /mobile_symbol (autofs, automounted, nobrowse)
deweyfs@osxfuse0 on /mnt/dewey (osxfusefs, synchronous, nobrowse)
-MOUNT
+ MOUNT
allow(plugin).to receive(:shell_out).with("mount").and_return(mock_shell_out(0, @stdout, ""))
end
@@ -105,7 +105,7 @@ MOUNT
map -static 0 0 0 100% 0 0 100% /mobile_symbol
deweyfs@osxfuse0 0 0 0 100% 0 0 100% /mnt/dewey
/dev/disk0s2 488555536 313696448 174347088 65% 39276054 21793386 64% /another/mountpoint
-DF
+ DF
allow(plugin).to receive(:shell_out).with("df -i").and_return(mock_shell_out(0, @dfstdout, ""))
end
@@ -127,7 +127,7 @@ DF
deweyfs@osxfuse0 0 0 0 100% 0 0 100% /mnt/dewey
/dev/disk0s3 488555536 313696448 174347088 65% 39276054 21793386 64% /mnt
/dev/disk0s4 488555536 313696448 174347088 65% 39276054 21793386 64% /mnt
-DF
+ DF
allow(plugin).to receive(:shell_out).with("df -i").and_return(mock_shell_out(0, @dfstdout, ""))
end
diff --git a/spec/unit/plugins/darwin/hardware_system_profiler_output.rb b/spec/unit/plugins/darwin/hardware_system_profiler_output.rb
index 212d563a..10d8cfc3 100644
--- a/spec/unit/plugins/darwin/hardware_system_profiler_output.rb
+++ b/spec/unit/plugins/darwin/hardware_system_profiler_output.rb
@@ -287,7 +287,7 @@ module HardwareSystemProfilerOutput
</dict>
</array>
</plist>
-HARDWARE_OUTPUT
+ HARDWARE_OUTPUT
STORAGE = <<~STORAGE_OUTPUT.freeze
<?xml version="1.0" encoding="UTF-8"?>
@@ -598,7 +598,7 @@ HARDWARE_OUTPUT
</dict>
</array>
</plist>
-STORAGE_OUTPUT
+ STORAGE_OUTPUT
POWER = <<~POWER_OUTPUT.freeze
<?xml version="1.0" encoding="UTF-8"?>
@@ -1105,6 +1105,6 @@ STORAGE_OUTPUT
</dict>
</array>
</plist>
-POWER_OUTPUT
+ POWER_OUTPUT
end
diff --git a/spec/unit/plugins/fail_spec.rb b/spec/unit/plugins/fail_spec.rb
index 6a8ac8d7..85fb28b3 100644
--- a/spec/unit/plugins/fail_spec.rb
+++ b/spec/unit/plugins/fail_spec.rb
@@ -156,20 +156,20 @@ describe "when using DSL commands outside Ohai.plugin block" do
provides "fail"
Ohai.plugin do
end
-EOF
+ EOF
failstr2 = <<~EOF
depends "fail"
Ohai.plugin do
end
-EOF
+ EOF
failstr3 = <<~EOF
collect_data do
end
Ohai.plugin do
end
-EOF
+ EOF
it_behaves_like "a v7 loading failure" do
let(:failstr) { failstr1 }
diff --git a/spec/unit/plugins/joyent_spec.rb b/spec/unit/plugins/joyent_spec.rb
index 24782445..6e8f17c8 100644
--- a/spec/unit/plugins/joyent_spec.rb
+++ b/spec/unit/plugins/joyent_spec.rb
@@ -65,14 +65,14 @@ describe Ohai::System, "plugin joyent" do
Name: Joyent Instance
Image: pkgbuild 16.3.1
Documentation: https://docs.joyent.com/images/smartos/pkgbuild
- EOS
+ EOS
pkg_install_conf = <<~EOS
GPG_KEYRING_VERIFY=/opt/local/etc/gnupg/pkgsrc.gpg
GPG_KEYRING_PKGVULN=/opt/local/share/gnupg/pkgsrc-security.gpg
PKG_PATH=https://pkgsrc.joyent.com/packages/SmartOS/2016Q3/x86_64/All
VERIFIED_INSTALLATION=trusted
- EOS
+ EOS
allow(::File).to receive(:read).with("/etc/product").and_return(etc_product)
allow(::File).to receive(:read).with("/opt/local/etc/pkg_install.conf").and_return(pkg_install_conf)
diff --git a/spec/unit/plugins/linux/filesystem_spec.rb b/spec/unit/plugins/linux/filesystem_spec.rb
index 459f744e..dac7eee8 100644
--- a/spec/unit/plugins/linux/filesystem_spec.rb
+++ b/spec/unit/plugins/linux/filesystem_spec.rb
@@ -69,7 +69,7 @@ describe Ohai::System, "Linux filesystem plugin" do
/dev/mapper/sys.vg-usr.lv 19223252 5479072 12767696 31% /usr
/dev/mapper/sys.vg-var.lv 19223252 3436556 14810212 19% /var
/dev/md0 960492 36388 875312 4% /boot
-DF
+ DF
allow(plugin).to receive(:shell_out).with("df -P").and_return(mock_shell_out(0, @stdout, ""))
@inode_stdout = <<~DFI
@@ -79,7 +79,7 @@ DF
tmpfs 126922 273 126649 1% /run
none 126922 1 126921 1% /run/lock
none 126922 1 126921 1% /run/shm
-DFI
+ DFI
allow(plugin).to receive(:shell_out).with("df -iP").and_return(mock_shell_out(0, @inode_stdout, ""))
end
@@ -148,7 +148,7 @@ DFI
/dev/md0 on /boot type ext3 (rw,noatime,errors=remount-ro)
fusectl on /sys/fs/fuse/connections type fusectl (rw)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
-MOUNT
+ MOUNT
allow(plugin).to receive(:shell_out).with("mount").and_return(mock_shell_out(0, @stdout, ""))
end
@@ -189,7 +189,7 @@ MOUNT
/dev/mapper/sys.vg-usr.lv 19223252 5479072 12767696 31% /usr
/dev/mapper/sys.vg-var.lv 19223252 3436556 14810212 19% /var
/dev/md0 960492 36388 875312 4% /boot
-DF
+ DF
allow(plugin).to receive(:shell_out).with("df -P").and_return(mock_shell_out(0, @dfstdout, ""))
@inode_stdout = <<~DFI
@@ -199,7 +199,7 @@ DF
tmpfs 126922 273 126649 1% /run
none 126922 1 126921 1% /run/lock
none 126922 1 126921 1% /run/shm
-DFI
+ DFI
allow(plugin).to receive(:shell_out).with("df -iP").and_return(mock_shell_out(0, @inode_stdout, ""))
@stdout = <<~BLKID_TYPE
@@ -215,7 +215,7 @@ DFI
/dev/mapper/sys.vg-usr.lv: LABEL=\"/usr\" UUID=\"26ec33c5-d00b-4f88-a550-492def013bbc\" TYPE=\"ext4\"
/dev/mapper/sys.vg-var.lv: LABEL=\"/var\" UUID=\"6b559c35-7847-4ae2-b512-c99012d3f5b3\" TYPE=\"ext4\"
/dev/mapper/sys.vg-home.lv: LABEL=\"/home\" UUID=\"d6efda02-1b73-453c-8c74-7d8dee78fa5e\" TYPE=\"xfs\"
-BLKID_TYPE
+ BLKID_TYPE
allow(plugin).to receive(:shell_out).with("/sbin/blkid", timeout: 60).and_return(mock_shell_out(0, @stdout, ""))
end
@@ -245,7 +245,7 @@ BLKID_TYPE
/dev/mapper/sys.vg-usr.lv 19223252 5479072 12767696 31% /usr
/dev/mapper/sys.vg-var.lv 19223252 3436556 14810212 19% /var
/dev/md0 960492 36388 875312 4% /boot
-DF
+ DF
allow(plugin).to receive(:shell_out).with("df -P").and_return(mock_shell_out(0, @dfstdout, ""))
@inode_stdout = <<~DFI
@@ -255,7 +255,7 @@ DF
tmpfs 126922 273 126649 1% /run
none 126922 1 126921 1% /run/lock
none 126922 1 126921 1% /run/shm
-DFI
+ DFI
allow(plugin).to receive(:shell_out).with("df -iP").and_return(mock_shell_out(0, @inode_stdout, ""))
allow(plugin).to receive(:which).with("lsblk").and_return("/sbin/lsblk")
@@ -274,7 +274,7 @@ DFI
NAME=\"sys.vg-var.lv\" UUID=\"6b559c35-7847-4ae2-b512-c99012d3f5b3\" LABEL=\"/var\" FSTYPE=\"ext4\"
NAME=\"sys.vg-home.lv\" UUID=\"d6efda02-1b73-453c-8c74-7d8dee78fa5e\" LABEL=\"/home\" FSTYPE=\"xfs\"
NAME=\"debian--7-root (dm-0)\" UUID=\"09187faa-3512-4505-81af-7e86d2ccb99a\" LABEL=\"root\" FSTYPE=\"ext4\"
-BLKID_TYPE
+ BLKID_TYPE
allow(plugin).to receive(:shell_out)
.with("/sbin/lsblk -n -P -o NAME,UUID,LABEL,FSTYPE", timeout: 60)
.and_return(mock_shell_out(0, @stdout, ""))
@@ -312,7 +312,7 @@ BLKID_TYPE
/dev/mapper/sys.vg-usr.lv 19223252 5479072 12767696 31% /usr
/dev/mapper/sys.vg-var.lv 19223252 3436556 14810212 19% /var
/dev/md0 960492 36388 875312 4% /boot
-DF
+ DF
allow(plugin).to receive(:shell_out).with("df -P").and_return(mock_shell_out(0, @dfstdout, ""))
@inode_stdout = <<~DFI
@@ -322,7 +322,7 @@ DF
tmpfs 126922 273 126649 1% /run
none 126922 1 126921 1% /run/lock
none 126922 1 126921 1% /run/shm
-DFI
+ DFI
allow(plugin).to receive(:shell_out).with("df -iP").and_return(mock_shell_out(0, @inode_stdout, ""))
allow(plugin).to receive(:which).with("lsblk").and_return("/sbin/lsblk")
@@ -341,7 +341,7 @@ DFI
NAME=\"sys.vg-var.lv\" UUID=\"6b559c35-7847-4ae2-b512-c99012d3f5b3\" LABEL=\"/var\" FSTYPE=\"ext4\"
NAME=\"sys.vg-home.lv\" UUID=\"d6efda02-1b73-453c-8c74-7d8dee78fa5e\" LABEL=\"/BADhome\" FSTYPE=\"xfs\"
NAME=\"debian--7-root (dm-0)\" UUID=\"09187faa-3512-4505-81af-7e86d2ccb99a\" LABEL=\"root\" FSTYPE=\"ext4\"
-BLKID_TYPE
+ BLKID_TYPE
allow(plugin).to receive(:shell_out)
.with("/sbin/lsblk -n -P -o NAME,UUID,LABEL,FSTYPE", timeout: 60)
.and_return(mock_shell_out(0, @stdout, ""))
@@ -358,7 +358,7 @@ BLKID_TYPE
/dev/mapper/sys.vg-usr.lv: LABEL=\"/usr\" UUID=\"26ec33c5-d00b-4f88-a550-492def013bbc\" TYPE=\"ext4\"
/dev/mapper/sys.vg-var.lv: LABEL=\"/var\" UUID=\"6b559c35-7847-4ae2-b512-c99012d3f5b3\" TYPE=\"ext4\"
/dev/mapper/sys.vg-home.lv: LABEL=\"/home\" UUID=\"d6efda02-1b73-453c-8c74-7d8dee78fa5e\" TYPE=\"xfs\"
-BLKID_TYPE
+ BLKID_TYPE
allow(plugin).to receive(:shell_out).with("/sbin/blkid", timeout: 60).and_return(mock_shell_out(0, @stdout, ""))
end
@@ -405,7 +405,7 @@ BLKID_TYPE
/dev/md0 /boot ext3 rw,noatime,errors=remount-ro,data=ordered 0 0
fusectl /sys/fs/fuse/connections fusectl rw,relatime 0 0
binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw,nosuid,nodev,noexec,relatime 0 0
-MOUNTS
+ MOUNTS
@counter = 0
allow(@double_file).to receive(:read_nonblock) do
@counter += 1
@@ -448,7 +448,7 @@ MOUNTS
/dev/mapper/sys.vg-home.lv 97605056 53563252 44041804 55% /home
/dev/mapper/sys.vg-home.lv 97605056 53563252 44041804 55% /home2
/dev/mapper/sys.vg-root.lv 4805760 378716 4182924 9% /var/chroot
-DF
+ DF
allow(plugin).to receive(:shell_out).with("df -P").and_return(mock_shell_out(0, @dfstdout, ""))
@inode_stdout = <<~DFI
@@ -460,7 +460,7 @@ DF
/dev/mapper/sys.vg-home.lv 60891136 4696030 56195106 8% /home
/dev/mapper/sys.vg-home.lv 60891136 4696030 56195106 8% /home2
/dev/mapper/sys.vg-root.lv 1310720 107407 1203313 9% /var/chroot
-DFI
+ DFI
allow(plugin).to receive(:shell_out).with("df -iP").and_return(mock_shell_out(0, @inode_stdout, ""))
allow(plugin).to receive(:which).with("lsblk").and_return("/sbin/lsblk")
@@ -468,7 +468,7 @@ DFI
@stdout = <<~BLKID_TYPE
NAME=\"/dev/mapper/sys.vg-root.lv\" UUID=\"7742d14b-80a3-4e97-9a32-478be9ea9aea\" LABEL=\"/\" FSTYPE=\"ext4\"
NAME=\"/dev/mapper/sys.vg-home.lv\" UUID=\"d6efda02-1b73-453c-8c74-7d8dee78fa5e\" LABEL=\"/home\" FSTYPE=\"xfs\"
-BLKID_TYPE
+ BLKID_TYPE
allow(plugin).to receive(:shell_out)
.with("/sbin/lsblk -n -P -o NAME,UUID,LABEL,FSTYPE", timeout: 60)
.and_return(mock_shell_out(0, @stdout, ""))
@@ -493,7 +493,7 @@ BLKID_TYPE
/dev/mapper/sys.vg-home.lv 97605056 53563252 44041804 55% /home
/dev/sdb1 97605056 53563252 44041804 55% /mnt
/dev/sdc1 4805760 378716 4182924 9% /mnt
-DF
+ DF
allow(plugin).to receive(:shell_out).with("df -P").and_return(mock_shell_out(0, @dfstdout, ""))
@inode_stdout = <<~DFI
@@ -505,7 +505,7 @@ DF
/dev/mapper/sys.vg-home.lv 60891136 4696030 56195106 8% /home
/dev/sdb1 60891136 4696030 56195106 8% /mnt
/dev/sdc1 1310720 107407 1203313 9% /mnt
-DFI
+ DFI
allow(plugin).to receive(:shell_out).with("df -iP").and_return(mock_shell_out(0, @inode_stdout, ""))
allow(plugin).to receive(:which).with("lsblk").and_return("/sbin/lsblk")
@@ -515,7 +515,7 @@ DFI
NAME=\"/dev/sdb1\" UUID=\"6b559c35-7847-4ae2-b512-c99012d3f5b3\" LABEL=\"/mnt\" FSTYPE=\"ext4\"
NAME=\"/dev/sdc1\" UUID=\"7f1e51bf-3608-4351-b7cd-379e39cff36a\" LABEL=\"/mnt\" FSTYPE=\"ext4\"
NAME=\"/dev/mapper/sys.vg-home.lv\" UUID=\"d6efda02-1b73-453c-8c74-7d8dee78fa5e\" LABEL=\"/home\" FSTYPE=\"xfs\"
-BLKID_TYPE
+ BLKID_TYPE
allow(plugin).to receive(:shell_out)
.with("/sbin/lsblk -n -P -o NAME,UUID,LABEL,FSTYPE", timeout: 60)
.and_return(mock_shell_out(0, @stdout, ""))
diff --git a/spec/unit/plugins/linux/hostnamectl_spec.rb b/spec/unit/plugins/linux/hostnamectl_spec.rb
index 15bea9ed..774cdb88 100644
--- a/spec/unit/plugins/linux/hostnamectl_spec.rb
+++ b/spec/unit/plugins/linux/hostnamectl_spec.rb
@@ -35,7 +35,7 @@ describe Ohai::System, "Linux hostnamectl plugin" do
Operating System: Debian GNU/Linux 8 (jessie)
Kernel: Linux 4.3.0-0.bpo.1-amd64
Architecture: x86-64
-HOSTNAMECTL_OUT
+ HOSTNAMECTL_OUT
allow(plugin).to receive(:which).with("hostnamectl").and_return("/bin/hostnamectl")
allow(plugin).to receive(:shell_out).with("/bin/hostnamectl").and_return(mock_shell_out(0, hostnamectl_out, ""))
diff --git a/spec/unit/plugins/linux/kernel_spec.rb b/spec/unit/plugins/linux/kernel_spec.rb
index edf6d98a..ff3591da 100644
--- a/spec/unit/plugins/linux/kernel_spec.rb
+++ b/spec/unit/plugins/linux/kernel_spec.rb
@@ -30,7 +30,7 @@ describe Ohai::System, "Linux kernel plugin" do
serio_raw 13031 0
virtio_balloon 13168 0
floppy 55441 0
-ENV_LSMOD
+ ENV_LSMOD
@version_module = {
dm_crypt: "",
psmouse: "",
@@ -42,13 +42,13 @@ ENV_LSMOD
}
@expected_result = {
- "dm_crypt" => { "size" => "22321", "refcount" => "0" },
- "psmouse" => { "size" => "81038", "refcount" => "0" },
- "acpiphp" => { "size" => "23314", "refcount" => "0" },
- "microcode" => { "size" => "18286", "refcount" => "0", "version" => "1.2.3" },
- "serio_raw" => { "size" => "13031", "refcount" => "0" },
+ "dm_crypt" => { "size" => "22321", "refcount" => "0" },
+ "psmouse" => { "size" => "81038", "refcount" => "0" },
+ "acpiphp" => { "size" => "23314", "refcount" => "0" },
+ "microcode" => { "size" => "18286", "refcount" => "0", "version" => "1.2.3" },
+ "serio_raw" => { "size" => "13031", "refcount" => "0" },
"virtio_balloon" => { "size" => "13168", "refcount" => "0" },
- "floppy" => { "size" => "55441", "refcount" => "0" },
+ "floppy" => { "size" => "55441", "refcount" => "0" },
}
@plugin = get_plugin("kernel")
allow(@plugin).to receive(:collect_os).and_return(:linux)
diff --git a/spec/unit/plugins/linux/lsb_spec.rb b/spec/unit/plugins/linux/lsb_spec.rb
index ff110805..7535be33 100644
--- a/spec/unit/plugins/linux/lsb_spec.rb
+++ b/spec/unit/plugins/linux/lsb_spec.rb
@@ -80,7 +80,7 @@ describe Ohai::System, "Linux lsb plugin" do
Description: CentOS release 5.4 (Final)
Release: 5.4
Codename: Final
-LSB_RELEASE
+ LSB_RELEASE
allow(@plugin).to receive(:shell_out).with("lsb_release -a").and_return(mock_shell_out(0, @stdout, ""))
end
@@ -113,7 +113,7 @@ LSB_RELEASE
Description: Fedora release 14 (Laughlin)
Release: 14
Codename: Laughlin
-LSB_RELEASE
+ LSB_RELEASE
allow(@plugin).to receive(:shell_out).with("lsb_release -a").and_return(mock_shell_out(0, @stdout, ""))
end
diff --git a/spec/unit/plugins/linux/lspci_spec.rb b/spec/unit/plugins/linux/lspci_spec.rb
index c62e1486..bcf49c93 100644
--- a/spec/unit/plugins/linux/lspci_spec.rb
+++ b/spec/unit/plugins/linux/lspci_spec.rb
@@ -85,7 +85,7 @@ describe Ohai::System, "Linux lspci plugin" do
Driver: nvme
Module: nvme
NUMANode: 0
-LSPCI
+ LSPCI
allow(plugin).to receive(:shell_out).with("lspci -vnnmk").and_return(
mock_shell_out(0, @stdout, ""))
end
diff --git a/spec/unit/plugins/linux/mdadm_spec.rb b/spec/unit/plugins/linux/mdadm_spec.rb
index 6adc1d77..f2679fdb 100644
--- a/spec/unit/plugins/linux/mdadm_spec.rb
+++ b/spec/unit/plugins/linux/mdadm_spec.rb
@@ -52,7 +52,7 @@ describe Ohai::System, "Linux Mdadm Plugin" do
3 8 80 3 active sync /dev/sdf
4 8 96 4 active sync /dev/sdg
5 8 112 5 active sync /dev/sdh
-MD
+ MD
@plugin = get_plugin("linux/mdadm")
allow(@plugin).to receive(:collect_os).and_return(:linux)
@double_file = double("/proc/mdstat")
diff --git a/spec/unit/plugins/linux/network_spec.rb b/spec/unit/plugins/linux/network_spec.rb
index c5dbba79..1658a6f5 100644
--- a/spec/unit/plugins/linux/network_spec.rb
+++ b/spec/unit/plugins/linux/network_spec.rb
@@ -141,7 +141,7 @@ describe Ohai::System, "Linux Network Plugin" do
TX packets:2 errors:0 dropped:1 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:140 (140.0 B)
-EOM
+ EOM
# Note that ifconfig shows foo:veth0@eth0 but fails to show any address information.
# This was not a mistake collecting the output and Apparently ifconfig is broken in this regard.
end
@@ -155,7 +155,7 @@ EOM
192.168.0.0/24 dev eth0 proto kernel src 192.168.0.2
10.5.4.0/24 \\ nexthop via 10.5.4.1 dev eth0 weight 1\\ nexthop via 10.5.4.2 dev eth0 weight 1
default via 10.116.201.1 dev eth0
-EOM
+ EOM
end
let(:linux_route_n) do
@@ -165,7 +165,7 @@ EOM
10.116.201.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 1002 0 0 eth0
0.0.0.0 10.116.201.1 0.0.0.0 UG 0 0 0 eth0
-EOM
+ EOM
end
let(:linux_ip_route_inet6) do
@@ -174,7 +174,7 @@ EOM
fe80::/64 dev eth0.11 proto kernel metric 256
1111:2222:3333:4444::/64 dev eth0.11 metric 1024 expires 86023sec
default via 1111:2222:3333:4444::1 dev eth0.11 metric 1024
-EOM
+ EOM
end
let(:linux_ip_addr) do
@@ -238,7 +238,7 @@ EOM
link/tunnel6 :: brd ::
inet6 fe80::f47a:2aff:fef0:c6ef/64 scope link
valid_lft forever preferred_lft forever
-EOM
+ EOM
end
let(:linux_ip_link_s_d) do
@@ -305,19 +305,19 @@ EOM
0 0 0 0 0 0
TX: bytes packets errors dropped carrier collsns
0 0 0 0 0 0
-EOM
+ EOM
end
let(:linux_arp_an) do
<<~EOM
? (10.116.201.1) at fe:ff:ff:ff:ff:ff [ether] on eth0
-EOM
+ EOM
end
let(:linux_ip_neighbor_show) do
<<~EOM
10.116.201.1 dev eth0 lladdr fe:ff:ff:ff:ff:ff REACHABLE
-EOM
+ EOM
end
let(:linux_ip_inet6_neighbor_show) do
@@ -325,7 +325,7 @@ EOM
1111:2222:3333:4444::1 dev eth0.11 lladdr 00:1c:0e:12:34:56 router REACHABLE
fe80::21c:eff:fe12:3456 dev eth0.11 lladdr 00:1c:0e:30:28:00 router REACHABLE
fe80::21c:eff:fe12:3456 dev eth0.153 lladdr 00:1c:0e:30:28:00 router REACHABLE
-EOM
+ EOM
end
let(:linux_ethtool) do
@@ -351,7 +351,7 @@ EOM
Current message level: 0x00000007 (7)
drv probe link
Link detected: yes
-EOM
+ EOM
end
let(:linux_ethtool_g) do
@@ -368,7 +368,7 @@ EOM
RX Jumbo: 0
TX: 8192
-EOM
+ EOM
end
before(:each) do
@@ -748,7 +748,7 @@ EOM
<<~EOM
10.116.201.0/24 dev eth0 proto kernel
default dev eth0 scope link
-EOM
+ EOM
end
let(:linux_route_n) do
@@ -757,7 +757,7 @@ EOM
Destination Gateway Genmask Flags Metric Ref Use Iface
10.116.201.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
0.0.0.0 0.0.0.0 0.0.0.0 U 0 0 0 eth0
-EOM
+ EOM
end
before(:each) do
@@ -778,7 +778,7 @@ EOM
<<~EOM
192.168.0.0/24 dev eth0.11 proto kernel src 192.168.0.2
default via 192.168.0.15 dev eth0.11
-EOM
+ EOM
end
let(:linux_route_n) do
@@ -787,7 +787,7 @@ EOM
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0.11
0.0.0.0 192.168.0.15 0.0.0.0 UG 0 0 0 eth0.11
-EOM
+ EOM
end
before(:each) do
@@ -888,7 +888,7 @@ EOM
fe80::/64 dev eth0 proto kernel metric 256
fe80::/64 dev eth0.11 proto kernel metric 256
1111:2222:3333:4444::/64 dev eth0.11 metric 1024 expires 86023sec
-EOM
+ EOM
end
before(:each) do
@@ -917,7 +917,7 @@ EOM
172.16.151.0/24 dev eth0 proto kernel src 172.16.151.100
192.168.0.0/24 dev eth0 proto kernel src 192.168.0.2
default via 10.116.201.1 dev eth0 src 10.116.201.76
-EOM
+ EOM
end
let(:linux_ip_route_inet6) do
@@ -926,7 +926,7 @@ EOM
fe80::/64 dev eth0.11 proto kernel metric 256
1111:2222:3333:4444::/64 dev eth0.11 metric 1024
default via 1111:2222:3333:4444::1 dev eth0.11 metric 1024 src 1111:2222:3333:4444::3
-EOM
+ EOM
end
before(:each) do
@@ -957,7 +957,7 @@ EOM
192.168.0.0/24 dev eth0 proto kernel src 192.168.0.2
default via 10.116.201.1 dev eth0 metric 10
default via 10.116.201.254 dev eth0 metric 9
-EOM
+ EOM
end
let(:linux_ip_route_inet6) do
@@ -967,7 +967,7 @@ EOM
1111:2222:3333:4444::/64 dev eth0.11 metric 1024 src 1111:2222:3333:4444::3
default via 1111:2222:3333:4444::1 dev eth0.11 metric 1024
default via 1111:2222:3333:4444::ffff dev eth0.11 metric 1023
-EOM
+ EOM
end
before(:each) do
@@ -1000,7 +1000,7 @@ EOM
192.168.0.0/24 dev eth0 proto kernel src 192.168.0.2
default via 10.116.201.1 dev eth0 metric 10
default via 10.116.201.254 dev eth0 metric 9 src 10.116.201.74
-EOM
+ EOM
end
let(:linux_ip_route_inet6) do
@@ -1010,7 +1010,7 @@ EOM
1111:2222:3333:4444::/64 dev eth0.11 metric 1024 src 1111:2222:3333:4444::3
default via 1111:2222:3333:4444::1 dev eth0.11 metric 1024
default via 1111:2222:3333:4444::ffff dev eth0.11 metric 1023 src 1111:2222:3333:4444::2
-EOM
+ EOM
end
before(:each) do
@@ -1040,7 +1040,7 @@ EOM
172.16.151.0/24 dev eth0 proto kernel src 172.16.151.100
192.168.0.0/24 dev eth0 proto kernel src 192.168.0.2
default via 10.116.201.1 dev eth0
-EOM
+ EOM
end
let(:linux_ip_route_inet6) do
@@ -1049,7 +1049,7 @@ EOM
fe80::/64 dev eth0.11 proto kernel metric 256
1111:2222:3333:4444::/64 dev eth0.11 metric 1024 src 1111:2222:3333:4444::3
default via 1111:2222:3333:4444::1 dev eth0.11 metric 1024
-EOM
+ EOM
end
it "completes the run" do
@@ -1089,7 +1089,7 @@ EOM
<<~EOM
10.118.19.1 dev tun0 proto kernel src 10.118.19.39
default via 172.16.19.1 dev tun0
-EOM
+ EOM
end
let(:linux_ip_route_inet6) { "" }
@@ -1111,7 +1111,7 @@ EOM
let(:linux_ip_route) do
<<~EOM
default dev venet0 scope link
-EOM
+ EOM
end
before(:each) do
@@ -1132,7 +1132,7 @@ EOM
let(:linux_ip_route) do
<<~EOM
default dev eth3 scope link
-EOM
+ EOM
end
before(:each) do
@@ -1157,7 +1157,7 @@ EOM
let(:linux_ip_route) do
<<~EOM
default dev fwdintf scope link src 2.2.2.2
-EOM
+ EOM
end
before(:each) do
@@ -1183,7 +1183,7 @@ EOM
<<~EOM
fe80::/64 dev eth0 proto kernel metric 256
default via fe80::21c:eff:fe12:3456 dev eth0.153 src fe80::2e0:81ff:fe2b:48e7 metric 1024
-EOM
+ EOM
end
before(:each) do
plugin.run
@@ -1208,7 +1208,7 @@ EOM
192.168.212.0/24 dev foo:veth0@eth0 proto kernel src 192.168.212.2
172.16.151.0/24 dev eth0 proto kernel src 172.16.151.100
192.168.0.0/24 dev eth0 proto kernel src 192.168.0.2
-EOM
+ EOM
end
let(:linux_ip_route_inet6) do
@@ -1216,7 +1216,7 @@ EOM
fe80::/64 dev eth0 proto kernel metric 256
fe80::/64 dev eth0.11 proto kernel metric 256
1111:2222:3333:4444::/64 dev eth0.11 metric 1024 src 1111:2222:3333:4444::3
-EOM
+ EOM
end
before(:each) do
@@ -1252,7 +1252,7 @@ EOM
inet 10.116.201.76/24 brd 10.116.201.255 scope global venet0:0
inet6 2001:44b8:4160:8f00:a00:27ff:fe13:eacd/64 scope global dynamic
valid_lft 6128sec preferred_lft 2526sec
-EOM
+ EOM
end
# We don't have the corresponding ipv6 data for these tests
let(:linux_ip_route_inet6) { "" }
@@ -1291,7 +1291,7 @@ EOM
10.118.19.0/26 dev eth0 proto kernel src 10.118.19.39
10.118.19.0/26 dev if5 proto kernel src 10.118.19.45
default via 10.116.201.1 dev eth0 src 10.116.201.99
-EOM
+ EOM
end
let(:linux_ip_route_inet6) do
@@ -1300,7 +1300,7 @@ EOM
fe80::/64 dev eth0.11 proto kernel metric 256
1111:2222:3333:4444::/64 dev eth0.11 metric 1024 src 1111:2222:3333:4444::FFFF:2
default via 1111:2222:3333:4444::1 dev eth0.11 metric 1024
-EOM
+ EOM
end
before(:each) do
@@ -1332,7 +1332,7 @@ EOM
let(:linux_ip_route) do
<<~EOM
192.168.122.0/24 dev virbr0 proto kernel src 192.168.122.1
-EOM
+ EOM
end
it "logs a message and skips previously unseen interfaces in 'ip route show'" do
@@ -1376,7 +1376,7 @@ EOM
1392844460 2659966 0 0 0 0
TX: bytes packets errors dropped carrier collsns
691785313 1919690 0 0 0 0
-EOM
+ EOM
end
it "adds the vlan information of an interface" do
diff --git a/spec/unit/plugins/linux/platform_spec.rb b/spec/unit/plugins/linux/platform_spec.rb
index ca6ab298..bd81344c 100644
--- a/spec/unit/plugins/linux/platform_spec.rb
+++ b/spec/unit/plugins/linux/platform_spec.rb
@@ -136,7 +136,7 @@ describe Ohai::System, "Linux plugin platform" do
PRETTY_NAME="CentOS Linux 7 (Core)"
CISCO_RELEASE_INFO=/etc/shared/os-release
- OS_RELEASE
+ OS_RELEASE
end
let(:cisco_release_content) do
@@ -150,7 +150,7 @@ describe Ohai::System, "Linux plugin platform" do
HOME_URL=http://www.cisco.com
BUILD_ID=6
CISCO_RELEASE_INFO=/etc/shared/os-release
- CISCO_RELEASE
+ CISCO_RELEASE
end
it "returns nexus_centos for centos os-release id" do
@@ -220,7 +220,7 @@ describe Ohai::System, "Linux plugin platform" do
ID_LIKE=debian
PRETTY_NAME="Ubuntu 14.04.5 LTS"
VERSION_ID="14.04"
-OS_DATA
+ OS_DATA
end
before(:each) do
@@ -242,7 +242,7 @@ OS_DATA
PRETTY_NAME="Arch Linux"
ID=arch
ID_LIKE=archlinux
-OS_DATA
+ OS_DATA
end
before(:each) do
@@ -267,7 +267,7 @@ OS_DATA
ID_LIKE="suse opensuse"
VERSION_ID="15.0"
PRETTY_NAME="openSUSE Leap 15.0"
-OS_DATA
+ OS_DATA
end
before(:each) do
@@ -291,7 +291,7 @@ OS_DATA
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
-OS_DATA
+ OS_DATA
end
before(:each) do
@@ -787,7 +787,7 @@ OS_DATA
ID_LIKE=clear-linux-os
VERSION_ID=26290
PRETTY_NAME="Clear Linux OS"
- CLEARLINUX_RELEASE
+ CLEARLINUX_RELEASE
end
before do
expect(File).to receive(:read).with("/usr/lib/os-release").and_return(usr_lib_os_release_content)
diff --git a/spec/unit/plugins/linux/sessions_spec.rb b/spec/unit/plugins/linux/sessions_spec.rb
index f301df20..988cbd6f 100644
--- a/spec/unit/plugins/linux/sessions_spec.rb
+++ b/spec/unit/plugins/linux/sessions_spec.rb
@@ -31,7 +31,7 @@ describe Ohai::System, "Linux sessions plugin" do
318 0 root
46 0 root
306 1000 joe
-LOGINCTL_OUT
+ LOGINCTL_OUT
allow(plugin).to receive(:which).with("loginctl").and_return("/bin/loginctl")
allow(plugin).to receive(:shell_out).with("/bin/loginctl --no-pager --no-legend --no-ask-password list-sessions").and_return(mock_shell_out(0, loginctl_out, ""))
plugin.run
diff --git a/spec/unit/plugins/linux/systemd_paths_spec.rb b/spec/unit/plugins/linux/systemd_paths_spec.rb
index 0dcdd3cb..91f55e59 100644
--- a/spec/unit/plugins/linux/systemd_paths_spec.rb
+++ b/spec/unit/plugins/linux/systemd_paths_spec.rb
@@ -66,7 +66,7 @@ describe Ohai::System, "Linux systemd paths plugin" do
search-configuration-factory: /usr/local/share/factory/etc:/usr/share/factory/etc
search-state-factory: /usr/local/share/factory/var:/usr/share/factory/var
search-configuration: /home/foo/.config:/etc
-SYSTEMD_PATH_OUT
+ SYSTEMD_PATH_OUT
allow(plugin).to receive(:which).with("systemd-path").and_return("/bin/systemd-path")
allow(plugin).to receive(:shell_out).with("/bin/systemd-path").and_return(mock_shell_out(0, systemd_path_out, ""))
diff --git a/spec/unit/plugins/linux/virtualization_spec.rb b/spec/unit/plugins/linux/virtualization_spec.rb
index 13c195ea..45cddec2 100644
--- a/spec/unit/plugins/linux/virtualization_spec.rb
+++ b/spec/unit/plugins/linux/virtualization_spec.rb
@@ -349,7 +349,7 @@ describe Ohai::System, "Linux virtualization platform" do
3:cpuacct:/lxc/baa660ed81bc81d262ac6e19486142aeec5fce2043e2a173eb2505c6fbed89bc
2:cpu:/lxc/baa660ed81bc81d262ac6e19486142aeec5fce2043e2a173eb2505c6fbed89bc
1:cpuset:/
-CGROUP
+ CGROUP
expect(File).to receive(:exist?).with("/proc/self/cgroup").and_return(true)
allow(File).to receive(:read).with("/proc/self/cgroup").and_return(self_cgroup)
plugin.run
@@ -368,7 +368,7 @@ CGROUP
3:cpuacct:/lxc/vanilla
2:cpu:/lxc/vanilla
1:cpuset:/lxc/vanilla
-CGROUP
+ CGROUP
expect(File).to receive(:exist?).with("/proc/self/cgroup").and_return(true)
allow(File).to receive(:read).with("/proc/self/cgroup").and_return(self_cgroup)
plugin.run
@@ -387,7 +387,7 @@ CGROUP
3:cpuacct:/Charlie
2:cpu:/Charlie
1:cpuset:/Charlie
-CGROUP
+ CGROUP
allow(File).to receive(:read).with("/proc/1/environ").and_return("")
expect(File).to receive(:exist?).with("/proc/self/cgroup").and_return(true)
allow(File).to receive(:read).with("/proc/self/cgroup").and_return(self_cgroup)
@@ -406,7 +406,7 @@ CGROUP
3:cpuacct:/
2:cpu:/
1:cpuset:/
-CGROUP
+ CGROUP
expect(File).to receive(:exist?).with("/proc/self/cgroup").and_return(true)
allow(File).to receive(:read).with("/proc/self/cgroup").and_return(self_cgroup)
allow(File).to receive(:read).with("/proc/1/environ").and_return("")
@@ -485,7 +485,7 @@ CGROUP
3:cpuacct:/docker/baa660ed81bc81d262ac6e19486142aeec5fce2043e2a173eb2505c6fbed89bc
2:cpu:/docker/baa660ed81bc81d262ac6e19486142aeec5fce2043e2a173eb2505c6fbed89bc
1:cpuset:/
-CGROUP
+ CGROUP
allow(File).to receive(:exist?).with("/proc/self/cgroup").and_return(true)
allow(File).to receive(:read).with("/proc/self/cgroup").and_return(self_cgroup)
plugin.run
@@ -504,7 +504,7 @@ CGROUP
3:cpuacct:/docker/vanilla
2:cpu:/docker/vanilla
1:cpuset:/docker/vanilla
-CGROUP
+ CGROUP
allow(File).to receive(:exist?).with("/proc/self/cgroup").and_return(true)
allow(File).to receive(:read).with("/proc/self/cgroup").and_return(self_cgroup)
plugin.run
@@ -528,7 +528,7 @@ CGROUP
3:cpuacct:/docker-ce/docker/b15b85d19304436488a78d06afeb108d94b20bb6898d852b65cad51bd7dc9468
2:cpu:/docker-ce/docker/b15b85d19304436488a78d06afeb108d94b20bb6898d852b65cad51bd7dc9468
1:cpuset:/docker-ce/docker/b15b85d19304436488a78d06afeb108d94b20bb6898d852b65cad51bd7dc9468
-CGROUP
+ CGROUP
allow(File).to receive(:exist?).with("/proc/self/cgroup").and_return(true)
allow(File).to receive(:read).with("/proc/self/cgroup").and_return(self_cgroup)
plugin.run
@@ -549,7 +549,7 @@ CGROUP
3:memory:/system.slice/docker-47341c91be8d491cb3b8a475ad5b4aef6e79bf728cbb351c384e4a6c410f172f.scope
2:cpu,cpuacct:/system.slice/docker-47341c91be8d491cb3b8a475ad5b4aef6e79bf728cbb351c384e4a6c410f172f.scope
1:name=systemd:/system.slice/docker-47341c91be8d491cb3b8a475ad5b4aef6e79bf728cbb351c384e4a6c410f172f.scope
-CGROUP
+ CGROUP
allow(File).to receive(:exist?).with("/proc/self/cgroup").and_return(true)
allow(File).to receive(:read).with("/proc/self/cgroup").and_return(self_cgroup)
plugin.run
@@ -568,7 +568,7 @@ CGROUP
3:cpuacct:/Charlie
2:cpu:/Charlie
1:cpuset:/Charlie
-CGROUP
+ CGROUP
allow(File).to receive(:exist?).with("/proc/self/cgroup").and_return(true)
allow(File).to receive(:read).with("/proc/self/cgroup").and_return(self_cgroup)
allow(File).to receive(:read).with("/proc/1/environ").and_return("")
@@ -587,7 +587,7 @@ CGROUP
3:cpuacct:/
2:cpu:/
1:cpuset:/
-CGROUP
+ CGROUP
allow(File).to receive(:exist?).with("/proc/self/cgroup").and_return(true)
allow(File).to receive(:read).with("/proc/self/cgroup").and_return(self_cgroup)
plugin.run
diff --git a/spec/unit/plugins/mono_spec.rb b/spec/unit/plugins/mono_spec.rb
index 0376e092..c60f3961 100644
--- a/spec/unit/plugins/mono_spec.rb
+++ b/spec/unit/plugins/mono_spec.rb
@@ -34,7 +34,7 @@ describe Ohai::System, "plugin mono" do
Misc: softdebug
LLVM: supported, not enabled.
GC: sgen
-OUT
+ OUT
allow(plugin).to receive(:shell_out).with("mono -V").and_return(mock_shell_out(0, @stdout, ""))
end
diff --git a/spec/unit/plugins/openstack_spec.rb b/spec/unit/plugins/openstack_spec.rb
index 388b2ac9..7089c7bf 100644
--- a/spec/unit/plugins/openstack_spec.rb
+++ b/spec/unit/plugins/openstack_spec.rb
@@ -146,7 +146,7 @@ describe Ohai::System, "plugin openstack" do
instance-action
aki-id
block-device-mapping/
-EOM
+ EOM
end
let(:metadata_values) do
diff --git a/spec/unit/plugins/php_spec.rb b/spec/unit/plugins/php_spec.rb
index 99d416e7..fcb38bbc 100644
--- a/spec/unit/plugins/php_spec.rb
+++ b/spec/unit/plugins/php_spec.rb
@@ -29,7 +29,7 @@ describe Ohai::System, "plugin php" do
PHP 5.1.6 (cli) (built: Jul 16 2008 19:52:52)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies
-OUT
+ OUT
allow(plugin).to receive(:shell_out).with("php -v").and_return(mock_shell_out(0, @stdout, ""))
end
@@ -49,7 +49,7 @@ OUT
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies
-OUT
+ OUT
allow(plugin).to receive(:shell_out).with("php -v").and_return(mock_shell_out(0, stdout, ""))
plugin.run
expect(plugin.languages[:php][:version]).to eql("7.0.4-7ubuntu2.1")
@@ -66,7 +66,7 @@ OUT
PHP 5.3.27 with Suhosin-Patch (cli) (built: Aug 30 2013 04:30:30)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2013 Zend Technologies
-OUT
+ OUT
allow(plugin).to receive(:shell_out).with("php -v").and_return(mock_shell_out(0, stdout, ""))
plugin.run
expect(plugin.languages[:php][:builddate]).to eql("Aug 30 2013 04:30:30")
@@ -77,7 +77,7 @@ OUT
PHP 5.1.6 (cli) (built: Jul 16 2008 19:52:52)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies
-OUT
+ OUT
allow(plugin).to receive(:shell_out).with("php -v").and_return(mock_shell_out(0, stdout, ""))
plugin.run
expect(plugin.languages[:php]).not_to have_key(:zend_opcache_version)
@@ -89,7 +89,7 @@ OUT
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies
-OUT
+ OUT
allow(plugin).to receive(:shell_out).with("php -v").and_return(mock_shell_out(0, stdout, ""))
plugin.run
expect(plugin.languages[:php][:zend_opcache_version]).to eql("7.0.3")
diff --git a/spec/unit/plugins/powershell_spec.rb b/spec/unit/plugins/powershell_spec.rb
index d9e48603..92fe0fb5 100644
--- a/spec/unit/plugins/powershell_spec.rb
+++ b/spec/unit/plugins/powershell_spec.rb
@@ -42,7 +42,7 @@ describe Ohai::System, "plugin powershell" do
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0}
PSRemotingProtocolVersion 2.2
-END
+ END
compat_version_array = ["1.0", "2.0", "3.0", "4.0"]
allow(plugin).to receive(:shell_out).with(anything).and_return(mock_shell_out(0, v4_output, ""))
@@ -61,7 +61,7 @@ END
error_output = <<~END
'powershell.exe' is not recognized as an internal or external command,
operable program or batch file.
-END
+ END
allow(plugin).to receive(:shell_out).with(anything).and_return(mock_shell_out(1, error_output, ""))
plugin.run
diff --git a/spec/unit/plugins/rackspace_spec.rb b/spec/unit/plugins/rackspace_spec.rb
index 6c68b841..99c82621 100644
--- a/spec/unit/plugins/rackspace_spec.rb
+++ b/spec/unit/plugins/rackspace_spec.rb
@@ -137,7 +137,7 @@ describe Ohai::System, "plugin rackspace" do
server_id = "21301000"
created_at = "2012-12-06T22:08:16Z"
region = "dfw"
-OUT
+ OUT
allow(plugin).to receive(:shell_out).with("xenstore-ls vm-data/provider_data").and_return(mock_shell_out(0, provider_data, ""))
plugin.run
expect(plugin[:rackspace][:region]).to eq("dfw")
diff --git a/spec/unit/plugins/scsi_spec.rb b/spec/unit/plugins/scsi_spec.rb
index 394e0cb7..e2f2fc34 100644
--- a/spec/unit/plugins/scsi_spec.rb
+++ b/spec/unit/plugins/scsi_spec.rb
@@ -29,7 +29,7 @@ describe Ohai::System, "lsscsi plugin" do
[6:2:2:0] disk LSI MR9286CV-8e 3.41 /dev/sdd
[6:2:3:0] disk LSI MR9286CV-8e 3.41 /dev/sde
[6:2:4:0] disk LSI MR9286CV-8e 3.41 /dev/sdf
-LSSCSI
+ LSSCSI
allow(plugin).to receive(:shell_out).with("lsscsi").and_return(
mock_shell_out(0, @stdout, ""))
plugin.run
diff --git a/spec/unit/plugins/solaris2/cpu_spec.rb b/spec/unit/plugins/solaris2/cpu_spec.rb
index acee1cbc..83be6589 100644
--- a/spec/unit/plugins/solaris2/cpu_spec.rb
+++ b/spec/unit/plugins/solaris2/cpu_spec.rb
@@ -441,7 +441,7 @@ describe Ohai::System, "Solaris2.X cpu plugin" do
cpu_info:15:cpu_info15:supported_frequencies_Hz 2925945978
cpu_info:15:cpu_info15:supported_max_cstates 1
cpu_info:15:cpu_info15:vendor_id GenuineIntel
-END
+ END
allow(@plugin).to receive(:shell_out).with("kstat -p cpu_info").and_return(mock_shell_out(0, kstatinfo_output, ""))
@plugin.run
end
@@ -2807,7 +2807,7 @@ END
cpu_info:127:cpu_info127:state off-line
cpu_info:127:cpu_info127:state_begin 1430258903
cpu_info:127:cpu_info127:supported_frequencies_Hz 1648762500
-END
+ END
allow(@plugin).to receive(:shell_out).with("kstat -p cpu_info").and_return(mock_shell_out(0, kstatinfo_output, ""))
@plugin.run
end
diff --git a/spec/unit/plugins/solaris2/filesystem.rb b/spec/unit/plugins/solaris2/filesystem.rb
index b48dd1db..a91eb926 100644
--- a/spec/unit/plugins/solaris2/filesystem.rb
+++ b/spec/unit/plugins/solaris2/filesystem.rb
@@ -60,7 +60,7 @@ describe Ohai::System, "Solaris2.X filesystem plugin" do
-hosts 0 0 0 0% /net
auto_home 0 0 0 0% /home
-fedfs 0 0 0 0% /nfs4
-DF_PKA
+ DF_PKA
@mount = <<~MOUNT
/ on rpool/ROOT/solaris-0 read/write/setuid/nodevices/rstchown/nonbmand/exec/xattr/atime/mountpoint=/zones/servername.chef.internal.dns/root//zone=servername.chef.internal.dns/nozonemod/sharezone=151/dev=4bd0b7e on Fri Feb 2 16:27:36 2018
@@ -82,7 +82,7 @@ DF_PKA
/var/share/pkg/repositories on rpool/VARSHARE/pkg/repositories read/write/setuid/nodevices/rstchown/nonbmand/exec/xattr/atime/zone=servername.chef.internal.dns/sharezone=151/dev=4bd0b85 on Fri Feb 2 16:28:12 2018
/export/home/<usernameredacted> on rpool/export/home/<usernameredacted> read/write/setuid/nodevices/rstchown/nonbmand/exec/xattr/atime/zone=servername.chef.internal.dns/sharezone=151/dev=4bd0b8a on Fri Feb 2 16:39:15 2018
/export/home/<usernameredacted> on rpool/export/home/<usernameredacted> read/write/setuid/nodevices/rstchown/nonbmand/exec/xattr/atime/zone=servername.chef.internal.dns/sharezone=151/dev=4bd0b8b on Fri Feb 2 16:39:16 2018
-MOUNT
+ MOUNT
@zfs_get = <<~ZFS_GET
data0 type filesystem -
@@ -323,7 +323,7 @@ MOUNT
data0/Movies relatime off default
data0/Movies redundant_metadata all default
data0/Movies overlay off default:
-ZFS_GET
+ ZFS_GET
end
after(:each) do
diff --git a/spec/unit/plugins/solaris2/network_spec.rb b/spec/unit/plugins/solaris2/network_spec.rb
index 465c1a4e..a14c1a65 100644
--- a/spec/unit/plugins/solaris2/network_spec.rb
+++ b/spec/unit/plugins/solaris2/network_spec.rb
@@ -41,7 +41,7 @@ describe Ohai::System, "Solaris2.X network plugin" do
rtls0 172.31.4.82 255.255.255.255 52:54:00:2d:93:0c
rtls0 172.31.4.81 255.255.255.255 02:08:20:37:80:87
rtls0 224.0.0.0 240.0.0.0 SM 01:00:5e:00:00:00
-ARP_RN
+ ARP_RN
@solaris_ifconfig = <<~ENDIFCONFIG
lo0:3: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
@@ -80,7 +80,7 @@ ARP_RN
vni0: flags=2002210041<UP,RUNNING,NOXMIT,NONUD,IPv6,VIRTUAL> mtu 1460 index 5
srcof qfe1
inet6 fe80::203:baff:fe17:4444/128
-ENDIFCONFIG
+ ENDIFCONFIG
@solaris_netstat_rn = <<~NETSTAT_RN
Routing Table: IPv4
@@ -95,7 +95,7 @@ ENDIFCONFIG
--------------------------- --------------------------- ----- --- ------- -----
fe80::/10 fe80::250:56ff:fe13:3757 U 1 0 e1000g0
::1 ::1 UH 1 0 lo0
-NETSTAT_RN
+ NETSTAT_RN
@solaris_route_get = <<~ROUTE_GET
route to: default
@@ -106,7 +106,7 @@ NETSTAT_RN
flags: <UP,GATEWAY,DONE,STATIC>
recvpipe sendpipe ssthresh rtt,ms rttvar,ms hopcount mtu expire
0 0 0 0 0 0 1500 0
-ROUTE_GET
+ ROUTE_GET
@solaris11_route_get = <<~ROUTE_GET
route to: default
@@ -117,7 +117,7 @@ ROUTE_GET
flags: <UP,GATEWAY,DONE,STATIC>
recvpipe sendpipe ssthresh rtt,ms rttvar,ms hopcount mtu expire
0 0 0 0 0 0 1500 0
-ROUTE_GET
+ ROUTE_GET
@ifconfig_lines = @solaris_ifconfig.split("\n")
diff --git a/spec/unit/plugins/solaris2/platform_spec.rb b/spec/unit/plugins/solaris2/platform_spec.rb
index 4803a5f0..c819ec9a 100644
--- a/spec/unit/plugins/solaris2/platform_spec.rb
+++ b/spec/unit/plugins/solaris2/platform_spec.rb
@@ -39,7 +39,7 @@ describe Ohai::System, "Solaris plugin platform" do
OEM# = 0
Origin# = 1
NumCPU = 16
-UNAME_X
+ UNAME_X
allow(File).to receive(:exist?).with("/sbin/uname").and_return(true)
allow(@plugin).to receive(:shell_out).with("/sbin/uname -X").and_return(mock_shell_out(0, @uname_x, ""))
@@ -79,7 +79,7 @@ UNAME_X
OEM# = 0
Origin# = 1
NumCPU = 1
-UNAME_X
+ UNAME_X
allow(File).to receive(:exist?).with("/sbin/uname").and_return(true)
allow(@plugin).to receive(:shell_out).with("/sbin/uname -X").and_return(mock_shell_out(0, @uname_x, ""))
diff --git a/spec/unit/plugins/solaris2/virtualization_spec.rb b/spec/unit/plugins/solaris2/virtualization_spec.rb
index 1208c203..e1df7194 100644
--- a/spec/unit/plugins/solaris2/virtualization_spec.rb
+++ b/spec/unit/plugins/solaris2/virtualization_spec.rb
@@ -26,7 +26,7 @@ describe Ohai::System, "Solaris virtualization platform" do
The physical processor has 1 virtual processor (0)
x86 (GenuineIntel family 6 model 2 step 3 clock 2667 MHz)
Intel Pentium(r) Pro
-PSRINFO_PV
+ PSRINFO_PV
allow(plugin).to receive(:collect_os).and_return(:solaris2)
diff --git a/spec/unit/plugins/ssh_host_keys_spec.rb b/spec/unit/plugins/ssh_host_keys_spec.rb
index 53b1cd4f..e3017ee9 100644
--- a/spec/unit/plugins/ssh_host_keys_spec.rb
+++ b/spec/unit/plugins/ssh_host_keys_spec.rb
@@ -81,7 +81,7 @@ describe Ohai::System, "ssh_host_key plugin" do
HostKey /etc/ssh/ssh_host_dsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
HostKey /etc/ssh/ssh_host_ed25519_key
-EOS
+ EOS
end
it_behaves_like "loads keys"
end
@@ -94,7 +94,7 @@ EOS
#HostKey /etc/ssh/ssh_host_dsa_key
#HostKey /etc/ssh/ssh_host_ecdsa_key
#HostKey /etc/ssh/ssh_host_ed25519_key
-EOS
+ EOS
end
it_behaves_like "loads keys"
end
diff --git a/spec/unit/plugins/sysconf_spec.rb b/spec/unit/plugins/sysconf_spec.rb
index ae6eca96..205be184 100644
--- a/spec/unit/plugins/sysconf_spec.rb
+++ b/spec/unit/plugins/sysconf_spec.rb
@@ -343,7 +343,7 @@ describe Ohai::System, "sysconf plugin", :unix_only do
RAW_SOCKETS 200809
_POSIX_IPV6 200809
_POSIX_RAW_SOCKETS 200809
-GETCONF_OUT
+ GETCONF_OUT
allow(plugin).to receive(:which).with("getconf").and_return("/usr/bin/getconf")
allow(plugin).to receive(:shell_out).with("/usr/bin/getconf -a").and_return(mock_shell_out(0, getconf_out, ""))
allow(plugin).to receive(:collect_os).and_return(:linux)
diff --git a/spec/unit/plugins/windows/filesystem_spec.rb b/spec/unit/plugins/windows/filesystem_spec.rb
index 45b8be81..19c95a6c 100644
--- a/spec/unit/plugins/windows/filesystem_spec.rb
+++ b/spec/unit/plugins/windows/filesystem_spec.rb
@@ -41,7 +41,7 @@ describe Ohai::System, "Windows Filesystem Plugin", :windows_only do
"size" => "10000000",
"filesystem" => "FAT32",
"freespace" => "100000",
- "name" => "D:"
+ "name" => "D:",
# Lets not pass "volumename" for this drive
}
]
diff --git a/spec/unit/plugins/windows/memory_spec.rb b/spec/unit/plugins/windows/memory_spec.rb
index d429435b..5e8d97c2 100644
--- a/spec/unit/plugins/windows/memory_spec.rb
+++ b/spec/unit/plugins/windows/memory_spec.rb
@@ -24,7 +24,7 @@ describe Ohai::System, "Windows memory plugin", :windows_only do
"TotalVisibleMemorySize" => "10485760",
"FreePhysicalMemory" => "5242880",
"SizeStoredInPagingFiles" => "20971520",
- "FreeSpaceInPagingFiles" => "15728640",
+ "FreeSpaceInPagingFiles" => "15728640",
}
expect_any_instance_of(WmiLite::Wmi).to receive(:first_of).with("Win32_OperatingSystem").and_return(mock_os)
end
diff --git a/spec/unit/plugins/zpools_spec.rb b/spec/unit/plugins/zpools_spec.rb
index 2da65e2d..3dd53a34 100644
--- a/spec/unit/plugins/zpools_spec.rb
+++ b/spec/unit/plugins/zpools_spec.rb
@@ -42,13 +42,13 @@ describe Ohai::System, "zpools plugin" do
sdl ONLINE 0 0 0
sdm ONLINE 0 0 0
sdn ONLINE 0 0 0
-EOST
+ EOST
end
let(:zpool_out) do
<<~EOZO
rpool 109G 66.2G 42.8G 60% 1.00x ONLINE -
tank 130T 4.91M 130T 0% 1.00x ONLINE -
-EOZO
+ EOZO
end
let(:zpool_status_rpool) do
<<-EOSR
@@ -64,7 +64,7 @@ EOZO
sdb ONLINE 0 0 0
errors: No known data errors
-EOSR
+ EOSR
end
before do
allow(plugin).to receive(:platform_family).and_return("rhel")
@@ -153,13 +153,13 @@ EOSR
c1t50014EE25F697DC4d0 ONLINE 0 0 0
c1t50014EE25F698BECd0 ONLINE 0 0 0
c1t50014EE25F6998DAd0 ONLINE 0 0 0
-EOST
+ EOST
end
let(:zpool_out) do
<<~EOZO
rpool 109G 66.2G 42.8G 60% 1.00x ONLINE 34
tank 130T 4.91M 130T 0% 1.00x ONLINE 34
-EOZO
+ EOZO
end
let(:zpool_status_rpool) do
<<~EOSR
@@ -175,7 +175,7 @@ EOZO
c3t4d0s0 ONLINE 0 0 0
errors: No known data errors
-EOSR
+ EOSR
end
before do
allow(plugin).to receive(:platform_family).and_return("solaris2")
diff --git a/spec/unit/system_spec.rb b/spec/unit/system_spec.rb
index 3e704df3..c74d1f90 100644
--- a/spec/unit/system_spec.rb
+++ b/spec/unit/system_spec.rb
@@ -102,25 +102,25 @@ describe "Ohai::System" do
Ohai.plugin(:Zoo) do
provides 'seals'
end
-EOF
+ EOF
with_plugin("repo1/lake.rb", <<~EOF)
Ohai.plugin(:Nature) do
provides 'fish'
end
-EOF
+ EOF
with_plugin("repo2/nature.rb", <<~EOF)
Ohai.plugin(:Nature) do
provides 'crabs'
end
-EOF
+ EOF
with_plugin("repo2/mountain.rb", <<~EOF)
Ohai.plugin(:Nature) do
provides 'bear'
end
-EOF
+ EOF
before do
Ohai.config[:plugin_path] = [ path_to("repo1"), path_to("repo2") ]
@@ -150,7 +150,7 @@ EOF
message("platform_specific_message")
end
end
-EOF
+ EOF
it "should collect platform specific" do
Ohai.config[:plugin_path] = [ path_to(".") ]
@@ -168,7 +168,7 @@ EOF
zoo("animals")
end
end
-EOF
+ EOF
with_plugin("park.rb", <<~EOF)
Ohai.plugin(:Park) do
@@ -177,7 +177,7 @@ EOF
park("plants")
end
end
-EOF
+ EOF
with_plugin("fails.rb", <<~EOF)
Ohai.plugin(:Fails) do
@@ -186,7 +186,7 @@ EOF
fail 'thing'
end
end
-EOF
+ EOF
with_plugin("optional.rb", <<~EOF)
Ohai.plugin(:Optional) do
@@ -197,7 +197,7 @@ EOF
optional("canteloupe")
end
end
-EOF
+ EOF
it "should collect data from all the plugins" do
Ohai.config[:plugin_path] = [ path_to(".") ]