summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYukihiko SAWANOBORI <sawanoboriyu@higanworks.com>2020-11-22 23:32:53 +0900
committerGitHub <noreply@github.com>2020-11-22 23:32:53 +0900
commita807a2c2d52890c72700b722e87184e47311ba3a (patch)
treed2682966a499d2761929f43bd876ef30c299c38b
parent15bfc271b6146a865dbb984405695fdf2adc2f1f (diff)
parenta0ac22ca5a5561bdb44e05e00c87babacb158b4a (diff)
downloadohai-a807a2c2d52890c72700b722e87184e47311ba3a.tar.gz
Merge branch 'master' into imds-v2
-rw-r--r--.expeditor/config.yml2
-rwxr-xr-x.expeditor/run_linux_tests.sh3
-rw-r--r--.expeditor/verify.pipeline.yml15
-rw-r--r--.gitignore5
-rw-r--r--.rubocop.yml9
-rw-r--r--CHANGELOG.md183
-rw-r--r--Gemfile17
-rw-r--r--README.md15
-rw-r--r--RELEASE_NOTES.md21
-rw-r--r--Rakefile11
-rw-r--r--VERSION2
-rwxr-xr-xbin/ohai5
-rw-r--r--cspell.json38
-rw-r--r--lib/ohai.rb3
-rw-r--r--lib/ohai/application.rb44
-rw-r--r--lib/ohai/common/dmi.rb11
-rw-r--r--lib/ohai/config.rb6
-rw-r--r--lib/ohai/dsl.rb3
-rw-r--r--lib/ohai/dsl/plugin.rb20
-rw-r--r--lib/ohai/dsl/plugin/versionvii.rb45
-rw-r--r--lib/ohai/exception.rb3
-rw-r--r--lib/ohai/hints.rb3
-rw-r--r--lib/ohai/loader.rb5
-rw-r--r--lib/ohai/log.rb5
-rw-r--r--lib/ohai/mash.rb223
-rw-r--r--lib/ohai/mixin/azure_metadata.rb5
-rw-r--r--lib/ohai/mixin/chef_utils_wiring.rb52
-rw-r--r--lib/ohai/mixin/command.rb58
-rw-r--r--lib/ohai/mixin/constant_helper.rb3
-rw-r--r--lib/ohai/mixin/dmi_decode.rb7
-rw-r--r--lib/ohai/mixin/do_metadata.rb7
-rw-r--r--lib/ohai/mixin/ec2_metadata.rb9
-rw-r--r--lib/ohai/mixin/gce_metadata.rb5
-rw-r--r--lib/ohai/mixin/http_helper.rb3
-rw-r--r--lib/ohai/mixin/network_helper.rb3
-rw-r--r--lib/ohai/mixin/os.rb72
-rw-r--r--lib/ohai/mixin/scaleway_metadata.rb7
-rw-r--r--lib/ohai/mixin/seconds_to_human.rb3
-rw-r--r--lib/ohai/mixin/shell_out.rb51
-rw-r--r--lib/ohai/mixin/softlayer_metadata.rb5
-rw-r--r--lib/ohai/mixin/string.rb3
-rw-r--r--lib/ohai/mixin/train_helpers.rb36
-rw-r--r--lib/ohai/mixin/which.rb39
-rw-r--r--lib/ohai/plugin_config.rb3
-rw-r--r--lib/ohai/plugins/aix/kernel.rb13
-rw-r--r--lib/ohai/plugins/aix/memory.rb15
-rw-r--r--lib/ohai/plugins/aix/network.rb107
-rw-r--r--lib/ohai/plugins/aix/platform.rb7
-rw-r--r--lib/ohai/plugins/aix/uptime.rb11
-rw-r--r--lib/ohai/plugins/aix/virtualization.rb24
-rw-r--r--lib/ohai/plugins/azure.rb33
-rw-r--r--lib/ohai/plugins/bsd/virtualization.rb13
-rw-r--r--lib/ohai/plugins/c.rb5
-rw-r--r--lib/ohai/plugins/chef.rb3
-rw-r--r--lib/ohai/plugins/cloud.rb5
-rw-r--r--lib/ohai/plugins/command.rb3
-rw-r--r--lib/ohai/plugins/cpu.rb35
-rw-r--r--lib/ohai/plugins/darwin/hardware.rb5
-rw-r--r--lib/ohai/plugins/darwin/memory.rb7
-rw-r--r--lib/ohai/plugins/darwin/network.rb11
-rw-r--r--lib/ohai/plugins/darwin/platform.rb12
-rw-r--r--lib/ohai/plugins/darwin/virtualization.rb7
-rw-r--r--lib/ohai/plugins/digital_ocean.rb1
-rw-r--r--lib/ohai/plugins/dmi.rb3
-rw-r--r--lib/ohai/plugins/docker.rb7
-rw-r--r--lib/ohai/plugins/dragonflybsd/memory.rb17
-rw-r--r--lib/ohai/plugins/dragonflybsd/network.rb1
-rw-r--r--lib/ohai/plugins/dragonflybsd/platform.rb7
-rw-r--r--lib/ohai/plugins/ec2.rb38
-rw-r--r--lib/ohai/plugins/elixir.rb2
-rw-r--r--lib/ohai/plugins/erlang.rb3
-rw-r--r--lib/ohai/plugins/eucalyptus.rb7
-rw-r--r--lib/ohai/plugins/filesystem.rb38
-rw-r--r--lib/ohai/plugins/fips.rb9
-rw-r--r--lib/ohai/plugins/freebsd/memory.rb17
-rw-r--r--lib/ohai/plugins/freebsd/network.rb1
-rw-r--r--lib/ohai/plugins/freebsd/platform.rb7
-rw-r--r--lib/ohai/plugins/gce.rb11
-rw-r--r--lib/ohai/plugins/go.rb2
-rw-r--r--lib/ohai/plugins/groovy.rb2
-rw-r--r--lib/ohai/plugins/haskell.rb1
-rw-r--r--lib/ohai/plugins/hostname.rb38
-rw-r--r--lib/ohai/plugins/init_package.rb5
-rw-r--r--lib/ohai/plugins/java.rb3
-rw-r--r--lib/ohai/plugins/joyent.rb77
-rw-r--r--lib/ohai/plugins/kernel.rb42
-rw-r--r--lib/ohai/plugins/keys.rb3
-rw-r--r--lib/ohai/plugins/languages.rb3
-rw-r--r--lib/ohai/plugins/libvirt.rb3
-rw-r--r--lib/ohai/plugins/linode.rb3
-rw-r--r--lib/ohai/plugins/linux/block_device.rb19
-rw-r--r--lib/ohai/plugins/linux/hostnamectl.rb8
-rw-r--r--lib/ohai/plugins/linux/interrupts.rb9
-rw-r--r--lib/ohai/plugins/linux/ipc.rb3
-rw-r--r--lib/ohai/plugins/linux/lsb.rb32
-rw-r--r--lib/ohai/plugins/linux/lspci.rb4
-rw-r--r--lib/ohai/plugins/linux/machineid.rb13
-rw-r--r--lib/ohai/plugins/linux/mdadm.rb7
-rw-r--r--lib/ohai/plugins/linux/memory.rb77
-rw-r--r--lib/ohai/plugins/linux/network.rb57
-rw-r--r--lib/ohai/plugins/linux/platform.rb110
-rw-r--r--lib/ohai/plugins/linux/selinux.rb69
-rw-r--r--lib/ohai/plugins/linux/sessions.rb1
-rw-r--r--lib/ohai/plugins/linux/sysctl.rb1
-rw-r--r--lib/ohai/plugins/linux/systemd_paths.rb1
-rw-r--r--lib/ohai/plugins/linux/virtualization.rb60
-rw-r--r--lib/ohai/plugins/lua.rb2
-rw-r--r--lib/ohai/plugins/mono.rb2
-rw-r--r--lib/ohai/plugins/netbsd/memory.rb1
-rw-r--r--lib/ohai/plugins/netbsd/network.rb13
-rw-r--r--lib/ohai/plugins/netbsd/platform.rb7
-rw-r--r--lib/ohai/plugins/network.rb12
-rw-r--r--lib/ohai/plugins/nodejs.rb2
-rw-r--r--lib/ohai/plugins/ohai.rb1
-rw-r--r--lib/ohai/plugins/ohai_time.rb5
-rw-r--r--lib/ohai/plugins/openbsd/memory.rb1
-rw-r--r--lib/ohai/plugins/openbsd/network.rb13
-rw-r--r--lib/ohai/plugins/openbsd/platform.rb7
-rw-r--r--lib/ohai/plugins/openstack.rb8
-rw-r--r--lib/ohai/plugins/os.rb9
-rw-r--r--lib/ohai/plugins/packages.rb25
-rw-r--r--lib/ohai/plugins/passwd.rb62
-rw-r--r--lib/ohai/plugins/perl.rb4
-rw-r--r--lib/ohai/plugins/php.rb2
-rw-r--r--lib/ohai/plugins/platform.rb3
-rw-r--r--lib/ohai/plugins/powershell.rb4
-rw-r--r--lib/ohai/plugins/ps.rb3
-rw-r--r--lib/ohai/plugins/python.rb4
-rw-r--r--lib/ohai/plugins/rackspace.rb16
-rw-r--r--lib/ohai/plugins/root_group.rb3
-rw-r--r--lib/ohai/plugins/ruby.rb22
-rw-r--r--lib/ohai/plugins/rust.rb2
-rw-r--r--lib/ohai/plugins/scala.rb1
-rw-r--r--lib/ohai/plugins/scaleway.rb3
-rw-r--r--lib/ohai/plugins/scsi.rb1
-rw-r--r--lib/ohai/plugins/shard.rb6
-rw-r--r--lib/ohai/plugins/shells.rb7
-rw-r--r--lib/ohai/plugins/softlayer.rb3
-rw-r--r--lib/ohai/plugins/solaris2/dmi.rb8
-rw-r--r--lib/ohai/plugins/solaris2/memory.rb4
-rw-r--r--lib/ohai/plugins/solaris2/network.rb23
-rw-r--r--lib/ohai/plugins/solaris2/platform.rb27
-rw-r--r--lib/ohai/plugins/solaris2/virtualization.rb16
-rw-r--r--lib/ohai/plugins/ssh_host_key.rb29
-rw-r--r--lib/ohai/plugins/sysconf.rb1
-rw-r--r--lib/ohai/plugins/timezone.rb1
-rw-r--r--lib/ohai/plugins/train.rb36
-rw-r--r--lib/ohai/plugins/uptime.rb7
-rw-r--r--lib/ohai/plugins/virtualbox.rb7
-rw-r--r--lib/ohai/plugins/vmware.rb12
-rw-r--r--lib/ohai/plugins/windows/dmi.rb5
-rw-r--r--lib/ohai/plugins/windows/drivers.rb5
-rw-r--r--lib/ohai/plugins/windows/memory.rb3
-rw-r--r--lib/ohai/plugins/windows/network.rb13
-rw-r--r--lib/ohai/plugins/windows/platform.rb5
-rw-r--r--lib/ohai/plugins/windows/system_enclosure.rb3
-rw-r--r--lib/ohai/plugins/windows/virtualization.rb5
-rw-r--r--lib/ohai/plugins/zpools.rb9
-rw-r--r--lib/ohai/provides_map.rb7
-rw-r--r--lib/ohai/runner.rb15
-rw-r--r--lib/ohai/system.rb42
-rw-r--r--lib/ohai/train_transport.rb29
-rw-r--r--lib/ohai/util/file_helper.rb42
-rw-r--r--lib/ohai/util/ip_helper.rb5
-rw-r--r--lib/ohai/util/win32.rb5
-rw-r--r--lib/ohai/version.rb7
-rw-r--r--ohai.gemspec15
-rw-r--r--spec/data/plugins/system_profiler_spapplicationsdatatype.output8675
-rw-r--r--spec/functional/application_spec.rb2
-rw-r--r--spec/functional/loader_spec.rb2
-rw-r--r--spec/functional/plugins/linux/interrupts_spec.rb12
-rw-r--r--spec/functional/plugins/powershell_spec.rb4
-rw-r--r--spec/functional/plugins/root_group_spec.rb2
-rw-r--r--spec/functional/plugins/windows/uptime_spec.rb2
-rw-r--r--spec/ohai_spec.rb2
-rw-r--r--spec/spec_helper.rb16
-rw-r--r--spec/support/platform_helpers.rb12
-rw-r--r--spec/unit/application_spec.rb2
-rw-r--r--spec/unit/config_spec.rb2
-rw-r--r--spec/unit/dsl/plugin_spec.rb6
-rw-r--r--spec/unit/hints_spec.rb2
-rw-r--r--spec/unit/loader_spec.rb4
-rw-r--r--spec/unit/mixin/azure_metadata_spec.rb2
-rw-r--r--spec/unit/mixin/command_spec.rb151
-rw-r--r--spec/unit/mixin/dmi_decode_spec.rb4
-rw-r--r--spec/unit/mixin/ec2_metadata_spec.rb2
-rw-r--r--spec/unit/mixin/shell_out_spec.rb132
-rw-r--r--spec/unit/mixin/which_spec.rb (renamed from spec/unit/util/file_helper_spec.rb)12
-rw-r--r--spec/unit/plugin_config_spec.rb2
-rw-r--r--spec/unit/plugins/abort_spec.rb6
-rw-r--r--spec/unit/plugins/aix/cpu_spec.rb2
-rw-r--r--spec/unit/plugins/aix/filesystem_spec.rb8
-rw-r--r--spec/unit/plugins/aix/hostname_spec.rb3
-rw-r--r--spec/unit/plugins/aix/kernel_spec.rb12
-rw-r--r--spec/unit/plugins/aix/memory_spec.rb12
-rw-r--r--spec/unit/plugins/aix/network_spec.rb153
-rw-r--r--spec/unit/plugins/aix/platform_spec.rb5
-rw-r--r--spec/unit/plugins/aix/uptime_spec.rb3
-rw-r--r--spec/unit/plugins/aix/virtualization_spec.rb17
-rw-r--r--spec/unit/plugins/azure_spec.rb76
-rw-r--r--spec/unit/plugins/bsd/filesystem_spec.rb2
-rw-r--r--spec/unit/plugins/bsd/virtualization_spec.rb6
-rw-r--r--spec/unit/plugins/chef_spec.rb3
-rw-r--r--spec/unit/plugins/cloud_spec.rb1
-rw-r--r--spec/unit/plugins/darwin/cpu_spec.rb2
-rw-r--r--spec/unit/plugins/darwin/hostname_spec.rb2
-rw-r--r--spec/unit/plugins/darwin/kernel_spec.rb2
-rw-r--r--spec/unit/plugins/darwin/memory_spec.rb2
-rw-r--r--spec/unit/plugins/darwin/platform_spec.rb26
-rw-r--r--spec/unit/plugins/darwin/virtualization_spec.rb2
-rw-r--r--spec/unit/plugins/docker_spec.rb2
-rw-r--r--spec/unit/plugins/ec2_spec.rb43
-rw-r--r--spec/unit/plugins/erlang_spec.rb2
-rw-r--r--spec/unit/plugins/eucalyptus_spec.rb2
-rw-r--r--spec/unit/plugins/fail_spec.rb14
-rw-r--r--spec/unit/plugins/fips_spec.rb31
-rw-r--r--spec/unit/plugins/freebsd/hostname_spec.rb2
-rw-r--r--spec/unit/plugins/freebsd/kernel_spec.rb2
-rw-r--r--spec/unit/plugins/freebsd/platform_spec.rb2
-rw-r--r--spec/unit/plugins/hostname_spec.rb4
-rw-r--r--spec/unit/plugins/init_package_spec.rb2
-rw-r--r--spec/unit/plugins/java_spec.rb2
-rw-r--r--spec/unit/plugins/joyent_spec.rb100
-rw-r--r--spec/unit/plugins/kernel_spec.rb2
-rw-r--r--spec/unit/plugins/linux/block_device_spec.rb2
-rw-r--r--spec/unit/plugins/linux/cpu_spec.rb4
-rw-r--r--spec/unit/plugins/linux/filesystem_spec.rb2
-rw-r--r--spec/unit/plugins/linux/hostname_spec.rb2
-rw-r--r--spec/unit/plugins/linux/hostnamectl_spec.rb2
-rw-r--r--spec/unit/plugins/linux/interrupts_spec.rb12
-rw-r--r--spec/unit/plugins/linux/kernel_spec.rb6
-rw-r--r--spec/unit/plugins/linux/lsb_spec.rb36
-rw-r--r--spec/unit/plugins/linux/machineid_spec.rb10
-rw-r--r--spec/unit/plugins/linux/network_spec.rb32
-rw-r--r--spec/unit/plugins/linux/platform_spec.rb136
-rw-r--r--spec/unit/plugins/linux/selinux_spec.rb101
-rw-r--r--spec/unit/plugins/linux/sysctl_spec.rb2
-rw-r--r--spec/unit/plugins/linux/systemd_paths_spec.rb2
-rw-r--r--spec/unit/plugins/linux/uptime_spec.rb2
-rw-r--r--spec/unit/plugins/linux/virtualization_spec.rb198
-rw-r--r--spec/unit/plugins/lua_spec.rb2
-rw-r--r--spec/unit/plugins/netbsd/hostname_spec.rb2
-rw-r--r--spec/unit/plugins/netbsd/kernel_spec.rb4
-rw-r--r--spec/unit/plugins/netbsd/platform_spec.rb2
-rw-r--r--spec/unit/plugins/nodejs_spec.rb2
-rw-r--r--spec/unit/plugins/ohai_spec.rb2
-rw-r--r--spec/unit/plugins/ohai_time_spec.rb2
-rw-r--r--spec/unit/plugins/openbsd/hostname_spec.rb2
-rw-r--r--spec/unit/plugins/openbsd/kernel_spec.rb2
-rw-r--r--spec/unit/plugins/openbsd/platform_spec.rb2
-rw-r--r--spec/unit/plugins/openstack_spec.rb2
-rw-r--r--spec/unit/plugins/os_spec.rb2
-rw-r--r--spec/unit/plugins/packages_spec.rb49
-rw-r--r--spec/unit/plugins/passwd_spec.rb265
-rw-r--r--spec/unit/plugins/perl_spec.rb2
-rw-r--r--spec/unit/plugins/php_spec.rb2
-rw-r--r--spec/unit/plugins/platform_spec.rb2
-rw-r--r--spec/unit/plugins/powershell_spec.rb2
-rw-r--r--spec/unit/plugins/python_spec.rb2
-rw-r--r--spec/unit/plugins/ruby_spec.rb2
-rw-r--r--spec/unit/plugins/scaleway_spec.rb5
-rw-r--r--spec/unit/plugins/shells_spec.rb9
-rw-r--r--spec/unit/plugins/solaris2/dmi_spec.rb2
-rw-r--r--spec/unit/plugins/solaris2/filesystem.rb4
-rw-r--r--spec/unit/plugins/solaris2/hostname_spec.rb2
-rw-r--r--spec/unit/plugins/solaris2/platform_spec.rb142
-rw-r--r--spec/unit/plugins/solaris2/virtualization_spec.rb10
-rw-r--r--spec/unit/plugins/ssh_host_keys_spec.rb32
-rw-r--r--spec/unit/plugins/virtualbox_spec.rb2
-rw-r--r--spec/unit/plugins/windows/dmi_spec.rb2
-rw-r--r--spec/unit/plugins/windows/filesystem_spec.rb2
-rw-r--r--spec/unit/plugins/windows/kernel_spec.rb4
-rw-r--r--spec/unit/plugins/windows/memory_spec.rb2
-rw-r--r--spec/unit/plugins/windows/network_spec.rb1
-rw-r--r--spec/unit/plugins/windows/uptime_spec.rb2
-rw-r--r--spec/unit/plugins/windows/virtualization_spec.rb2
-rw-r--r--spec/unit/plugins/zpools_spec.rb26
-rw-r--r--spec/unit/provides_map_spec.rb2
-rw-r--r--spec/unit/runner_spec.rb2
-rw-r--r--spec/unit/system_spec.rb8
-rw-r--r--spec/unit/util/ip_helper_spec.rb1
-rw-r--r--tasks/spellcheck.rb49
282 files changed, 11645 insertions, 2018 deletions
diff --git a/.expeditor/config.yml b/.expeditor/config.yml
index 973aaa03..a077c467 100644
--- a/.expeditor/config.yml
+++ b/.expeditor/config.yml
@@ -28,8 +28,6 @@ github:
version_constraint: 16.*
- 15-stable:
version_constraint: 15.*
- - 14-stable:
- version_constraint: 14.*
changelog:
rollup_header: Changes not yet released to rubygems.org
diff --git a/.expeditor/run_linux_tests.sh b/.expeditor/run_linux_tests.sh
index 7df19364..3290515d 100755
--- a/.expeditor/run_linux_tests.sh
+++ b/.expeditor/run_linux_tests.sh
@@ -9,7 +9,8 @@ export LANG=C.UTF-8 LANGUAGE=C.UTF-8
echo "--- bundle install"
-bundle config --local path vendor/bundle
+# we need the ruby 2.7 version of bundler, the 2.5/2.6 versions cannot pull our Gemfile correctly
+gem install bundler
bundle install --jobs=7 --retry=3
echo "+++ bundle exec task"
diff --git a/.expeditor/verify.pipeline.yml b/.expeditor/verify.pipeline.yml
index 8ac91308..763e633c 100644
--- a/.expeditor/verify.pipeline.yml
+++ b/.expeditor/verify.pipeline.yml
@@ -1,7 +1,5 @@
---
expeditor:
- cached_folders:
- - vendor
defaults:
buildkite:
retry:
@@ -26,14 +24,6 @@ steps:
docker:
image: ruby:2.7-buster
-- label: run-specs-ruby-2.5
- command:
- - .expeditor/run_linux_tests.sh rspec
- expeditor:
- executor:
- docker:
- image: ruby:2.5-buster
-
- label: run-specs-ruby-2.6
command:
- .expeditor/run_linux_tests.sh rspec
@@ -52,8 +42,9 @@ steps:
- label: run-specs-windows
command:
- - bundle config --local path vendor/bundle
- - bundle install --jobs=7 --retry=3
+ # we need the ruby 2.7 version of bundler, the 2.5/2.6 versions cannot pull our Gemfile correctly
+ - gem install bundler
+ - bundle install --jobs=7 --retry=3 --without=profile
- bundle exec rake spec
expeditor:
executor:
diff --git a/.gitignore b/.gitignore
index f830aca3..567cff4f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -12,4 +12,7 @@ vendor
# yard
.yardoc
-doc/* \ No newline at end of file
+doc/*
+
+# our custom dictionary pulled from https://github.com/chef/chef_dictionary/
+chef_dictionary.txt \ No newline at end of file
diff --git a/.rubocop.yml b/.rubocop.yml
index 5a772c5f..9f82e5e8 100644
--- a/.rubocop.yml
+++ b/.rubocop.yml
@@ -1,4 +1,7 @@
+require: rubocop-performance
+
AllCops:
+ NewCops: enable
TargetRubyVersion: 2.5
Exclude:
- "spec/data/**/*"
@@ -10,3 +13,9 @@ Layout/IndentationStyle:
Exclude:
- "lib/ohai/plugins/mono.rb"
- "lib/ohai/plugins/darwin/hardware.rb"
+
+Performance/Caller:
+ Enabled: false
+
+Performance/CollectionLiteralInLoop:
+ Enabled: false \ No newline at end of file
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 84720e61..a4628689 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,40 +1,172 @@
# Change Log
-<!-- latest_release 16.0.20 -->
-## [v16.0.20](https://github.com/chef/ohai/tree/v16.0.20) (2020-04-25)
+<!-- latest_release 16.7.33 -->
+## [v16.7.33](https://github.com/chef/ohai/tree/v16.7.33) (2020-11-19)
#### Merged Pull Requests
-- Avoid constant warnings when reloading ohai plugins [#1456](https://github.com/chef/ohai/pull/1456) ([tas50](https://github.com/tas50))
+- aix virtualization: Fix lpar name detection [#1580](https://github.com/chef/ohai/pull/1580) ([tas50](https://github.com/tas50))
<!-- latest_release -->
-<!-- release_rollup since=15.7.3 -->
+<!-- release_rollup since=16.7.18 -->
### Changes not yet released to rubygems.org
#### Merged Pull Requests
-- Avoid constant warnings when reloading ohai plugins [#1456](https://github.com/chef/ohai/pull/1456) ([tas50](https://github.com/tas50)) <!-- 16.0.20 -->
-- Use correct DMI attribute name for product name [#1451](https://github.com/chef/ohai/pull/1451) ([ramereth](https://github.com/ramereth)) <!-- 16.0.19 -->
-- Add a plugin for Windows mimicing the Unix dmi plugin [#1445](https://github.com/chef/ohai/pull/1445) ([phiggins](https://github.com/phiggins)) <!-- 16.0.18 -->
-- Fix chefstyle violations. [#1449](https://github.com/chef/ohai/pull/1449) ([phiggins](https://github.com/phiggins)) <!-- 16.0.17 -->
-- Make shard plugin more resilient and throw better errors [#1446](https://github.com/chef/ohai/pull/1446) ([jaymzh](https://github.com/jaymzh)) <!-- 16.0.16 -->
-- Cache gem installs in Buildkite on Windows as well [#1444](https://github.com/chef/ohai/pull/1444) ([tas50](https://github.com/tas50)) <!-- 16.0.15 -->
-- Use native Expeditor gem caching &amp; fix code owners [#1443](https://github.com/chef/ohai/pull/1443) ([tas50](https://github.com/tas50)) <!-- 16.0.14 -->
-- Fix test failure from missing require. [#1442](https://github.com/chef/ohai/pull/1442) ([phiggins](https://github.com/phiggins)) <!-- 16.0.13 -->
-- Add a new ipc plugin for Linux [#1441](https://github.com/chef/ohai/pull/1441) ([davide125](https://github.com/davide125)) <!-- 16.0.12 -->
-- Add a new interrupts plugin for Linux [#1440](https://github.com/chef/ohai/pull/1440) ([davide125](https://github.com/davide125)) <!-- 16.0.11 -->
-- Expose NIC channel params, coalesce params, and driver info... [#1439](https://github.com/chef/ohai/pull/1439) ([matt-c-clark](https://github.com/matt-c-clark)) <!-- 16.0.10 -->
-- Add logic to fetch the latest azure metadata version [#1427](https://github.com/chef/ohai/pull/1427) ([tas50](https://github.com/tas50)) <!-- 16.0.9 -->
-- Combine Linux / Windows fips plugins into a single plugin [#1437](https://github.com/chef/ohai/pull/1437) ([tas50](https://github.com/tas50)) <!-- 16.0.8 -->
-- use bool instead of raise/rescue to detect linux user is exists [#1434](https://github.com/chef/ohai/pull/1434) ([sawanoboly](https://github.com/sawanoboly)) <!-- 16.0.7 -->
-- Minor testing updates [#1432](https://github.com/chef/ohai/pull/1432) ([tas50](https://github.com/tas50)) <!-- 16.0.6 -->
-- Chefstyle fixes from Rubocop 0.80 [#1431](https://github.com/chef/ohai/pull/1431) ([tas50](https://github.com/tas50)) <!-- 16.0.5 -->
-- Replace filesystem with filesystem2 on aix/solaris/bsd [#1426](https://github.com/chef/ohai/pull/1426) ([tas50](https://github.com/tas50)) <!-- 16.0.4 -->
-- fix [#1406]: ensure optional_plugins to be array of symbols [#1408](https://github.com/chef/ohai/pull/1408) ([salzig](https://github.com/salzig)) <!-- 16.0.3 -->
-- Use is_a? to check the class in the DMI plugin [#1423](https://github.com/chef/ohai/pull/1423) ([tas50](https://github.com/tas50)) <!-- 16.0.2 -->
-- Allow chef-config 16 [#1422](https://github.com/chef/ohai/pull/1422) ([tas50](https://github.com/tas50)) <!-- 16.0.1 -->
-- Bump to version 16.0.0 [#1420](https://github.com/chef/ohai/pull/1420) ([tas50](https://github.com/tas50)) <!-- 16.0.0 -->
+- aix virtualization: Fix lpar name detection [#1580](https://github.com/chef/ohai/pull/1580) ([tas50](https://github.com/tas50)) <!-- 16.7.33 -->
+- Use strip instead of split($/) to cleanup shellout [#1578](https://github.com/chef/ohai/pull/1578) ([tas50](https://github.com/tas50)) <!-- 16.7.32 -->
+- Simplify the aix kernel plugin [#1577](https://github.com/chef/ohai/pull/1577) ([tas50](https://github.com/tas50)) <!-- 16.7.31 -->
+- Gather WPAR state in the AIX virtualization plugin [#1576](https://github.com/chef/ohai/pull/1576) ([tas50](https://github.com/tas50)) <!-- 16.7.30 -->
+- Simplify aix platform / platform_family detection [#1575](https://github.com/chef/ohai/pull/1575) ([tas50](https://github.com/tas50)) <!-- 16.7.29 -->
+- Avoid calling uname 4 times on aix [#1574](https://github.com/chef/ohai/pull/1574) ([tas50](https://github.com/tas50)) <!-- 16.7.28 -->
+- More refactoring of the AIX network plugin [#1573](https://github.com/chef/ohai/pull/1573) ([tas50](https://github.com/tas50)) <!-- 16.7.27 -->
+- Simplify how we gather memory on AIX [#1572](https://github.com/chef/ohai/pull/1572) ([tas50](https://github.com/tas50)) <!-- 16.7.26 -->
+- Refactor how we parse ifconfig in AIX [#1570](https://github.com/chef/ohai/pull/1570) ([tas50](https://github.com/tas50)) <!-- 16.7.25 -->
+- Disable gem caching / rubygems updates in Buildkite [#1571](https://github.com/chef/ohai/pull/1571) ([tas50](https://github.com/tas50)) <!-- 16.7.24 -->
+- Remove the :Joyent plugin as Joyent cloud went EOL 11/2019 [#1569](https://github.com/chef/ohai/pull/1569) ([tas50](https://github.com/tas50)) <!-- 16.7.23 -->
+- Simplify all our splits [#1568](https://github.com/chef/ohai/pull/1568) ([tas50](https://github.com/tas50)) <!-- 16.7.22 -->
+- Minor performance optimizations in AIX Network plugin [#1567](https://github.com/chef/ohai/pull/1567) ([tas50](https://github.com/tas50)) <!-- 16.7.21 -->
+- Update rubocop-performance to 1.9 [#1565](https://github.com/chef/ohai/pull/1565) ([tas50](https://github.com/tas50)) <!-- 16.7.20 -->
+- Update mock logger to fix shellout specs. [#1566](https://github.com/chef/ohai/pull/1566) ([phiggins](https://github.com/phiggins)) <!-- 16.7.19 -->
<!-- release_rollup -->
<!-- latest_stable_release -->
+## [v16.7.18](https://github.com/chef/ohai/tree/v16.7.18) (2020-11-12)
+
+#### Merged Pull Requests
+- Remove the yard task for generating docs [#1536](https://github.com/chef/ohai/pull/1536) ([tas50](https://github.com/tas50))
+- Remove detection of opensolaris platform [#1542](https://github.com/chef/ohai/pull/1542) ([tas50](https://github.com/tas50))
+- Add unit testing for omnios platform detection [#1543](https://github.com/chef/ohai/pull/1543) ([tas50](https://github.com/tas50))
+- Remove detection of EOL NexentaCore [#1544](https://github.com/chef/ohai/pull/1544) ([tas50](https://github.com/tas50))
+- Properly detect OpenIndiana and its version numbers [#1545](https://github.com/chef/ohai/pull/1545) ([tas50](https://github.com/tas50))
+- Simplify regexes by removing extra character classes [#1548](https://github.com/chef/ohai/pull/1548) ([tas50](https://github.com/tas50))
+- Gather zpool disks even if zpools uses disk labels/guids [#1547](https://github.com/chef/ohai/pull/1547) ([tas50](https://github.com/tas50))
+- Split on strings intead of regex for 3x speedup [#1550](https://github.com/chef/ohai/pull/1550) ([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))
+- Freeze the strings we&#39;re not later modifying [#1551](https://github.com/chef/ohai/pull/1551) ([tas50](https://github.com/tas50))
+- Minor memory optimizations [#1553](https://github.com/chef/ohai/pull/1553) ([tas50](https://github.com/tas50))
+- pop_os is a derivative of ubuntu [#1555](https://github.com/chef/ohai/pull/1555) ([chasebolt](https://github.com/chasebolt))
+- Better format the elapsed plugin time [#1557](https://github.com/chef/ohai/pull/1557) ([tas50](https://github.com/tas50))
+- Speedup the slowest spec by running fewer plugins [#1556](https://github.com/chef/ohai/pull/1556) ([tas50](https://github.com/tas50))
+- Collapse duplicate branches in case statements [#1558](https://github.com/chef/ohai/pull/1558) ([tas50](https://github.com/tas50))
+- Fix parsing of hostnamectl to support values with colons [#1560](https://github.com/chef/ohai/pull/1560) ([tas50](https://github.com/tas50))
+- Remove regex anchors in the Linux Memory plugin [#1563](https://github.com/chef/ohai/pull/1563) ([tas50](https://github.com/tas50))
+- Remove Linux LSB support for systems without lsb-release CLI [#1562](https://github.com/chef/ohai/pull/1562) ([tas50](https://github.com/tas50))
+- Remove the line anchor from the LSB plugin matches [#1561](https://github.com/chef/ohai/pull/1561) ([tas50](https://github.com/tas50))
+<!-- latest_stable_release -->
+
+## [v16.6.5](https://github.com/chef/ohai/tree/v16.6.5) (2020-10-14)
+
+#### Merged Pull Requests
+- Detect Azure when DHCP domain is set to reddog.microsoft.com [#1521](https://github.com/chef/ohai/pull/1521) ([jasonwbarnett](https://github.com/jasonwbarnett))
+- Windows support for Passwd plugin [#1516](https://github.com/chef/ohai/pull/1516) ([jaymzh](https://github.com/jaymzh))
+- Remove ruby 2.5 from CI. [#1526](https://github.com/chef/ohai/pull/1526) ([phiggins](https://github.com/phiggins))
+- Renamed &#39;whitelist&#39; to &#39;allowlist&#39; in DMI plugin [#1522](https://github.com/chef/ohai/pull/1522) ([vraravam](https://github.com/vraravam))
+- Ohai Target Mode aka Remote Ohai [#1503](https://github.com/chef/ohai/pull/1503) ([lamont-granquist](https://github.com/lamont-granquist))
+- Include IAM role in ec2 data (issue #1524) [#1525](https://github.com/chef/ohai/pull/1525) ([kcbraunschweig](https://github.com/kcbraunschweig))
+
+## [v16.5.6](https://github.com/chef/ohai/tree/v16.5.6) (2020-09-28)
+
+#### Merged Pull Requests
+- chefstyle fixes [#1514](https://github.com/chef/ohai/pull/1514) ([lamont-granquist](https://github.com/lamont-granquist))
+- Update rubocop-performance requirement from 1.8.0 to 1.8.1 [#1517](https://github.com/chef/ohai/pull/1517) ([dependabot-preview[bot]](https://github.com/dependabot-preview[bot]))
+
+## [v16.5.4](https://github.com/chef/ohai/tree/v16.5.4) (2020-09-17)
+
+#### Merged Pull Requests
+- Prefer __dir__ to __FILE__ used to get the dir [#1510](https://github.com/chef/ohai/pull/1510) ([tas50](https://github.com/tas50))
+- Order the gems in the gemspec and gemfile [#1509](https://github.com/chef/ohai/pull/1509) ([tas50](https://github.com/tas50))
+- Spec cleanup [#1512](https://github.com/chef/ohai/pull/1512) ([phiggins](https://github.com/phiggins))
+- Speed up the AIX hostname spec [#1513](https://github.com/chef/ohai/pull/1513) ([tas50](https://github.com/tas50))
+
+## [v16.5.0](https://github.com/chef/ohai/tree/v16.5.0) (2020-09-09)
+
+#### Merged Pull Requests
+- Migrate to the chef-utils helpers for which/shell_out [#1501](https://github.com/chef/ohai/pull/1501) ([lamont-granquist](https://github.com/lamont-granquist))
+- Resolve new chefstyle warnings &amp; use safe navigators [#1507](https://github.com/chef/ohai/pull/1507) ([tas50](https://github.com/tas50))
+- Update rubocop-performance from 1.7.1 to 1.8.0 &amp; cleanup spec helpers [#1506](https://github.com/chef/ohai/pull/1506) ([dependabot-preview[bot]](https://github.com/dependabot-preview[bot]))
+- Resolve RuboCop Style/RedundantParentheses warnings [#1508](https://github.com/chef/ohai/pull/1508) ([tas50](https://github.com/tas50))
+- Add MacOS packages support [#1505](https://github.com/chef/ohai/pull/1505) ([mattray](https://github.com/mattray))
+
+## [v16.4.12](https://github.com/chef/ohai/tree/v16.4.12) (2020-08-19)
+
+#### Merged Pull Requests
+- Add missing require for windows network plugin [#1500](https://github.com/chef/ohai/pull/1500) ([tas50](https://github.com/tas50))
+
+## [v16.4.11](https://github.com/chef/ohai/tree/v16.4.11) (2020-08-14)
+
+#### Merged Pull Requests
+- Faster ruby language plugin [#1486](https://github.com/chef/ohai/pull/1486) ([lamont-granquist](https://github.com/lamont-granquist))
+- Use .find instead of .select.first [#1487](https://github.com/chef/ohai/pull/1487) ([tas50](https://github.com/tas50))
+- Add Address Family Check to route_is_valid_default_route? [#1485](https://github.com/chef/ohai/pull/1485) ([cooperlees](https://github.com/cooperlees))
+- Use match? instead of =~ when MatchData is not used [#1488](https://github.com/chef/ohai/pull/1488) ([tas50](https://github.com/tas50))
+- Simplify FIPS plugin and use system fips status [#1489](https://github.com/chef/ohai/pull/1489) ([tas50](https://github.com/tas50))
+- Minor memory optimizations [#1491](https://github.com/chef/ohai/pull/1491) ([tas50](https://github.com/tas50))
+- Remove unused systemu dependency [#1490](https://github.com/chef/ohai/pull/1490) ([tas50](https://github.com/tas50))
+- Remove non-Ohai requires from specs to prevent false positives [#1494](https://github.com/chef/ohai/pull/1494) ([tas50](https://github.com/tas50))
+- Update network plugin to use ipaddr not ipaddress gem [#1493](https://github.com/chef/ohai/pull/1493) ([tas50](https://github.com/tas50))
+- Remove profile gemfile group for now [#1496](https://github.com/chef/ohai/pull/1496) ([tas50](https://github.com/tas50))
+- Use rubocop-performance to enforce some best practices [#1495](https://github.com/chef/ohai/pull/1495) ([tas50](https://github.com/tas50))
+- Optimize 2 of our requires [#1497](https://github.com/chef/ohai/pull/1497) ([tas50](https://github.com/tas50))
+
+## [v16.3.2](https://github.com/chef/ohai/tree/v16.3.2) (2020-07-29)
+
+#### Merged Pull Requests
+- Remove redundant file encoding in spec [#1483](https://github.com/chef/ohai/pull/1483) ([tas50](https://github.com/tas50))
+- Spelling fixes [#1484](https://github.com/chef/ohai/pull/1484) ([tas50](https://github.com/tas50))
+
+## [v16.3.0](https://github.com/chef/ohai/tree/v16.3.0) (2020-07-24)
+
+#### Merged Pull Requests
+- Use .match? when we don&#39;t need the result [#1478](https://github.com/chef/ohai/pull/1478) ([tas50](https://github.com/tas50))
+- Handle IP to int conversion for inet + inet6 [#1477](https://github.com/chef/ohai/pull/1477) ([cooperlees](https://github.com/cooperlees))
+- Readme updates [#1482](https://github.com/chef/ohai/pull/1482) ([tas50](https://github.com/tas50))
+
+## [v16.2.3](https://github.com/chef/ohai/tree/v16.2.3) (2020-06-30)
+
+#### Merged Pull Requests
+- Fix docker detection in ohai virtualization [#1476](https://github.com/chef/ohai/pull/1476) ([jaymzh](https://github.com/jaymzh))
+- Linux network plugin: Handle IPv6 next hops for IPv4 routes [#1475](https://github.com/chef/ohai/pull/1475) ([cooperlees](https://github.com/cooperlees))
+
+## [v16.2.1](https://github.com/chef/ohai/tree/v16.2.1) (2020-06-23)
+
+#### Merged Pull Requests
+- Make sure Darwin hosts are always mac_os_x [#1470](https://github.com/chef/ohai/pull/1470) ([tas50](https://github.com/tas50))
+
+## [v16.2.0](https://github.com/chef/ohai/tree/v16.2.0) (2020-06-17)
+
+#### Merged Pull Requests
+- Remove an internal reference to blacklist [#1468](https://github.com/chef/ohai/pull/1468) ([tas50](https://github.com/tas50))
+
+## [v16.1.1](https://github.com/chef/ohai/tree/v16.1.1) (2020-05-15)
+
+#### Merged Pull Requests
+- Add new selinux plugin for Linux [#1455](https://github.com/chef/ohai/pull/1455) ([davide125](https://github.com/davide125))
+- Depend on chef-utils gem so we can use ChefUtils::Mash [#1462](https://github.com/chef/ohai/pull/1462) ([lamont-granquist](https://github.com/lamont-granquist))
+
+## [v16.0.20](https://github.com/chef/ohai/tree/v16.0.20) (2020-04-28)
+
+#### Merged Pull Requests
+- Bump to version 16.0.0 [#1420](https://github.com/chef/ohai/pull/1420) ([tas50](https://github.com/tas50))
+- Allow chef-config 16 [#1422](https://github.com/chef/ohai/pull/1422) ([tas50](https://github.com/tas50))
+- Use is_a? to check the class in the DMI plugin [#1423](https://github.com/chef/ohai/pull/1423) ([tas50](https://github.com/tas50))
+- fix [#1406]: ensure optional_plugins to be array of symbols [#1408](https://github.com/chef/ohai/pull/1408) ([salzig](https://github.com/salzig))
+- Replace filesystem with filesystem2 on aix/solaris/bsd [#1426](https://github.com/chef/ohai/pull/1426) ([tas50](https://github.com/tas50))
+- Chefstyle fixes from Rubocop 0.80 [#1431](https://github.com/chef/ohai/pull/1431) ([tas50](https://github.com/tas50))
+- Minor testing updates [#1432](https://github.com/chef/ohai/pull/1432) ([tas50](https://github.com/tas50))
+- use bool instead of raise/rescue to detect linux user is exists [#1434](https://github.com/chef/ohai/pull/1434) ([sawanoboly](https://github.com/sawanoboly))
+- Combine Linux / Windows fips plugins into a single plugin [#1437](https://github.com/chef/ohai/pull/1437) ([tas50](https://github.com/tas50))
+- Add logic to fetch the latest azure metadata version [#1427](https://github.com/chef/ohai/pull/1427) ([tas50](https://github.com/tas50))
+- Expose NIC channel params, coalesce params, and driver info... [#1439](https://github.com/chef/ohai/pull/1439) ([matt-c-clark](https://github.com/matt-c-clark))
+- Add a new interrupts plugin for Linux [#1440](https://github.com/chef/ohai/pull/1440) ([davide125](https://github.com/davide125))
+- Add a new ipc plugin for Linux [#1441](https://github.com/chef/ohai/pull/1441) ([davide125](https://github.com/davide125))
+- Fix test failure from missing require. [#1442](https://github.com/chef/ohai/pull/1442) ([phiggins](https://github.com/phiggins))
+- Use native Expeditor gem caching &amp; fix code owners [#1443](https://github.com/chef/ohai/pull/1443) ([tas50](https://github.com/tas50))
+- Cache gem installs in Buildkite on Windows as well [#1444](https://github.com/chef/ohai/pull/1444) ([tas50](https://github.com/tas50))
+- Make shard plugin more resilient and throw better errors [#1446](https://github.com/chef/ohai/pull/1446) ([jaymzh](https://github.com/jaymzh))
+- Fix chefstyle violations. [#1449](https://github.com/chef/ohai/pull/1449) ([phiggins](https://github.com/phiggins))
+- Add a plugin for Windows mimicing the Unix dmi plugin [#1445](https://github.com/chef/ohai/pull/1445) ([phiggins](https://github.com/phiggins))
+- Use correct DMI attribute name for product name [#1451](https://github.com/chef/ohai/pull/1451) ([ramereth](https://github.com/ramereth))
+- Avoid constant warnings when reloading ohai plugins [#1456](https://github.com/chef/ohai/pull/1456) ([tas50](https://github.com/tas50))
+
## [v15.7.3](https://github.com/chef/ohai/tree/v15.7.3) (2020-01-17)
#### Merged Pull Requests
@@ -42,7 +174,6 @@
- Test on Ruby 2.7 final docker container and remove old Jenkins files [#1416](https://github.com/chef/ohai/pull/1416) ([tas50](https://github.com/tas50))
- Minor spec cleanup from rubocop-rspec project [#1417](https://github.com/chef/ohai/pull/1417) ([tas50](https://github.com/tas50))
- Fix missing volume name and re-implement adding drivetype to filesystem plugin [#1419](https://github.com/chef/ohai/pull/1419) ([sshock](https://github.com/sshock))
-<!-- latest_stable_release -->
## [v15.6.3](https://github.com/chef/ohai/tree/v15.6.3) (2019-12-10)
diff --git a/Gemfile b/Gemfile
index 2eceb4d4..afe1a706 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,22 +1,23 @@
+# frozen_string_literal: true
source "https://rubygems.org"
gemspec
+# pull these gems from master of chef/chef so that we're testing against what we will release
+gem "chef-config", git: "https://github.com/chef/chef", glob: "chef-config/chef-config.gemspec"
+gem "chef-utils", git: "https://github.com/chef/chef", glob: "chef-utils/chef-utils.gemspec"
+
# NOTE: do not submit PRs to add pry as a dep, add to your Gemfile.local
group :development do
gem "chefstyle", git: "https://github.com/chef/chefstyle.git", branch: "master"
+ gem "ipaddr_extensions"
gem "rake", ">= 10.1.0"
+ gem "rspec-collection_matchers", "~> 1.0"
gem "rspec-core", "~> 3.0"
gem "rspec-expectations", "~> 3.0"
gem "rspec-mocks", "~> 3.0"
- gem "rspec-collection_matchers", "~> 1.0"
- gem "ipaddr_extensions"
-end
-
-group :docs do
- gem "yard"
- gem "redcarpet"
- gem "github-markup"
+ gem "rubocop-performance", "1.9.0"
+ gem "rubocop-rspec"
end
group :debug do
diff --git a/README.md b/README.md
index 5175b1d8..d0a6d425 100644
--- a/README.md
+++ b/README.md
@@ -18,14 +18,14 @@ Ohai will print out a JSON data blob for all the known data about your system. W
Chef distributes ohai as a RubyGem. This README is for developers who want to modify the Ohai source code. For users who want to write plugins for Ohai, see the docs:
-- General documentation: <https://docs.chef.io/ohai.html>
-- Writing Ohai Plugins documentation: <https://docs.chef.io/ohai_custom.html>
+- General documentation: <https://docs.chef.io/ohai/>
+- Writing Ohai Plugins documentation: <https://docs.chef.io/ohai_custom/>
-## Development Environment:
+## Development Environment
Ohai's development dependencies should be installed with bundler. Just run `bundle install` in the root of the repo.
-## Spec Testing:
+## Spec Testing
We use RSpec for unit/spec tests. To run the full suite, run:
@@ -39,7 +39,7 @@ You can run individual test files by running the rspec executable:
bundle exec rspec spec/unit/FILE.rb
```
-## Style:
+## Style
We use [Chefstyle](https://github.com/chef/chefstyle), as a code [linter](https://en.wikipedia.org/wiki/Lint_(software)), to enforce style guidelines. To run:
@@ -62,7 +62,6 @@ bundle exec rake -T
rake build # Build ohai-$VERSION.gem into the pkg directory
rake clean # Remove any temporary products
rake clobber # Remove any generated files
-rake docs # Generate YARD Documentation
rake install # Build and install ohai-$VERSION.gem into system gems
rake install:local # Build and install ohai-$VERSION.gem into system gems without network access
rake release[remote] # Create tag $VERSION and build and push ohai-$VERSION.gem to rubygems.org
@@ -73,7 +72,7 @@ rake style:auto_correct # Auto-correct RuboCop offenses
($VERSION is the current version, from the GemSpec in Rakefile)
```
-## Links:
+## Links
Source:
@@ -100,7 +99,7 @@ For information on contributing to this project see <https://github.com/chef/che
Ohai - system information application
- Author:: Adam Jacob ([adam@chef.io](mailto:adam@chef.io))
-- Copyright:: Copyright (c) 2008-2019 Chef Software, Inc.
+- Copyright:: Copyright (c) 2008-2020 Chef Software, Inc.
- License:: Apache License, Version 2.0
```text
diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md
index 6c9ccdd1..3b4aa448 100644
--- a/RELEASE_NOTES.md
+++ b/RELEASE_NOTES.md
@@ -1,15 +1,24 @@
+# Unreleased
+
+## etc Ohai Data on Windows
+
+Ohai's 'Passwd' plugin that provides `node['etc']['passwd']` and `node['etc']['group']` now populates data on Windows. Data for all local users and groups is present. A few things to note:
+
+ * If the node is an Active Directory domain controller, you will get all domain users as domain controllers see domain users as local
+ * If the node is not an Active Directory domain controller you will only get actual local users
+ * Group members are not recursed, so you if groups are nested, you will simply see the group that is directly a member of the group.
# Ohai Release Notes 15.6
## filesystem2 Ohai Data on Windows
-Ohai 15.6 includes new `node['filesystem2']` data on Windows hosts. Fileystem2 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. Howerver, 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 +59,7 @@ The Virtualbox plugin now gathers a large amount of data on Virtualbox hosts. Ad
### Improved Linux Platform / Platform Family Detection
-Platform and plaform_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 +138,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']` namspace, 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 +356,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/Rakefile b/Rakefile
index 200737d3..f323ce12 100644
--- a/Rakefile
+++ b/Rakefile
@@ -1,7 +1,9 @@
+# frozen_string_literal: true
require "bundler/gem_tasks"
begin
require "rspec/core/rake_task"
+ require_relative "tasks/spellcheck"
RSpec::Core::RakeTask.new do |t|
t.pattern = "spec/**/*_spec.rb"
@@ -24,13 +26,6 @@ rescue LoadError
puts "chefstyle gem is not installed. bundle install first to make sure all dependencies are installed."
end
-begin
- require "yard"
- YARD::Rake::YardocTask.new(:docs)
-rescue LoadError
- puts "yard is not available. bundle install first to make sure all dependencies are installed."
-end
-
task :console do
require "irb"
require "irb/completion"
@@ -39,4 +34,4 @@ task :console do
IRB.start
end
-task default: %i{style spec}
+task default: %i{spec style}
diff --git a/VERSION b/VERSION
index c259be49..ac9e1c36 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-16.0.20 \ No newline at end of file
+16.7.33 \ No newline at end of file
diff --git a/bin/ohai b/bin/ohai
index d8e1cc89..2d86ffa9 100755
--- a/bin/ohai
+++ b/bin/ohai
@@ -1,6 +1,5 @@
#!/usr/bin/env ruby
-#
-# ./ohai - I'm in ur serverz, showin you the daters
+# frozen_string_literal: true
#
# Author:: Adam Jacob (<adam@chef.io>)
# Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
@@ -20,7 +19,7 @@
#
# if we're in a source code checkout, we want to run the code from that.
-$:.unshift File.expand_path("../../lib", __FILE__)
+$:.unshift File.expand_path("../lib", __dir__)
require "ohai/application"
Ohai::Application.new.run
diff --git a/cspell.json b/cspell.json
new file mode 100644
index 00000000..97996bf9
--- /dev/null
+++ b/cspell.json
@@ -0,0 +1,38 @@
+// cSpell Settings
+{
+ // Version of the setting file. Always 0.1
+ "version": "0.1",
+ // language - current active spelling language
+ "language": "en",
+ "dictionaryDefinitions": [
+ {
+ "name": "chef",
+ "file": "./chef_dictionary.txt",
+ "description": "Custom Chef Dictionary"
+ }
+ ],
+ "dictionaries": ["chef"],
+ // flagWords - list of words to be always considered incorrect
+ // This is useful for offensive words and common spelling errors.
+ // For example "hte" should be "the"
+ "flagWords": [
+ "hte"
+ ],
+ "ignorePaths": [
+ "CHANGELOG.md",
+ "**/*.gemspec",
+ "**/Gemfile.lock",
+ "**/Gemfile",
+ ".expeditor/**/*",
+ "**/*.yml",
+ "**/*.toml",
+ "spec/data/**/*",
+ "spec/**"
+ ],
+ "ignoreRegExpList": [
+ // Ignore "'s" at the end of a word. If "Chef" is an accepted word, so is "Chef's".
+ "/'s\\b/",
+ // Ignore "'d" at the end of a word. If "dup" is an accepted word, so is "dup'd".
+ "/'d\\b/"
+ ]
+}
diff --git a/lib/ohai.rb b/lib/ohai.rb
index be34833c..031dd00c 100644
--- a/lib/ohai.rb
+++ b/lib/ohai.rb
@@ -1,6 +1,7 @@
+# frozen_string_literal: true
#
# Author:: Adam Jacob (<adam@chef.io>)
-# Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/lib/ohai/application.rb b/lib/ohai/application.rb
index cdbac369..b468c1a3 100644
--- a/lib/ohai/application.rb
+++ b/lib/ohai/application.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Author:: Mathieu Sauve-Frankel <msf@kisoku.net>
# Copyright:: Copyright (c) 2009 Mathieu Sauve-Frankel.
@@ -18,9 +19,9 @@
require "chef-config/path_helper"
require "chef-config/workstation_config_loader"
require_relative "../ohai"
-require_relative "log"
+require_relative "log" unless defined?(Ohai::Log)
require "mixlib/cli" unless defined?(Mixlib::CLI)
-require "benchmark"
+require "benchmark" unless defined?(Benchmark)
# The Application class is what is called by the Ohai CLI binary. It handles:
# - CLI options and attribute arguments
@@ -56,6 +57,15 @@ class Ohai::Application
description: "Set the log file location, defaults to STDOUT - recommended for daemonizing",
proc: nil
+ option :target,
+ short: "-t TARGET",
+ long: "--target TARGET",
+ description: "Target Ohai against a remote system or device",
+ proc: lambda { |target|
+ Ohai::Log.warn "-- EXPERIMENTAL -- Target mode activated -- EXPERIMENTAL --"
+ target
+ }
+
option :help,
short: "-h",
long: "--help",
@@ -93,9 +103,39 @@ class Ohai::Application
load_workstation_config
+ merge_configs
+
+ if config[:target]
+ Ohai::Config.target_mode.host = config[:target]
+ if URI.parse(Ohai::Config.target_mode.host).scheme
+ train_config = Train.unpack_target_from_uri(Ohai::Config.target_mode.host)
+ Ohai::Config.target_mode = train_config
+ end
+ Ohai::Config.target_mode.enabled = true
+ Ohai::Config.node_name = Ohai::Config.target_mode.host unless Ohai::Config.node_name
+ end
+
Ohai::Log.init(Ohai.config[:log_location])
end
+ # @api private
+ def config_file_defaults
+ Ohai::Config.save(true)
+ end
+
+ # @api private
+ def config_file_settings
+ Ohai::Config.save(false)
+ end
+
+ # See lib/chef/knife.rb in the chef/chef github repo
+ #
+ # @api private
+ def merge_configs
+ config.replace(config_file_defaults.merge(default_config).merge(config_file_settings).merge(config))
+ Ohai::Config.merge!(config) # make them both the same
+ end
+
# Passes config and attributes arguments to Ohai::System then prints the results.
# Called by the run method after config / logging have been initialized
#
diff --git a/lib/ohai/common/dmi.rb b/lib/ohai/common/dmi.rb
index 4620a385..faa440a7 100644
--- a/lib/ohai/common/dmi.rb
+++ b/lib/ohai/common/dmi.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Author:: Kurt Yoder (ktyopscode@yoderhome.com)
# Copyright:: Copyright (c) 2010 Kurt Yoder
@@ -76,11 +77,11 @@ module Ohai
# away some of the less useful IDs
ID_TO_CAPTURE = [ 0, 1, 2, 3, 4, 6, 11 ].freeze
- # the whitelisted DMI IDs. This is combination of the defaults + any additional
+ # the allowlisted DMI IDs. This is combination of the defaults + any additional
# IDs defined in the :additional_dmi_ids config
#
# @return [Array] the list of DMI IDs to capture
- def whitelisted_ids
+ def allowlisted_ids
if Ohai.config[:additional_dmi_ids]
if [ Integer, Array ].include?(Ohai.config[:additional_dmi_ids].class)
return ID_TO_CAPTURE + Array(Ohai.config[:additional_dmi_ids])
@@ -91,6 +92,10 @@ module Ohai
ID_TO_CAPTURE
end
+ ##
+ # @deprecated Use the `allowlisted_ids` method instead.
+ alias whitelisted_ids allowlisted_ids
+
# the human readable description from a DMI ID
#
# @param id [String, Integer] the ID to lookup
@@ -152,7 +157,7 @@ module Ohai
end
end
- module_function :id_lookup, :convenience_keys, :whitelisted_ids
+ module_function :id_lookup, :convenience_keys, :allowlisted_ids, :whitelisted_ids
end
end
end
diff --git a/lib/ohai/config.rb b/lib/ohai/config.rb
index ea5eaff6..88200cf6 100644
--- a/lib/ohai/config.rb
+++ b/lib/ohai/config.rb
@@ -1,7 +1,8 @@
+# frozen_string_literal: true
#
# Author:: Adam Jacob (<adam@chef.io>)
# Author:: Claire McQuin (<claire@chef.io>)
-# Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -27,14 +28,13 @@ module Ohai
# Reopens ChefConfig::Config to add Ohai configuration settings.
# see: https://github.com/chef/chef/blob/master/lib/chef/config.rb
class Config
-
config_context :ohai do
default :disabled_plugins, []
default :hints_path, [ ChefConfig::Config.platform_specific_path("/etc/chef/ohai/hints") ]
default :log_level, :auto
default :log_location, STDERR
default :plugin, ( Ohai::PluginConfig.new { |h, k| h[k] = Ohai::PluginConfig.new } )
- default :plugin_path, [ File.expand_path(File.join(File.dirname(__FILE__), "plugins")), ChefConfig::Config.platform_specific_path("/etc/chef/ohai/plugins") ]
+ default :plugin_path, [ File.expand_path(File.join(__dir__, "plugins")), ChefConfig::Config.platform_specific_path("/etc/chef/ohai/plugins") ]
default :critical_plugins, []
# causes all optional plugins to be run.
default :run_all_plugins, false
diff --git a/lib/ohai/dsl.rb b/lib/ohai/dsl.rb
index a899a7f4..535529e8 100644
--- a/lib/ohai/dsl.rb
+++ b/lib/ohai/dsl.rb
@@ -1,6 +1,7 @@
+# frozen_string_literal: true
#
# Author:: Serdar Sutay (<serdar@chef.io>)
-# Copyright:: Copyright (c) 2013-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/lib/ohai/dsl/plugin.rb b/lib/ohai/dsl/plugin.rb
index 8f0403ae..cc561d36 100644
--- a/lib/ohai/dsl/plugin.rb
+++ b/lib/ohai/dsl/plugin.rb
@@ -1,7 +1,8 @@
+# frozen_string_literal: true
#
# Author:: Adam Jacob (<adam@chef.io>)
# Author:: Claire McQuin (<claire@chef.io>)
-# Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -19,10 +20,11 @@
#
require_relative "../mixin/os"
-require_relative "../mixin/command"
+require_relative "../mixin/shell_out"
require_relative "../mixin/seconds_to_human"
+require_relative "../mixin/which"
+require_relative "../mixin/train_helpers"
require_relative "../hints"
-require_relative "../util/file_helper"
module Ohai
@@ -65,7 +67,7 @@ module Ohai
#
# @return [String]
def self.dev_null
- if RUBY_PLATFORM =~ /mswin|mingw|windows/
+ if RUBY_PLATFORM.match?(/mswin|mingw|windows/)
"NUL"
else
"/dev/null"
@@ -83,13 +85,15 @@ module Ohai
class Plugin
include Ohai::Mixin::OS
- include Ohai::Mixin::Command
+ include Ohai::Mixin::ShellOut
include Ohai::Mixin::SecondsToHuman
- include Ohai::Util::FileHelper
+ include Ohai::Mixin::Which
+ include Ohai::Mixin::TrainHelpers
attr_reader :data
attr_reader :failed
attr_reader :logger
+ attr_accessor :transport_connection
def initialize(data, logger)
@data = data
@@ -98,6 +102,10 @@ module Ohai
@failed = false
end
+ def target_mode?
+ !!@transport_connection
+ end
+
def run
@has_run = true
diff --git a/lib/ohai/dsl/plugin/versionvii.rb b/lib/ohai/dsl/plugin/versionvii.rb
index 605c2b3a..6386c2ed 100644
--- a/lib/ohai/dsl/plugin/versionvii.rb
+++ b/lib/ohai/dsl/plugin/versionvii.rb
@@ -1,6 +1,7 @@
+# frozen_string_literal: true
#
# Author:: Serdar Sutay (<serdar@chef.io>)
-# Copyright:: Copyright (c) 2013-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -46,7 +47,8 @@ module Ohai
:version7
end
- # the source of the plugin on disk. This is an array since a plugin may exist for multiple platforms and this would include each of those platform specific file paths
+ # The source of the plugin on disk. This is an array since a plugin may exist for multiple
+ # oses and this would include each of those os specific file paths
#
# @return [Array]
def self.sources
@@ -61,7 +63,7 @@ module Ohai
@depends_attrs ||= []
end
- # A block per platform for actually performing data collection constructed
+ # A block per os for actually performing data collection constructed
# by the collect_data method
#
# @return [Mash]
@@ -101,15 +103,16 @@ module Ohai
!!@optional
end
- # define data collection methodology per platform
+ # define data collection methodology per os
#
- # @param platform [Symbol] the platform to collect data for
- # @param other_platforms [Array] additional platforms to collect data for
- # @param block [block] the actual code to collect data for the specified platforms
- def self.collect_data(platform = :default, *other_platforms, &block)
- [platform, other_platforms].flatten.each do |plat|
- Ohai::Log.warn("collect_data already defined on platform '#{plat}' for #{self}, last plugin seen will be used") if data_collector.key?(plat)
- data_collector[plat] = block
+ # @param os [Array<Symbol>] the list of oses to collect data for
+ # @param block [block] the actual code to collect data for the specified os
+ #
+ def self.collect_data(*os_list, &block)
+ os_list = [ :default ] if os_list.empty?
+ os_list.flatten.each do |os|
+ Ohai::Log.warn("collect_data already defined on os '#{os}' for #{self}, last plugin seen will be used") if data_collector.key?(os)
+ data_collector[os] = block
end
end
@@ -120,12 +123,22 @@ module Ohai
def run_plugin
collector = self.class.data_collector
- platform = collect_os
-
- if collector.key?(platform)
- instance_eval(&collector[platform])
- elsif collector.key?(:default)
+ os = collect_os
+
+ # :default - means any remote or local unix or windows host
+ # :target - means any remote API which is not unix/windows or otherwise rubyable (cisco switches, IPMI console, HTTP API, etc)
+ #
+ # Do not be confused by the fact that collectors tagged :target do not run against e.g. target-mode ubuntu boxes, that is not
+ # what :target is intended for. Also, do not be confused by the fact that collectors tagged :default do not run by default against
+ # pure-target mode targets like switches. That is all intended behavior, the names are problematic. The :default nomenclature was
+ # invented 10 years before target mode and we are stuck with it.
+ #
+ if collector.key?(os)
+ instance_eval(&collector[os])
+ elsif collector.key?(:default) && !nonruby_target?
instance_eval(&collector[:default])
+ elsif collector.key?(:target) && nonruby_target?
+ instance_eval(&collector[:target])
else
logger.trace("Plugin #{name}: No data to collect. Skipping...")
end
diff --git a/lib/ohai/exception.rb b/lib/ohai/exception.rb
index 65258d89..3c43fb5c 100644
--- a/lib/ohai/exception.rb
+++ b/lib/ohai/exception.rb
@@ -1,6 +1,7 @@
+# frozen_string_literal: true
#
# Author:: Adam Jacob (<adam@chef.io>)
-# Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/lib/ohai/hints.rb b/lib/ohai/hints.rb
index e05b5180..19e85a00 100644
--- a/lib/ohai/hints.rb
+++ b/lib/ohai/hints.rb
@@ -1,6 +1,7 @@
+# frozen_string_literal: true
#
# Author:: Serdar Sutay (<serdar@chef.io>)
-# Copyright:: Copyright (c) 2013-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/lib/ohai/loader.rb b/lib/ohai/loader.rb
index a83cb56c..a0c659ac 100644
--- a/lib/ohai/loader.rb
+++ b/lib/ohai/loader.rb
@@ -1,6 +1,6 @@
#
# Author:: Claire McQuin (<claire@chef.io>)
-# Copyright:: Copyright (c) 2013-2019, Chef Software Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -71,8 +71,7 @@ module Ohai
from = [ Ohai.config[:plugin_path], from].flatten
plugin_files_by_dir(from).collect do |plugin_file|
logger.trace "Loading additional plugin: #{plugin_file}"
- plugin = load_plugin_class(plugin_file)
- load_v7_plugin(plugin)
+ load_v7_plugin(load_plugin_class(plugin_file))
end
end
diff --git a/lib/ohai/log.rb b/lib/ohai/log.rb
index 6cf0ec2e..664afca4 100644
--- a/lib/ohai/log.rb
+++ b/lib/ohai/log.rb
@@ -1,6 +1,7 @@
+# frozen_string_literal: true
#
# Author:: Adam Jacob (<adam@chef.io>)
-# Copyright:: Copyright (c) 2008-2017, Chef Software Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -16,7 +17,7 @@
# limitations under the License.
#
-require "mixlib/log"
+require "mixlib/log" unless defined?(Mixlib::Log)
module Ohai
# the Ohai Logger which is just Mixlib::Log defaulting to STDERR and :info level
diff --git a/lib/ohai/mash.rb b/lib/ohai/mash.rb
index d5a3b4b1..c303ba32 100644
--- a/lib/ohai/mash.rb
+++ b/lib/ohai/mash.rb
@@ -1,201 +1,22 @@
-# Copyright (c) 2009 Dan Kubb
-
-# Permission is hereby granted, free of charge, to any person obtaining
-# a copy of this software and associated documentation files (the
-# "Software"), to deal in the Software without restriction, including
-# without limitation the rights to use, copy, modify, merge, publish,
-# distribute, sublicense, and/or sell copies of the Software, and to
-# permit persons to whom the Software is furnished to do so, subject to
-# the following conditions:
-
-# The above copyright notice and this permission notice shall be
-# included in all copies or substantial portions of the Software.
-
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-# ---
-# ---
-
-# Some portions of blank.rb and mash.rb are verbatim copies of software
-# licensed under the MIT license. That license is included below:
-
-# Copyright (c) 2005-2008 David Heinemeier Hansson
-
-# Permission is hereby granted, free of charge, to any person obtaining
-# a copy of this software and associated documentation files (the
-# "Software"), to deal in the Software without restriction, including
-# without limitation the rights to use, copy, modify, merge, publish,
-# distribute, sublicense, and/or sell copies of the Software, and to
-# permit persons to whom the Software is furnished to do so, subject to
-# the following conditions:
-
-# The above copyright notice and this permission notice shall be
-# included in all copies or substantial portions of the Software.
-
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-# This class has dubious semantics and we only have it so that people can write
-# params[:key] instead of params['key'].
-class Mash < Hash
-
- # @param constructor [Object] The default value for the mash.
- # If constructor is a Hash, a new mash will be created based on the keys of the hash and
- # no default value will be set.
- def initialize(constructor = {})
- if constructor.is_a?(Hash)
- super()
- update(constructor)
- else
- super(constructor)
- end
- end
-
- # @param key [Object] The default value for the mash.
- # If key is a Symbol and it is a key in the mash, then the default value will be set to
- # the value matching the key.
- def default(key = nil)
- if key.is_a?(Symbol) && include?(key = key.to_s)
- self[key]
- else
- super
- end
- end
-
- alias_method :regular_writer, :[]= unless method_defined?(:regular_writer)
- alias_method :regular_update, :update unless method_defined?(:regular_update)
-
- # @param key [Object] The key to set.
- # @param value [Object] The value to set the key to.
- #
- # @see Mash#convert_key
- # @see Mash#convert_value
- def []=(key, value)
- regular_writer(convert_key(key), convert_value(value))
- end
-
- # @param other_hash [Hash]
- # A hash to update values in the mash with. The keys and the values will be
- # converted to Mash format.
- #
- # @return [Mash] The updated mash.
- def update(other_hash)
- other_hash.each_pair { |key, value| regular_writer(convert_key(key), convert_value(value)) }
- self
- end
-
- alias_method :merge!, :update
-
- # @param key [Object] The key to check for. This will be run through convert_key.
- #
- # @return [Boolean] True if the key exists in the mash.
- def key?(key)
- super(convert_key(key))
- end
-
- # def include? def has_key? def member?
- alias_method :include?, :key?
- alias_method :has_key?, :key?
- alias_method :member?, :key?
-
- # @param key [Object] The key to fetch. This will be run through convert_key.
- # @param extras [Array] Default value.
- #
- # @return [Object] The value at key or the default value.
- def fetch(key, *extras)
- super(convert_key(key), *extras)
- end
-
- # @param indices [Array] The keys to retrieve values for. These will be run through +convert_key+.
- #
- # @return [Array] The values at each of the provided keys
- def values_at(*indices)
- indices.collect { |key| self[convert_key(key)] }
- end
-
- # @param hash [Hash] The hash to merge with the mash.
- #
- # @return [Mash] A new mash with the hash values merged in.
- def merge(hash)
- dup.update(hash)
- end
-
- # @param key [Object] The key to delete from the mash.
- def delete(key)
- super(convert_key(key))
- end
-
- # @param keys [Array<String, Symbol>] The mash keys to exclude.
- #
- # @return [Mash] A new mash without the selected keys.
- #
- # @example
- # { :one => 1, :two => 2, :three => 3 }.except(:one)
- # #=> { "two" => 2, "three" => 3 }
- def except(*keys)
- super(*keys.map { |k| convert_key(k) })
- end
-
- # Used to provide the same interface as Hash.
- #
- # @return [Mash] This mash unchanged.
- def stringify_keys!; self end
-
- # @return [Hash] The mash as a Hash with symbolized keys.
- def symbolize_keys
- h = Hash.new(default)
- each { |key, val| h[key.to_sym] = val }
- h
- end
-
- # @return [Hash] The mash as a Hash with string keys.
- def to_hash
- Hash.new(default).merge(self)
- end
-
- # Convert a Hash into a Mash. The input Hash's default value is maintained
- # @return [Mash]
- def self.from_hash(hash)
- mash = Mash.new(hash)
- mash.default = hash.default
- mash
- end
-
- protected
-
- # @param key [Object] The key to convert.
- # @return [Object] The converted key. If the key was a symbol, it will be converted to a string.
- #
- # @api private
- def convert_key(key)
- key.is_a?(Symbol) ? key.to_s : key
- end
-
- # @param value [Object] The value to convert.
- #
- # @return [Object]
- # The converted value. A Hash or an Array of hashes, will be converted to
- # their Mash equivalents.
- #
- # @api private
- def convert_value(value)
- if value.class == Hash
- Mash.from_hash(value)
- elsif value.is_a?(Array)
- value.collect { |e| convert_value(e) }
- else
- value
- end
- end
-end
+# frozen_string_literal: true
+#
+# Copyright:: Copyright (c) Chef Software Inc.
+# License:: Apache License, Version 2.0
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+require "chef-utils/mash" unless defined?(ChefUtils::Mash)
+
+# For historical reasons we inject Mash directly into the top level class namespace
+Mash = ChefUtils::Mash unless defined?(Mash)
diff --git a/lib/ohai/mixin/azure_metadata.rb b/lib/ohai/mixin/azure_metadata.rb
index f44d875f..65b26e8b 100644
--- a/lib/ohai/mixin/azure_metadata.rb
+++ b/lib/ohai/mixin/azure_metadata.rb
@@ -1,6 +1,7 @@
+# frozen_string_literal: true
#
# Author:: Tim Smith (<tsmith@chef.io>)
-# Copyright:: 2017-2020 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -31,7 +32,7 @@ module Ohai
#
module AzureMetadata
- AZURE_METADATA_ADDR ||= "169.254.169.254".freeze
+ AZURE_METADATA_ADDR ||= "169.254.169.254"
# it's important that the newer versions are at the end of this array so we can skip sorting it
AZURE_SUPPORTED_VERSIONS ||= %w{ 2017-04-02 2017-08-01 2017-12-01 2018-02-01 2018-04-02
diff --git a/lib/ohai/mixin/chef_utils_wiring.rb b/lib/ohai/mixin/chef_utils_wiring.rb
new file mode 100644
index 00000000..22ebdd33
--- /dev/null
+++ b/lib/ohai/mixin/chef_utils_wiring.rb
@@ -0,0 +1,52 @@
+# frozen_string_literal: true
+#
+# Copyright:: Copyright (c) Chef Software Inc.
+# License:: Apache License, Version 2.0
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+require_relative "../config"
+require "singleton" unless defined?(Singleton)
+
+module Ohai
+ module Mixin
+ # Common Dependency Injection wiring for ChefUtils-related modules
+ module ChefUtilsWiring
+ private
+
+ def __config
+ Ohai::Config
+ end
+
+ def __log
+ logger
+ end
+
+ def __transport_connection
+ transport_connection
+ end
+
+ # because of target mode we cache the PATH to avoid massive amounts of `echo $PATH` remote queries
+ #
+ def __env_path
+ PathCache.instance.path_cache ||= super
+ end
+
+ class PathCache
+ include Singleton
+ attr_accessor :path_cache
+ end
+ end
+ end
+end
diff --git a/lib/ohai/mixin/command.rb b/lib/ohai/mixin/command.rb
index 079ecb8a..02bd724a 100644
--- a/lib/ohai/mixin/command.rb
+++ b/lib/ohai/mixin/command.rb
@@ -1,54 +1,4 @@
-#
-# Author:: Adam Jacob (<adam@chef.io>)
-# Author:: Tim Smith (<tsmith@chef.io>)
-# Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
-# License:: Apache License, Version 2.0
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-require_relative "../exception"
-require_relative "../log"
-require "mixlib/shellout" unless defined?(Mixlib::ShellOut::DEFAULT_READ_TIMEOUT)
-
-module Ohai
- module Mixin
- module Command
- # DISCLAIMER: Logging only works in the context of a plugin!!
- # accept a command and any of the mixlib-shellout options
- def shell_out(cmd, **options)
- options = options.dup
- # unless specified by the caller timeout after configured timeout (default 30 seconds)
- options[:timeout] ||= Ohai::Config.ohai[:shellout_timeout]
- unless RUBY_PLATFORM =~ /mswin|mingw32|windows/
- options[:env] = options.key?(:env) ? options[:env].dup : {}
- options[:env]["PATH"] ||= ((ENV["PATH"] || "").split(":") + %w{/usr/local/sbin /usr/local/bin /usr/sbin /usr/bin /sbin /bin}).join(":")
- end
- so = Mixlib::ShellOut.new(cmd, options)
- begin
- so.run_command
- logger.trace("Plugin #{name}: ran '#{cmd}' and returned #{so.exitstatus}")
- so
- rescue Errno::ENOENT => e
- logger.trace("Plugin #{name}: ran '#{cmd}' and failed #{e.inspect}")
- raise Ohai::Exceptions::Exec, e
- rescue Mixlib::ShellOut::CommandTimeout => e
- logger.trace("Plugin #{name}: ran '#{cmd}' and timed out after #{options[:timeout]} seconds")
- raise Ohai::Exceptions::Exec, e
- end
- end
-
- module_function :shell_out
- end
- end
-end
+# frozen_string_literal: true
+$stderr.puts "WARN: Ohai::Mixin::Command is deprecated, please use Ohai::Mixin::ShellOut or remove if the reference is unnecessary"
+require_relative "shell_out"
+Ohai::Mixin::Command = Ohai::Mixin::ShellOut unless defined?(Ohai::Mixin::Command)
diff --git a/lib/ohai/mixin/constant_helper.rb b/lib/ohai/mixin/constant_helper.rb
index 71a019af..a02aa6fa 100644
--- a/lib/ohai/mixin/constant_helper.rb
+++ b/lib/ohai/mixin/constant_helper.rb
@@ -1,6 +1,7 @@
+# frozen_string_literal: true
#
# Author:: Serdar Sutay (<serdar@chef.io>)
-# Copyright:: Copyright (c) 2014-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/lib/ohai/mixin/dmi_decode.rb b/lib/ohai/mixin/dmi_decode.rb
index 0d629477..354e337d 100644
--- a/lib/ohai/mixin/dmi_decode.rb
+++ b/lib/ohai/mixin/dmi_decode.rb
@@ -1,6 +1,7 @@
+# frozen_string_literal: true
#
# Author:: Tim Smith <tsmith@chef.io>
-# Copyright:: Copyright (c) 2015-2018 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -26,7 +27,7 @@ module ::Ohai::Mixin::DmiDecode
when /VMware/
return "vmware"
when /Microsoft/
- return "hyperv" if product =~ /Virtual Machine/
+ return "hyperv" if /Virtual Machine/.match?(product)
when /Amazon EC2/
return "amazonec2"
when /QEMU/
@@ -40,7 +41,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/mixin/do_metadata.rb b/lib/ohai/mixin/do_metadata.rb
index b23d2b58..b87806a3 100644
--- a/lib/ohai/mixin/do_metadata.rb
+++ b/lib/ohai/mixin/do_metadata.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Author:: Dylan Page (<dpage@digitalocean.com>)
# License:: Apache License, Version 2.0
@@ -20,15 +21,15 @@ module Ohai
module Mixin
module DOMetadata
- DO_METADATA_ADDR ||= "169.254.169.254".freeze
- DO_METADATA_URL ||= "/metadata/v1.json".freeze
+ DO_METADATA_ADDR ||= "169.254.169.254"
+ DO_METADATA_URL ||= "/metadata/v1.json"
def http_client
Net::HTTP.start(DO_METADATA_ADDR).tap { |h| h.read_timeout = 6 }
end
def fetch_metadata
- uri = (DO_METADATA_URL).to_s
+ uri = DO_METADATA_URL.to_s
response = http_client.get(uri)
case response.code
when "200"
diff --git a/lib/ohai/mixin/ec2_metadata.rb b/lib/ohai/mixin/ec2_metadata.rb
index 309fd983..7eb92b53 100644
--- a/lib/ohai/mixin/ec2_metadata.rb
+++ b/lib/ohai/mixin/ec2_metadata.rb
@@ -1,8 +1,9 @@
+# frozen_string_literal: true
#
# Author:: Tim Dysinger (<tim@dysinger.net>)
# Author:: Benjamin Black (<bb@chef.io>)
# Author:: Christopher Brown (<cb@chef.io>)
-# Copyright:: 2009-2017 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -39,7 +40,7 @@ module Ohai
#
module Ec2Metadata
- EC2_METADATA_ADDR ||= "169.254.169.254".freeze
+ EC2_METADATA_ADDR ||= "169.254.169.254"
EC2_SUPPORTED_VERSIONS ||= %w{ 1.0 2007-01-19 2007-03-01 2007-08-29 2007-10-10 2007-12-15
2008-02-01 2008-09-01 2009-04-04 2011-01-01 2011-05-01 2012-01-12
2014-02-25 2014-11-05 2015-10-20 2016-04-19 2016-06-30 2016-09-02 }.freeze
@@ -146,7 +147,7 @@ module Ohai
key = expand_path(o)
if key[-1..-1] != "/"
retr_meta = metadata_get("#{id}#{key}", api_version)
- metadata[metadata_key(key)] = retr_meta ? retr_meta : ""
+ metadata[metadata_key(key)] = retr_meta || ""
elsif not key.eql?("/")
metadata[key[0..-2]] = fetch_dir_metadata("#{id}#{key}", api_version)
end
@@ -163,7 +164,7 @@ module Ohai
key = expand_path(o)
if key[-1..-1] != "/"
retr_meta = metadata_get("#{id}#{key}", api_version)
- data = retr_meta ? retr_meta : ""
+ data = retr_meta || ""
json = String(data)
parser = FFI_Yajl::Parser.new
metadata[metadata_key(key)] = parser.parse(json)
diff --git a/lib/ohai/mixin/gce_metadata.rb b/lib/ohai/mixin/gce_metadata.rb
index 280d72dd..8ea838aa 100644
--- a/lib/ohai/mixin/gce_metadata.rb
+++ b/lib/ohai/mixin/gce_metadata.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Author:: Ranjib Dey (<dey.ranjib@gmail.com>)
# License:: Apache License, Version 2.0
@@ -21,8 +22,8 @@ module Ohai
module GCEMetadata
# Trailing dot to host is added to avoid DNS search path
- GCE_METADATA_ADDR ||= "metadata.google.internal.".freeze
- GCE_METADATA_URL ||= "/computeMetadata/v1/?recursive=true".freeze
+ GCE_METADATA_ADDR ||= "metadata.google.internal."
+ GCE_METADATA_URL ||= "/computeMetadata/v1/?recursive=true"
# fetch the meta content with a timeout and the required header
def http_get(uri)
diff --git a/lib/ohai/mixin/http_helper.rb b/lib/ohai/mixin/http_helper.rb
index 007476e6..6f02f6bf 100644
--- a/lib/ohai/mixin/http_helper.rb
+++ b/lib/ohai/mixin/http_helper.rb
@@ -1,5 +1,6 @@
+# frozen_string_literal: true
#
-# Copyright:: 2017, Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/lib/ohai/mixin/network_helper.rb b/lib/ohai/mixin/network_helper.rb
index be783722..bb6d1367 100644
--- a/lib/ohai/mixin/network_helper.rb
+++ b/lib/ohai/mixin/network_helper.rb
@@ -1,6 +1,7 @@
+# frozen_string_literal: true
#
# Author:: Serdar Sutay (<serdar@chef.io>)
-# Copyright:: Copyright (c) 2014-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/lib/ohai/mixin/os.rb b/lib/ohai/mixin/os.rb
index f4d4dd9f..00837092 100644
--- a/lib/ohai/mixin/os.rb
+++ b/lib/ohai/mixin/os.rb
@@ -1,6 +1,7 @@
+# frozen_string_literal: true
#
# Author:: Adam Jacob (<adam@chef.io>)
-# Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -17,7 +18,7 @@
# limitations under the License.
#
-require "rbconfig"
+require "rbconfig" unless defined?(RbConfig)
module Ohai
module Mixin
@@ -27,6 +28,71 @@ module Ohai
#
# @return [String] the OS
def collect_os
+ if target_mode?
+ collect_os_target
+ else
+ collect_os_local
+ end
+ end
+
+ # This should exactly preserve the semantics of collect_os_local below, which is authoritative
+ # for the API and must adhere to pre-existing ohai semantics and not follow inspec's notion of
+ # os/family/hierarchy.
+ #
+ # Right or wrong the ohai `os` variable has matched the ruby `host_os` definition for the past
+ # 10+ years, preceding inspec/train's definitions and this is the documented correct API of
+ # these methods. Mismatches between the ruby notion and the train version will be fixed as
+ # bugfixes in these methods and may not be considered semver violating even though they make
+ # break downstream consumers. Please ensure that both methods produce the same results if
+ # you are on a platform which supports running ruby (train is considered authoritative for
+ # any "OS" which cannot run ruby -- server consoles, REST APIs, etc...)
+ #
+ # @api private
+ def collect_os_target
+ case
+ when transport_connection.os.aix?
+ "aix"
+ when transport_connection.os.darwin?
+ "darwin"
+ when transport_connection.os.linux?
+ "linux"
+ when transport_connection.os.family == "freebsd"
+ "freebsd"
+ when transport_connection.os.family == "openbsd"
+ "openbsd"
+ when transport_connection.os.family == "netbsd"
+ "netbsd"
+ when transport_connection.os.family == "dragonflybsd"
+ "dragonflybsd"
+ when transport_connection.os.solaris?
+ "solaris2"
+ when transport_connection.os.windows?
+ "windows"
+
+ #
+ # The purpose of the next two lines is that anything which runs Unix is presumed to be able to run ruby, and
+ # if it was not caught above, we MUST translate whatever train uses as the 'os' into the proper ruby host_os
+ # string. If it is not unix and not caught above we assume it is something like a REST API which cannot run
+ # ruby. If these assumptions are incorrect then it is a bug, which should be submitted to fix it, and the
+ # values should not be relied upon until that bug is fixed. The train os is NEVER considered authoritative
+ # for any target which can run ruby.
+ #
+ when transport_connection.os.unix?
+ raise "Target mode unsupported on this Unix-like host, please update the collect_os_target case statement with the correct ruby host_os value."
+ else
+ # now we have something like an IPMI console that isn't Unix-like or Windows, presumably cannot run ruby, and
+ # so we just trust the train O/S information.
+ transport_connection.os
+ end
+ end
+
+ # @api private
+ def nonruby_target?
+ transport_connection && !transport_connection.os.unix? && !transport_connection.os.windows
+ end
+
+ # @api private
+ def collect_os_local
case ::RbConfig::CONFIG["host_os"]
when /aix(.+)$/
"aix"
@@ -56,7 +122,7 @@ module Ohai
end
end
- module_function :collect_os
+ extend self
end
end
end
diff --git a/lib/ohai/mixin/scaleway_metadata.rb b/lib/ohai/mixin/scaleway_metadata.rb
index 9b09f7d4..04bad159 100644
--- a/lib/ohai/mixin/scaleway_metadata.rb
+++ b/lib/ohai/mixin/scaleway_metadata.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Author:: Jonathan Amiez (<jonathan.amiez@gmail.com>)
# License:: Apache License, Version 2.0
@@ -20,8 +21,8 @@ module Ohai
module Mixin
module ScalewayMetadata
- SCALEWAY_METADATA_ADDR ||= "169.254.42.42".freeze
- SCALEWAY_METADATA_URL ||= "/conf?format=json".freeze
+ SCALEWAY_METADATA_ADDR ||= "169.254.42.42"
+ SCALEWAY_METADATA_URL ||= "/conf?format=json"
# @return [Net::HTTP] net/http object without timeout set to 6
def http_client
@@ -32,7 +33,7 @@ module Ohai
#
# @return [Hash]
def fetch_metadata
- uri = (SCALEWAY_METADATA_URL).to_s
+ uri = SCALEWAY_METADATA_URL.to_s
response = http_client.get(uri)
case response.code
when "200"
diff --git a/lib/ohai/mixin/seconds_to_human.rb b/lib/ohai/mixin/seconds_to_human.rb
index ec8ac769..97b388de 100644
--- a/lib/ohai/mixin/seconds_to_human.rb
+++ b/lib/ohai/mixin/seconds_to_human.rb
@@ -1,6 +1,7 @@
+# frozen_string_literal: true
#
# Author:: Adam Jacob (<adam@chef.io>)
-# Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/lib/ohai/mixin/shell_out.rb b/lib/ohai/mixin/shell_out.rb
new file mode 100644
index 00000000..d91a1565
--- /dev/null
+++ b/lib/ohai/mixin/shell_out.rb
@@ -0,0 +1,51 @@
+# frozen_string_literal: true
+#
+# Author:: Adam Jacob (<adam@chef.io>)
+# Author:: Tim Smith (<tsmith@chef.io>)
+# Copyright:: Copyright (c) Chef Software Inc.
+# License:: Apache License, Version 2.0
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+require_relative "../exception"
+require_relative "../log"
+
+require "mixlib/shellout/helper" unless defined?(Mixlib::ShellOut::Helper)
+require_relative "chef_utils_wiring" unless defined?(Ohai::Mixin::ChefUtilsWiring)
+
+module Ohai
+ module Mixin
+ module ShellOut
+ include Mixlib::ShellOut::Helper
+ include Ohai::Mixin::ChefUtilsWiring
+
+ def shell_out(cmd, **options)
+ options = options.dup
+ # unless specified by the caller timeout after configured timeout (default 30 seconds)
+ options[:timeout] ||= Ohai::Config.ohai[:shellout_timeout]
+ begin
+ so = super(cmd, **options)
+ logger.trace("Plugin #{name}: ran '#{cmd}' and returned #{so.exitstatus}")
+ so
+ rescue Errno::ENOENT => e
+ logger.trace("Plugin #{name}: ran '#{cmd}' and failed #{e.inspect}")
+ raise Ohai::Exceptions::Exec, e
+ rescue Mixlib::ShellOut::CommandTimeout => e
+ logger.trace("Plugin #{name}: ran '#{cmd}' and timed out after #{options[:timeout]} seconds")
+ raise Ohai::Exceptions::Exec, e
+ end
+ end
+ end
+ end
+end
diff --git a/lib/ohai/mixin/softlayer_metadata.rb b/lib/ohai/mixin/softlayer_metadata.rb
index 6eb7813b..ffd2a528 100644
--- a/lib/ohai/mixin/softlayer_metadata.rb
+++ b/lib/ohai/mixin/softlayer_metadata.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Author:: Alexey Karpik <alexey.karpik@rightscale.com>
# Author:: Peter Schroeter <peter.schroeter@rightscale.com>
@@ -17,12 +18,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-require "net/https"
+require "net/http" unless defined?(Net::HTTP)
require "uri" unless defined?(URI)
# https://softlayer.github.io/reference/services/SoftLayer_Resource_Metadata/
module ::Ohai::Mixin::SoftlayerMetadata
- SOFTLAYER_API_QUERY_URL ||= "https://api.service.softlayer.com/rest/v3.1/SoftLayer_Resource_Metadata".freeze
+ SOFTLAYER_API_QUERY_URL ||= "https://api.service.softlayer.com/rest/v3.1/SoftLayer_Resource_Metadata"
# fetch metadata items and build out hash of data
#
diff --git a/lib/ohai/mixin/string.rb b/lib/ohai/mixin/string.rb
index 89376a69..7f1811ad 100644
--- a/lib/ohai/mixin/string.rb
+++ b/lib/ohai/mixin/string.rb
@@ -1,6 +1,7 @@
+# frozen_string_literal: true
#
# Author:: James Gartrell (<jgartrel@gmail.com>)
-# Copyright:: Copyright (c) 2009-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/lib/ohai/mixin/train_helpers.rb b/lib/ohai/mixin/train_helpers.rb
new file mode 100644
index 00000000..809aa60e
--- /dev/null
+++ b/lib/ohai/mixin/train_helpers.rb
@@ -0,0 +1,36 @@
+# frozen_string_literal: true
+#
+# Copyright:: Copyright (c) Chef Software Inc.
+# License:: Apache License, Version 2.0
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+require "chef-utils/dsl/train_helpers" unless defined?(ChefUtils::DSL::TrainHelpers)
+require_relative "chef_utils_wiring" unless defined?(Ohai::Mixin::ChefUtilsWiring)
+
+module Ohai
+ module Mixin
+ module TrainHelpers
+ include ChefUtils::DSL::TrainHelpers
+ include ChefUtilsWiring
+
+ # anything added to this file temporarily should be pushed back up
+ # into ChefUtils::DSL::TrainHelpers
+
+ # XXX: this needs better support directly in train
+ def dir_glob(path)
+ shell_out!("ls -d #{path}").stdout.split
+ end
+ end
+ end
+end
diff --git a/lib/ohai/mixin/which.rb b/lib/ohai/mixin/which.rb
new file mode 100644
index 00000000..b2821e36
--- /dev/null
+++ b/lib/ohai/mixin/which.rb
@@ -0,0 +1,39 @@
+# frozen_string_literal: true
+#
+# Copyright:: Copyright (c) Chef Software Inc.
+# License:: Apache License, Version 2.0
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+require "chef-utils/dsl/which" unless defined?(ChefUtils::DSL::Which)
+require "chef-utils/dsl/default_paths" unless defined?(ChefUtils::DSL::DefaultPaths)
+require_relative "chef_utils_wiring" unless defined?(Ohai::Mixin::ChefUtilsWiring)
+
+module Ohai
+ module Mixin
+ module Which
+ include ChefUtils::DSL::Which
+ include ChefUtils::DSL::DefaultPaths
+ include ChefUtilsWiring
+
+ private
+
+ # we dep-inject default paths into this API for historical reasons
+ #
+ # @api private
+ def __extra_path
+ __default_paths
+ end
+ end
+ end
+end
diff --git a/lib/ohai/plugin_config.rb b/lib/ohai/plugin_config.rb
index 73c6e432..9e622cb6 100644
--- a/lib/ohai/plugin_config.rb
+++ b/lib/ohai/plugin_config.rb
@@ -1,5 +1,6 @@
+# frozen_string_literal: true
#
-# Copyright:: Copyright (c) 2015-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/lib/ohai/plugins/aix/kernel.rb b/lib/ohai/plugins/aix/kernel.rb
index 0891e203..b41a3b3b 100644
--- a/lib/ohai/plugins/aix/kernel.rb
+++ b/lib/ohai/plugins/aix/kernel.rb
@@ -1,7 +1,8 @@
+# frozen_string_literal: true
#
# Author:: Joshua Timberman <joshua@chef.io>
# Author:: Isa Farnik (<isa@chef.io>)
-# Copyright:: Copyright (c) 2013-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -23,10 +24,12 @@ Ohai.plugin(:Kernel) do
collect_data(:aix) do
kernel Mash.new
- kernel[:name] = shell_out("uname -s").stdout.split($/)[0].downcase
- kernel[:release] = shell_out("uname -r").stdout.split($/)[0]
- kernel[:version] = shell_out("uname -v").stdout.split($/)[0]
- kernel[:machine] = shell_out("uname -p").stdout.split($/)[0]
+ uname_so = shell_out("uname -rvp").stdout.split
+
+ kernel[:name] = "aix" # this is here for historical reasons, but it's always aix
+ kernel[:release] = uname_so[0]
+ kernel[:version] = uname_so[1]
+ kernel[:machine] = uname_so[2]
kernel[:bits] = shell_out("getconf KERNEL_BITMODE").stdout.strip
modules = Mash.new
diff --git a/lib/ohai/plugins/aix/memory.rb b/lib/ohai/plugins/aix/memory.rb
index 1b57d859..3dfde67e 100644
--- a/lib/ohai/plugins/aix/memory.rb
+++ b/lib/ohai/plugins/aix/memory.rb
@@ -1,7 +1,8 @@
+# frozen_string_literal: true
#
# Author:: Joshua Timberman <joshua@chef.io>
# Author:: Isa Farnik (<isa@chef.io>)
-# Copyright:: Copyright (c) 2013-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -24,13 +25,13 @@ Ohai.plugin(:Memory) do
memory Mash.new
memory[:swap] = Mash.new
- meminfo = shell_out("svmon -G -O unit=MB,summary=longreal | grep '[0-9]'").stdout
+ meminfo = shell_out("svmon -G -O unit=KB,summary=longreal | grep '[0-9]'").stdout
total_in_mb, _u, free_in_mb = meminfo.split
- memory[:total] = "#{total_in_mb.to_i * 1024}kB"
- memory[:free] = "#{free_in_mb.to_i * 1024}kB"
+ memory[:total] = "#{total_in_mb.to_i}kB"
+ memory[:free] = "#{free_in_mb.to_i}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/aix/network.rb b/lib/ohai/plugins/aix/network.rb
index c0d5fb77..cb40e09a 100644
--- a/lib/ohai/plugins/aix/network.rb
+++ b/lib/ohai/plugins/aix/network.rb
@@ -1,8 +1,9 @@
+# frozen_string_literal: true
#
# Author:: Kaustubh Deorukhkar (<kaustubh@clogeny.com>)
# Author:: Prabhu Das (<prabhu.das@clogeny.com>)
# Author:: Isa Farnik (<isa@chef.io>)
-# Copyright:: Copyright (c) 2013-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -19,14 +20,15 @@
#
Ohai.plugin(:Network) do
- require "ipaddr"
require_relative "../../mixin/network_helper"
- provides "network", "counters/network", "macaddress"
+ provides "network", "network/interfaces", "counters/network", "macaddress"
include Ohai::Mixin::NetworkHelper
collect_data(:aix) do
+ require "ipaddr" unless defined?(IPAddr)
+
# Loads following information.
# :default_interface, :default_gateway - route -n get 0
# :interfaces
@@ -36,46 +38,43 @@ Ohai.plugin(:Network) do
# => state up/down (ifconfig/lsattr)
# => arp (arp -an)
- iface = Mash.new
+ ifaces = Mash.new
network Mash.new unless network
- network[:interfaces] ||= Mash.new
# We unfortunately have to do things a bit different here, if ohai is running
# within a WPAR. For instance, the WPAR isn't aware of some of its own networking
- # minutia such as default gateway/route.
+ # minutia such as default gateway/route. lpars return 0 here. wpars return > 0
unless shell_out("uname -W").stdout.to_i > 0
# :default_interface, :default_gateway - route -n get 0
- so = shell_out("netstat -rn |grep default")
- so.stdout.lines.each do |line|
- items = line.split(" ")
- if items[0] == "default"
- network[:default_gateway] = items[1]
- network[:default_interface] = items[5]
- end
- end
+ default_line = shell_out("netstat -rn")
+ .stdout
+ .each_line
+ .detect { |l| l.start_with?("default") }
+ .split
+ network[:default_gateway] = default_line[1]
+ network[:default_interface] = default_line[5]
end
- # Splits the ifconfig output to 1 line per interface
- if_so = shell_out("ifconfig -a")
- if_so.stdout.gsub(/\n(\w+\d+)/, '___\1').split("___").each do |intraface|
- splat = intraface.split(":")
- interface = splat[0]
- line = splat[1..-1][0]
- iface[interface] = Mash.new
- iface[interface][:state] = (line.include?("<UP,") ? "up" : "down")
-
- intraface.lines.each do |lin|
- case lin
+ # Splits the ifconfig output into arrays of interface strings
+ shell_out("ifconfig -a").stdout.split(/\n(?=\w)/).each do |int_lines|
+ int_name, int_data = int_lines.split(":", 2)
+
+ ifaces[int_name] = Mash.new
+ ifaces[int_name][:addresses] ||= Mash.new
+ ifaces[int_name][:state] = (int_data.include?("<UP,") ? "up" : "down")
+
+ int_data.each_line do |line|
+ case line
when /flags=\S+<(\S+)>/
- iface[interface][:flags] = $1.split(",")
- iface[interface][:metric] = $1 if lin =~ /metric\s(\S+)/
+ ifaces[int_name][:flags] = $1.split(",")
+ ifaces[int_name][:metric] = $1 if line =~ /metric\s(\S+)/
else
# We have key value pairs.
- if lin =~ %r{inet (\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})(/(\d{1,2}))?}
+ if line =~ %r{inet (\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})(/(\d{1,2}))?}
tmp_addr, tmp_prefix = $1, $3
if tmp_prefix.nil?
- netmask = hex_to_dec_netmask($1) if lin =~ /netmask\s0x(\S+)\s/
+ netmask = hex_to_dec_netmask($1) if line =~ /netmask\s0x(\S+)\s/
unless netmask
tmp_prefix ||= "32"
netmask = IPAddr.new("255.255.255.255").mask(tmp_prefix.to_i).to_s
@@ -84,57 +83,51 @@ Ohai.plugin(:Network) do
netmask = IPAddr.new("255.255.255.255").mask(tmp_prefix.to_i).to_s
end
- iface[interface][:addresses] ||= Mash.new
- iface[interface][:addresses][tmp_addr] = { "family" => "inet", "prefixlen" => tmp_prefix }
- iface[interface][:addresses][tmp_addr][:netmask] = netmask
+ ifaces[int_name][:addresses][tmp_addr] = { "family" => "inet", "prefixlen" => tmp_prefix }
+ ifaces[int_name][:addresses][tmp_addr][:netmask] = netmask
- if lin =~ /broadcast\s(\S+)\s/
- iface[interface][:addresses][tmp_addr][:broadcast] = $1
+ if line =~ /broadcast\s(\S+)\s/
+ ifaces[int_name][:addresses][tmp_addr][:broadcast] = $1
end
- elsif lin =~ %r{inet6 ([a-f0-9\:]+)%?([\d]*)/?(\d*)?}
+ elsif line =~ %r{inet6 ([a-f0-9\:]+)%?(\d*)/?(\d*)?}
# TODO do we have more properties on inet6 in aix? broadcast
- iface[interface][:addresses] ||= Mash.new
- iface[interface][:addresses][$1] = { "family" => "inet6", "zone_index" => $2, "prefixlen" => $3 }
+ ifaces[int_name][:addresses] ||= Mash.new
+ ifaces[int_name][:addresses][$1] = { "family" => "inet6", "zone_index" => $2, "prefixlen" => $3 }
else
- # load all key-values, example "tcp_sendspace 131072 tcp_recvspace 131072 rfc1323 1"
- properties = lin.split
- n = properties.length / 2 - 1
- (0..n).each do |i|
- iface[interface][properties[i * 2]] = properties[(i * 2 + 1)]
+ # add all key value data into the interface mash
+ # for example "tcp_sendspace 131072 tcp_recvspace 131072 rfc1323 1"
+ # has keys tcp_sendspace, tcp_recvspace, and rfc1323
+ line.split.each_slice(2) do |key, value|
+ ifaces[int_name][key] = value
end
end
end
end
# Query macaddress
- e_so = shell_out("entstat -d #{interface} | grep \"Hardware Address\"")
- iface[interface][:addresses] ||= Mash.new
- e_so.stdout.lines.each do |l|
- if l =~ /Hardware Address: (\S+)/
- iface[interface][:addresses][$1.upcase] = { "family" => "lladdr" }
- macaddress $1.upcase unless shell_out("uname -W").stdout.to_i > 0
- end
+ shell_out("entstat -d #{int_name}").stdout =~ /Hardware Address: (\S+)/
+ if $1
+ ifaces[int_name][:addresses][$1.upcase] = { "family" => "lladdr" }
+ macaddress $1.upcase unless shell_out("uname -W").stdout.to_i > 0
end
end # ifconfig stdout
# Query routes information
%w{inet inet6}.each do |family|
- so_n = shell_out("netstat -nrf #{family}")
- so_n.stdout.lines.each do |line|
+ shell_out("netstat -nrf #{family}").stdout.each_line do |line|
if line =~ /(\S+)\s+(\S+)\s+(\S+)\s+(\d+)\s+(\d+)\s+(\S+)/
interface = $6
- iface[interface][:routes] = [] unless iface[interface][:routes]
- iface[interface][:routes] << Mash.new( destination: $1, family: family,
+ ifaces[interface][:routes] ||= []
+ ifaces[interface][:routes] << Mash.new( destination: $1, family: family,
via: $2, flags: $3)
end
end
end
# List the arp entries in system.
- so = shell_out("arp -an")
count = 0
- so.stdout.lines.each do |line|
- network[:arp] ||= Mash.new
+ network[:arp] ||= Mash.new
+ shell_out("arp -an").stdout.each_line do |line|
if line =~ /\s*(\S+) \((\S+)\) at ([a-fA-F0-9\:]+) \[(\w+)\] stored in bucket/
network[:arp][count] ||= Mash.new
network[:arp][count][:remote_host] = $1
@@ -143,6 +136,6 @@ Ohai.plugin(:Network) do
count += 1
end
end
- network["interfaces"] = iface
+ network["interfaces"] = ifaces
end
end
diff --git a/lib/ohai/plugins/aix/platform.rb b/lib/ohai/plugins/aix/platform.rb
index 776bb2f2..4dae93f6 100644
--- a/lib/ohai/plugins/aix/platform.rb
+++ b/lib/ohai/plugins/aix/platform.rb
@@ -1,7 +1,8 @@
+# frozen_string_literal: true
#
# Author:: Joshua Timberman <joshua@chef.io>
# Author:: Isa Farnik (<isa@chef.io>)
-# Copyright:: Copyright (c) 2013-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -22,8 +23,8 @@ Ohai.plugin(:Platform) do
depends "kernel"
collect_data(:aix) do
- platform kernel[:name]
+ platform "aix"
+ platform_family "aix"
platform_version [kernel[:version], kernel[:release]].join(".")
- platform_family platform
end
end
diff --git a/lib/ohai/plugins/aix/uptime.rb b/lib/ohai/plugins/aix/uptime.rb
index ec515aa2..a273465f 100644
--- a/lib/ohai/plugins/aix/uptime.rb
+++ b/lib/ohai/plugins/aix/uptime.rb
@@ -1,7 +1,8 @@
+# frozen_string_literal: true
#
# Author:: Kurt Yoder (<ktyopscode@yoderhome.com>)
# Author:: Isa Farnik (<isa@chef.io>)
-# Copyright:: Copyright (c) 2013-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -21,7 +22,7 @@ Ohai.plugin(:Uptime) do
provides "uptime", "uptime_seconds"
collect_data(:aix) do
- require "date"
+ require "date" unless defined?(DateTime)
# below we're going to assume that PID 1 is init (this is true 99.99999% of the time)
# output will look like this
# 1148-20:54:50
@@ -30,7 +31,7 @@ Ohai.plugin(:Uptime) do
so = shell_out("LC_ALL=POSIX ps -o etime= -p 1").stdout.strip
# Here we'll check our shell_out for a dash, which indicates there is a # of days involved
- # We'll chunk off the days, hours (where applicable), minutes, seconds into seperate vars
+ # We'll chunk off the days, hours (where applicable), minutes, seconds into separate vars
# We also need to do this because ps -o etime= will not display days if the machine has been up for less than 24 hours
# If the machine has been up for less than one hour, the shell_out will not output hours hence our else
# see here: https://www.ibm.com/support/knowledgecenter/en/ssw_aix_72/com.ibm.aix.cmds4/ps.htm#ps__row-d3e109655
@@ -40,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/aix/virtualization.rb b/lib/ohai/plugins/aix/virtualization.rb
index 9a50adbb..74c72a5a 100644
--- a/lib/ohai/plugins/aix/virtualization.rb
+++ b/lib/ohai/plugins/aix/virtualization.rb
@@ -1,7 +1,7 @@
#
# Author:: Julian C. Dunn (<jdunn@chef.io>)
# Author:: Isa Farnik (<isa@chef.io>)
-# Copyright:: Copyright (c) 2013-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -23,17 +23,14 @@ Ohai.plugin(:Virtualization) do
collect_data(:aix) do
virtualization Mash.new
- so = shell_out("uname -L")
- lpar_no = so.stdout.split($/)[0].split(/\s/)[0]
- lpar_name = so.stdout.split($/)[0].split(/\s/)[1]
+ lpar_no, lpar_name = shell_out("uname -L").stdout.split(nil, 2)
unless lpar_no.to_i == -1 || (lpar_no.to_i == 1 && lpar_name == "NULL")
virtualization[:lpar_no] = lpar_no
virtualization[:lpar_name] = lpar_name
end
- so = shell_out("uname -W")
- wpar_no = so.stdout.split($/)[0]
+ wpar_no = shell_out("uname -W").stdout.strip
if wpar_no.to_i > 0
virtualization[:wpar_no] = wpar_no
else
@@ -41,8 +38,11 @@ Ohai.plugin(:Virtualization) do
so = shell_out("lswpar -L").stdout.scan(/={65}.*?(?:EXPORTED\n\n)+/m)
wpars = Mash.new
so.each do |wpar|
- wpar_name = wpar.lines[1].split[0]
+ wpar_heading = wpar.lines[1].split
+ wpar_name = wpar_heading[0]
+
wpars[wpar_name] = Mash.new
+ wpars[wpar_name][:state] = wpar_heading[2].downcase
wpar.scan(/^[A-Z]{4,}.*?[A-Z\:0-9]$.*?\n\n/m).each do |section|
@@ -57,7 +57,7 @@ Ohai.plugin(:Virtualization) do
sections.each do |line|
case title
when "network"
- next if line =~ /^Interface|^---/
+ next if /^Interface|^---/.match?(line)
splat = line.strip.split
key = splat[0].downcase
@@ -68,7 +68,7 @@ Ohai.plugin(:Virtualization) do
}
wpars[wpar_name][title][key] = value
when "user-specified routes"
- next if line =~ /^Type|^---/
+ next if /^Type|^---/.match?(line)
splat = line.strip.split
key = splat[2].downcase
@@ -78,7 +78,7 @@ Ohai.plugin(:Virtualization) do
}
wpars[wpar_name][title][key] = value
when "file systems"
- next if line =~ /^MountPoint|^---/
+ next if /^MountPoint|^---/.match?(line)
splat = line.strip.split
key = splat[1].downcase
@@ -93,7 +93,7 @@ Ohai.plugin(:Virtualization) do
privileges ||= ""
wpars[wpar_name][title]["Privileges"] ||= []
- if line =~ /^Privileges/
+ if /^Privileges/.match?(line)
privileges << line.split(":")[1].strip
else
privileges << line.strip
@@ -101,7 +101,7 @@ Ohai.plugin(:Virtualization) do
wpars[wpar_name][title]["Privileges"] += privileges.split(",")
when "device exports"
- next if line =~ /^Name|^---/
+ next if /^Name|^---/.match?(line)
splat = line.strip.split
key = splat[0].downcase
diff --git a/lib/ohai/plugins/azure.rb b/lib/ohai/plugins/azure.rb
index 5969afb6..f8224666 100644
--- a/lib/ohai/plugins/azure.rb
+++ b/lib/ohai/plugins/azure.rb
@@ -1,4 +1,5 @@
-# Copyright:: Copyright 2013-2017 Chef Software, Inc.
+# frozen_string_literal: true
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -34,7 +35,7 @@ Ohai.plugin(:Azure) do
azure Mash.new
azure_metadata_from_hints.each { |k, v| azure[k] = v }
azure["metadata"] = parse_metadata
- elsif has_waagent? || has_dhcp_option_245?
+ elsif has_waagent? || has_dhcp_option_245? || has_reddog_dhcp_domain?
logger.trace("Plugin Azure: No hints present, but system appears to be on Azure.")
azure Mash.new
azure["metadata"] = parse_metadata
@@ -47,7 +48,7 @@ Ohai.plugin(:Azure) do
# check for either the waagent or the unknown-245 DHCP option that Azure uses
# http://blog.mszcool.com/index.php/2015/04/detecting-if-a-virtual-machine-runs-in-microsoft-azure-linux-windows-to-protect-your-software-when-distributed-via-the-azure-marketplace/
def has_waagent?
- if File.exist?("/usr/sbin/waagent") || Dir.exist?('C:\WindowsAzure')
+ if file_exist?("/usr/sbin/waagent") || dir_exist?('C:\WindowsAzure')
logger.trace("Plugin Azure: Found waagent used by Azure.")
true
end
@@ -55,9 +56,9 @@ Ohai.plugin(:Azure) do
def has_dhcp_option_245?
has_245 = false
- if File.exist?("/var/lib/dhcp/dhclient.eth0.leases")
- File.open("/var/lib/dhcp/dhclient.eth0.leases").each do |line|
- if line =~ /unknown-245/
+ if file_exist?("/var/lib/dhcp/dhclient.eth0.leases")
+ file_open("/var/lib/dhcp/dhclient.eth0.leases").each do |line|
+ if /unknown-245/.match?(line)
logger.trace("Plugin Azure: Found unknown-245 DHCP option used by Azure.")
has_245 = true
break
@@ -67,6 +68,26 @@ Ohai.plugin(:Azure) do
has_245
end
+ def has_reddog_dhcp_domain?
+ tcp_ip_dhcp_domain == "reddog.microsoft.com"
+ end
+
+ def tcp_ip_dhcp_domain
+ return unless RUBY_PLATFORM.match?(/mswin|mingw32|windows/)
+
+ require "win32/registry" unless defined?(Win32::Registry)
+
+ begin
+ key = Win32::Registry::HKEY_LOCAL_MACHINE.open("SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters")
+ dhcp_domain = key["DhcpDomain"]
+ Ohai::Log.trace("Plugin Azure: DhcpDomain registry value is #{dhcp_domain}")
+ rescue Win32::Registry::Error
+ Ohai::Log.trace("Plugin Azure: DhcpDomain registry value cannot be found")
+ end
+
+ dhcp_domain
+ end
+
# create the basic structure we'll store our data in
def initialize_metadata_mash_compute
metadata = Mash.new
diff --git a/lib/ohai/plugins/bsd/virtualization.rb b/lib/ohai/plugins/bsd/virtualization.rb
index f82da617..13d56c97 100644
--- a/lib/ohai/plugins/bsd/virtualization.rb
+++ b/lib/ohai/plugins/bsd/virtualization.rb
@@ -1,7 +1,8 @@
+# frozen_string_literal: true
#
# Author:: Bryan McLellan (btm@loftninjas.org)
# Copyright:: Copyright (c) 2009 Bryan McLellan
-# Copyright:: Copyright (c) 2015-2018 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -30,7 +31,7 @@ Ohai.plugin(:Virtualization) do
# detect when in a jail or when a jail is actively running (not in stopped state)
so = shell_out("sysctl -n security.jail.jailed")
- if so.stdout.split($/)[0].to_i == 1
+ if so.stdout.strip.to_i == 1
virtualization[:system] = "jail"
virtualization[:role] = "guest"
virtualization[:systems][:jail] = "guest"
@@ -49,7 +50,7 @@ Ohai.plugin(:Virtualization) do
end
# detect from modules
- so = shell_out((Ohai.abs_path("/sbin/kldstat")).to_s)
+ so = shell_out(Ohai.abs_path("/sbin/kldstat").to_s)
so.stdout.lines do |line|
case line
when /vboxdrv/
@@ -66,7 +67,7 @@ Ohai.plugin(:Virtualization) do
end
# Detect bhyve by presence of /dev/vmm
- if File.exist?("/dev/vmm")
+ if file_exist?("/dev/vmm")
virtualization[:system] = "bhyve"
virtualization[:role] = "host"
virtualization[:systems][:bhyve] = "host"
@@ -76,7 +77,7 @@ Ohai.plugin(:Virtualization) do
# Detect KVM/QEMU paravirt guests from cpu, report as KVM
# hw.model: QEMU Virtual CPU version 0.9.1
so = shell_out("sysctl -n hw.model")
- if so.stdout =~ /QEMU Virtual CPU|KVM processor/
+ if /QEMU Virtual CPU|KVM processor/.match?(so.stdout)
virtualization[:system] = "kvm"
virtualization[:role] = "guest"
virtualization[:systems][:kvm] = "guest"
@@ -96,7 +97,7 @@ Ohai.plugin(:Virtualization) do
"xen"
when /kvm/
so = shell_out("sysctl -n kern.hostuuid")
- so.stdout =~ /^ec2/ ? "amazonec2" : "kvm"
+ /^ec2/.match?(so.stdout) ? "amazonec2" : "kvm"
when /bhyve/
"bhyve"
end
diff --git a/lib/ohai/plugins/c.rb b/lib/ohai/plugins/c.rb
index 690e101c..fb064e81 100644
--- a/lib/ohai/plugins/c.rb
+++ b/lib/ohai/plugins/c.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Author:: Doug MacEachern <dougm@vmware.com>
# Copyright:: Copyright (c) 2010 VMware, Inc.
@@ -137,7 +138,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 +174,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/chef.rb b/lib/ohai/plugins/chef.rb
index e89a9a1f..8a01e68c 100644
--- a/lib/ohai/plugins/chef.rb
+++ b/lib/ohai/plugins/chef.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Author:: Tollef Fog Heen <tfheen@err.no>
# Copyright:: Copyright (c) 2010 Tollef Fog Heen
@@ -19,7 +20,7 @@
Ohai.plugin(:Chef) do
provides "chef_packages/chef"
- collect_data do
+ collect_data(:default, :target) do
begin
require "chef/version"
rescue Gem::LoadError
diff --git a/lib/ohai/plugins/cloud.rb b/lib/ohai/plugins/cloud.rb
index 45e5f8c5..a49044fb 100644
--- a/lib/ohai/plugins/cloud.rb
+++ b/lib/ohai/plugins/cloud.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Author:: Cary Penniman (<cary@rightscale.com>)
# License:: Apache License, Version 2.0
@@ -100,7 +101,7 @@ Ohai.plugin(:Cloud) do
@cloud[:local_ipv6] = @cloud[:local_ipv6_addrs][0] if @cloud[:local_ipv6_addrs]
# if empty, return nil
- (@cloud.empty?) ? nil : @cloud
+ @cloud.empty? ? nil : @cloud
end
private
@@ -320,7 +321,7 @@ Ohai.plugin(:Cloud) do
end
collect_data do
- require "ipaddr"
+ require "ipaddr" unless defined?(IPAddr)
@cloud_attr_obj = CloudAttrs.new
diff --git a/lib/ohai/plugins/command.rb b/lib/ohai/plugins/command.rb
index ddecde10..a9c41362 100644
--- a/lib/ohai/plugins/command.rb
+++ b/lib/ohai/plugins/command.rb
@@ -1,6 +1,7 @@
+# frozen_string_literal: true
#
# Author:: Adam Jacob (<adam@chef.io>)
-# Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/lib/ohai/plugins/cpu.rb b/lib/ohai/plugins/cpu.rb
index 5375c726..f9e980b7 100644
--- a/lib/ohai/plugins/cpu.rb
+++ b/lib/ohai/plugins/cpu.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Author:: Adam Jacob (<adam@chef.io>)
# Author:: Bryan McLellan (btm@loftninjas.org)
@@ -8,7 +9,7 @@
# Author:: Prabhu Das (<prabhu.das@clogeny.com>)
# Author:: Isa Farnik (<isa@chef.io>)
# Author:: Doug MacEachern <dougm@vmware.com>
-# Copyright:: Copyright (c) 2008-2018 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -30,16 +31,14 @@ Ohai.plugin(:CPU) do
def parse_bsd_dmesg(&block)
cpuinfo = Mash.new
cpuinfo["flags"] = []
- File.open("/var/run/dmesg.boot").each do |line|
+ file_open("/var/run/dmesg.boot").each do |line|
case line
when /CPU:\s+(.+) \(([\d.]+).+\)/
cpuinfo["model_name"] = $1
cpuinfo["mhz"] = $2
- when /Features=.+<(.+)>/
+ when /Features=.+<(.+)>/, /Features2=[a-f\dx]+<(.+)>/
cpuinfo["flags"].concat($1.downcase.split(","))
# Features2=0x80000001<SSE3,<b31>>
- when /Features2=[a-f\dx]+<(.+)>/
- cpuinfo["flags"].concat($1.downcase.split(","))
else
yield(cpuinfo, line)
end
@@ -53,7 +52,7 @@ Ohai.plugin(:CPU) do
cpu_number = 0
current_cpu = nil
- File.open("/proc/cpuinfo").each do |line|
+ file_open("/proc/cpuinfo").each do |line|
case line
when /processor\s+:\s(.+)/
cpuinfo[$1] = Mash.new
@@ -61,7 +60,7 @@ Ohai.plugin(:CPU) do
cpu_number += 1
when /vendor_id\s+:\s(.+)/
vendor_id = $1
- if vendor_id =~ (%r{IBM/S390})
+ if vendor_id.include?("IBM/S390")
cpuinfo["vendor_id"] = vendor_id
else
cpuinfo[current_cpu]["vendor_id"] = vendor_id
@@ -86,15 +85,15 @@ Ohai.plugin(:CPU) do
when /cache size\s+:\s(.+)/
cpuinfo[current_cpu]["cache_size"] = $1
when /flags\s+:\s(.+)/
- cpuinfo[current_cpu]["flags"] = $1.split(" ")
+ cpuinfo[current_cpu]["flags"] = $1.split
when /BogoMIPS\s+:\s(.+)/
cpuinfo[current_cpu]["bogomips"] = $1
when /Features\s+:\s(.+)/
- cpuinfo[current_cpu]["features"] = $1.split(" ")
+ cpuinfo[current_cpu]["features"] = $1.split
when /bogomips per cpu:\s(.+)/
cpuinfo["bogomips_per_cpu"] = $1
when /features\s+:\s(.+)/
- cpuinfo["features"] = $1.split(" ")
+ cpuinfo["features"] = $1.split
when /processor\s(\d):\s(.+)/
current_cpu = $1
cpu_number += 1
@@ -201,7 +200,7 @@ Ohai.plugin(:CPU) do
end
so = shell_out("sysctl -n hw.ncpu")
- info[:total] = so.stdout.split($/)[0].to_i
+ info[:total] = so.stdout.strip.to_i
cpu info
end
@@ -212,7 +211,7 @@ Ohai.plugin(:CPU) do
# to scrape from dmesg.boot is the cpu feature list.
# cpu0: FPU,V86,DE,PSE,TSC,MSR,MCE,CX8,SEP,MTRR,PGE,MCA,CMOV,PAT,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,TM,SBF,EST,TM2
- File.open("/var/run/dmesg.boot").each do |line|
+ file_open("/var/run/dmesg.boot").each do |line|
case line
when /cpu\d+:\s+([A-Z]+$|[A-Z]+,.*$)/
cpuinfo["flags"] = $1.downcase.split(",")
@@ -221,7 +220,7 @@ Ohai.plugin(:CPU) do
[["hw.model", :model_name], ["hw.ncpu", :total], ["hw.cpuspeed", :mhz]].each do |param, node|
so = shell_out("sysctl -n #{param}")
- cpuinfo[node] = so.stdout.split($/)[0]
+ cpuinfo[node] = so.stdout.strip
end
cpu cpuinfo
@@ -235,7 +234,7 @@ Ohai.plugin(:CPU) do
# available instruction set
# cpu0 at mainbus0 apid 0: Intel 686-class, 2134MHz, id 0x6f6
- File.open("/var/run/dmesg.boot").each do |line|
+ file_open("/var/run/dmesg.boot").each do |line|
case line
when /cpu[\d\w\s]+:\s([\w\s\-]+),\s+(\w+),/
cpuinfo[:model_name] = $1
@@ -279,7 +278,7 @@ Ohai.plugin(:CPU) do
when /^machdep.cpu.stepping: (.*)$/
cpu[:stepping] = Regexp.last_match[1].to_i
when /^machdep.cpu.features: (.*)$/
- cpu[:flags] = Regexp.last_match[1].downcase.split(" ")
+ cpu[:flags] = Regexp.last_match[1].downcase.split
end
end
end
@@ -305,7 +304,7 @@ Ohai.plugin(:CPU) do
cpu[index] = Mash.new
cpu[index][:status] = status
cpu[index][:location] = location
- if status =~ /Available/
+ if /Available/.match?(status)
cpu[:available] += 1
lsattr = shell_out("lsattr -El #{name}").stdout.lines
lsattr.each do |attribute|
@@ -364,7 +363,7 @@ Ohai.plugin(:CPU) do
cpu["cpustates"][value] += 1
when /core_id/
cpu[instance]["core_id"] = value
- # Detect hyperthreading/multithreading
+ # Detect hyperthreading/multithreading
cpucores.push(value) if cpucores.index(value).nil?
when /family|fpu_type|model|stepping|vendor_id/
cpu[instance][key] = value
@@ -377,7 +376,7 @@ Ohai.plugin(:CPU) do
end
collect_data(:windows) do
- require "wmi-lite/wmi"
+ require "wmi-lite/wmi" unless defined?(WmiLite::Wmi)
cpu Mash.new
cores = 0
diff --git a/lib/ohai/plugins/darwin/hardware.rb b/lib/ohai/plugins/darwin/hardware.rb
index dab7957d..a24fa756 100644
--- a/lib/ohai/plugins/darwin/hardware.rb
+++ b/lib/ohai/plugins/darwin/hardware.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Author:: Nate Walck (<nate.walck@gmail.com>)
# Copyright:: Copyright (c) 2016-present Facebook, Inc.
@@ -41,8 +42,8 @@ Ohai.plugin(:Hardware) do
hardware.merge!(hw_hash[0]["_items"][0])
# ProductName: Mac OS X
- # ProductVersion: 10.12.5
- # BuildVersion: 16F73
+ # ProductVersion: 10.15.6
+ # BuildVersion: 19G46c
shell_out("sw_vers").stdout.lines.each do |line|
case line
when /^ProductName:\s*(.*)$/
diff --git a/lib/ohai/plugins/darwin/memory.rb b/lib/ohai/plugins/darwin/memory.rb
index 28214c87..72a6e69f 100644
--- a/lib/ohai/plugins/darwin/memory.rb
+++ b/lib/ohai/plugins/darwin/memory.rb
@@ -1,6 +1,7 @@
+# frozen_string_literal: true
#
# Author:: Patrick Collins (<pat@burned.com>)
-# Copyright:: Copyright (c) 2013-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -43,9 +44,7 @@ Ohai.plugin(:Memory) do
megabyte_val = (pages * page_size) / 1024 / 1024.0
total_consumed += megabyte_val
case match
- when "wired down"
- active += megabyte_val.to_i
- when "active"
+ when "wired down", "active"
active += megabyte_val.to_i
when "inactive"
inactive += megabyte_val.to_i
diff --git a/lib/ohai/plugins/darwin/network.rb b/lib/ohai/plugins/darwin/network.rb
index 9736987d..2d3e2a12 100644
--- a/lib/ohai/plugins/darwin/network.rb
+++ b/lib/ohai/plugins/darwin/network.rb
@@ -1,6 +1,7 @@
+# frozen_string_literal: true
#
# Author:: Benjamin Black (<bb@chef.io>)
-# Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -26,7 +27,7 @@ Ohai.plugin(:Network) do
def parse_media(media_string)
media = {}
- line_array = media_string.split(" ")
+ line_array = media_string.split
0.upto(line_array.length - 1) do |i|
unless line_array[i].eql?("none")
@@ -66,8 +67,8 @@ Ohai.plugin(:Network) do
def scope_lookup(scope)
return "Node" if scope.eql?("::1")
- return "Link" if scope =~ /^fe80\:/
- return "Site" if scope =~ /^fec0\:/
+ return "Link" if /^fe80\:/.match?(scope)
+ return "Site" if /^fec0\:/.match?(scope)
"Global"
end
@@ -79,7 +80,7 @@ Ohai.plugin(:Network) do
def locate_interface(ifaces, ifname, mac)
return ifname unless ifaces[ifname].nil?
# oh well, time to go hunting!
- return ifname.chop if ifname =~ /\*$/
+ return ifname.chop if /\*$/.match?(ifname)
ifaces.each_key do |ifc|
ifaces[ifc][:addresses].each_key do |addr|
diff --git a/lib/ohai/plugins/darwin/platform.rb b/lib/ohai/plugins/darwin/platform.rb
index 298b076b..7ea38c12 100644
--- a/lib/ohai/plugins/darwin/platform.rb
+++ b/lib/ohai/plugins/darwin/platform.rb
@@ -1,6 +1,7 @@
+# frozen_string_literal: true
#
# Author:: Adam Jacob (<adam@chef.io>)
-# Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -20,14 +21,9 @@ Ohai.plugin(:Platform) do
provides "platform", "platform_version", "platform_build", "platform_family"
collect_data(:darwin) do
- so = shell_out((Ohai.abs_path( "/usr/bin/sw_vers" )).to_s)
+ so = shell_out(Ohai.abs_path( "/usr/bin/sw_vers" ).to_s)
so.stdout.lines do |line|
case line
- when /^ProductName:\s+(.+)$/
- macname = $1
- macname.downcase!
- macname.tr!(" ", "_")
- platform macname
when /^ProductVersion:\s+(.+)$/
platform_version $1
when /^BuildVersion:\s+(.+)$/
@@ -35,6 +31,8 @@ Ohai.plugin(:Platform) do
end
end
+ # if we're on darwin assume we're on mac_os_x
+ platform "mac_os_x"
platform_family "mac_os_x"
end
end
diff --git a/lib/ohai/plugins/darwin/virtualization.rb b/lib/ohai/plugins/darwin/virtualization.rb
index 49611f3a..ac5a096b 100644
--- a/lib/ohai/plugins/darwin/virtualization.rb
+++ b/lib/ohai/plugins/darwin/virtualization.rb
@@ -1,8 +1,9 @@
+# frozen_string_literal: true
#
# Author:: Pavel Yudin (<pyudin@parallels.com>)
# Author:: Tim Smith (<tsmith@chef.io>)
# Copyright:: Copyright (c) 2015 Pavel Yudin
-# Copyright:: Copyright (c) 2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -35,7 +36,7 @@ Ohai.plugin(:Virtualization) do
end
def fusion_exists?
- ::File.exist?("/Applications/VMware\ Fusion.app/")
+ file_exist?("/Applications/VMware\ Fusion.app/")
end
def docker_exists?
@@ -82,7 +83,7 @@ Ohai.plugin(:Virtualization) do
virtualization[:systems][:parallels] = "host"
elsif ioreg_exists?
so = shell_out("ioreg -l")
- if so.stdout =~ /pci1ab8,4000/
+ if /pci1ab8,4000/.match?(so.stdout)
virtualization[:system] = "parallels"
virtualization[:role] = "guest"
virtualization[:systems][:parallels] = "guest"
diff --git a/lib/ohai/plugins/digital_ocean.rb b/lib/ohai/plugins/digital_ocean.rb
index 884cc76e..d18304b6 100644
--- a/lib/ohai/plugins/digital_ocean.rb
+++ b/lib/ohai/plugins/digital_ocean.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Author:: Dylan Page (<dpage@digitalocean.com>)
# Author:: Stafford Brunk (<stafford.brunk@gmail.com>)
diff --git a/lib/ohai/plugins/dmi.rb b/lib/ohai/plugins/dmi.rb
index 2aed6d77..c9d4ecaf 100644
--- a/lib/ohai/plugins/dmi.rb
+++ b/lib/ohai/plugins/dmi.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Author:: Kurt Yoder (ktyopscode@yoderhome.com)
# Copyright:: Copyright (c) 2010 Kurt Yoder
@@ -76,7 +77,7 @@ Ohai.plugin(:DMI) do
dmi[:table_location] = table_location[1]
elsif ( handle = handle_line.match(line) )
- unless Ohai::Common::DMI.whitelisted_ids.include?(handle[2].to_i)
+ unless Ohai::Common::DMI.allowlisted_ids.include?(handle[2].to_i)
dmi_record = nil
next
end
diff --git a/lib/ohai/plugins/docker.rb b/lib/ohai/plugins/docker.rb
index 6bea2ace..92e7a5c4 100644
--- a/lib/ohai/plugins/docker.rb
+++ b/lib/ohai/plugins/docker.rb
@@ -1,5 +1,6 @@
+# frozen_string_literal: true
#
-# Copyright:: 2018 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -16,8 +17,6 @@
#
Ohai.plugin(:Docker) do
- require "json"
-
provides "docker"
depends "virtualization"
@@ -50,6 +49,8 @@ Ohai.plugin(:Docker) do
end
collect_data do
+ require "json" unless defined?(JSON)
+
if virtualization[:systems][:docker]
docker_ohai_data(docker_info_json)
end
diff --git a/lib/ohai/plugins/dragonflybsd/memory.rb b/lib/ohai/plugins/dragonflybsd/memory.rb
index 28787526..52ea56da 100644
--- a/lib/ohai/plugins/dragonflybsd/memory.rb
+++ b/lib/ohai/plugins/dragonflybsd/memory.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Author:: Bryan McLellan (btm@loftninjas.org)
# Copyright:: Copyright (c) 2009 Bryan McLellan
@@ -25,22 +26,22 @@ Ohai.plugin(:Memory) do
# /usr/src/sys/sys/vmmeter.h
so = shell_out("sysctl -n vm.stats.vm.v_page_size")
- memory[:page_size] = so.stdout.split($/)[0]
+ memory[:page_size] = so.stdout.strip
so = shell_out("sysctl -n vm.stats.vm.v_page_count")
- memory[:page_count] = so.stdout.split($/)[0]
+ memory[:page_count] = so.stdout.strip
memory[:total] = memory[:page_size].to_i * memory[:page_count].to_i
so = shell_out("sysctl -n vm.stats.vm.v_free_count")
- memory[:free] = memory[:page_size].to_i * so.stdout.split($/)[0].to_i
+ memory[:free] = memory[:page_size].to_i * so.stdout.strip.to_i
so = shell_out("sysctl -n vm.status.vm.v_active_count")
- memory[:active] = memory[:page_size].to_i * so.stdout.split($/)[0].to_i
+ memory[:active] = memory[:page_size].to_i * so.stdout.strip.to_i
so = shell_out("sysctl -n vm.status.vm.v_inactive_count")
- memory[:inactive] = memory[:page_size].to_i * so.stdout.split($/)[0].to_i
+ memory[:inactive] = memory[:page_size].to_i * so.stdout.strip.to_i
so = shell_out("sysctl -n vm.stats.vm.v_cache_count")
- memory[:cache] = memory[:page_size].to_i * so.stdout.split($/)[0].to_i
+ memory[:cache] = memory[:page_size].to_i * so.stdout.strip.to_i
so = shell_out("sysctl -n vm.stats.vm.v_wire_count")
- memory[:wired] = memory[:page_size].to_i * so.stdout.split($/)[0].to_i
+ memory[:wired] = memory[:page_size].to_i * so.stdout.strip.to_i
so = shell_out("sysctl -n vfs.bufspace")
- memory[:buffers] = so.stdout.split($/)[0]
+ memory[:buffers] = so.stdout.strip
so = shell_out("swapinfo")
so.stdout.lines do |line|
diff --git a/lib/ohai/plugins/dragonflybsd/network.rb b/lib/ohai/plugins/dragonflybsd/network.rb
index 401bf73e..8296f99c 100644
--- a/lib/ohai/plugins/dragonflybsd/network.rb
+++ b/lib/ohai/plugins/dragonflybsd/network.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Author:: Bryan McLellan (btm@loftninjas.org)
# Copyright:: Copyright (c) 2009 Bryan McLellan
diff --git a/lib/ohai/plugins/dragonflybsd/platform.rb b/lib/ohai/plugins/dragonflybsd/platform.rb
index 169488e2..d46a1e9a 100644
--- a/lib/ohai/plugins/dragonflybsd/platform.rb
+++ b/lib/ohai/plugins/dragonflybsd/platform.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Author:: Bryan McLellan (btm@loftninjas.org)
# Copyright:: Copyright (c) 2009 Bryan McLellan
@@ -20,10 +21,8 @@ Ohai.plugin(:Platform) do
provides "platform", "platform_version", "platform_family"
collect_data(:dragonflybsd) do
- so = shell_out("uname -s")
- platform so.stdout.split($/)[0].downcase
- so = shell_out("uname -r")
- platform_version so.stdout.split($/)[0]
+ platform shell_out("uname -s").stdout.strip.downcase
+ platform_version shell_out("uname -r").stdout.strip
platform_family "dragonflybsd"
end
end
diff --git a/lib/ohai/plugins/ec2.rb b/lib/ohai/plugins/ec2.rb
index a3abf06a..1942ae42 100644
--- a/lib/ohai/plugins/ec2.rb
+++ b/lib/ohai/plugins/ec2.rb
@@ -1,9 +1,10 @@
+# frozen_string_literal: true
#
# Author:: Tim Dysinger (<tim@dysinger.net>)
# Author:: Benjamin Black (<bb@chef.io>)
# Author:: Christopher Brown (<cb@chef.io>)
# Author:: Tim Smith (<tsmith@chef.io>)
-# Copyright:: Copyright (c) 2009-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -28,7 +29,6 @@
Ohai.plugin(:EC2) do
require_relative "../mixin/ec2_metadata"
require_relative "../mixin/http_helper"
- require "base64"
include Ohai::Mixin::Ec2Metadata
include Ohai::Mixin::HttpHelper
@@ -41,7 +41,7 @@ Ohai.plugin(:EC2) do
# @return [Boolean] do we have Amazon DMI data?
def has_ec2_amazon_dmi?
# detect a version of '4.2.amazon'
- if file_val_if_exists("/sys/class/dmi/id/bios_vendor") =~ /Amazon/
+ if /Amazon/.match?(file_val_if_exists("/sys/class/dmi/id/bios_vendor"))
logger.trace("Plugin EC2: has_ec2_amazon_dmi? == true")
true
else
@@ -56,7 +56,7 @@ Ohai.plugin(:EC2) do
# @return [Boolean] do we have Amazon DMI data?
def has_ec2_xen_dmi?
# detect a version of '4.2.amazon'
- if file_val_if_exists("/sys/class/dmi/id/bios_version") =~ /amazon/
+ if /amazon/.match?(file_val_if_exists("/sys/class/dmi/id/bios_version"))
logger.trace("Plugin EC2: has_ec2_xen_dmi? == true")
true
else
@@ -68,7 +68,7 @@ Ohai.plugin(:EC2) do
# looks for a xen UUID that starts with ec2 from within the Linux sys tree
# @return [Boolean] do we have a Xen UUID or not?
def has_ec2_xen_uuid?
- if file_val_if_exists("/sys/hypervisor/uuid") =~ /^ec2/
+ if /^ec2/.match?(file_val_if_exists("/sys/hypervisor/uuid"))
logger.trace("Plugin EC2: has_ec2_xen_uuid? == true")
return true
end
@@ -81,10 +81,10 @@ Ohai.plugin(:EC2) do
# linux hosts
# @return [Boolean] do we have a Xen Identifying Number or not?
def has_ec2_identifying_number?
- if RUBY_PLATFORM =~ /mswin|mingw32|windows/
- require "wmi-lite/wmi"
+ if RUBY_PLATFORM.match?(/mswin|mingw32|windows/)
+ require "wmi-lite/wmi" unless defined?(WmiLite::Wmi)
wmi = WmiLite::Wmi.new
- if wmi.first_of("Win32_ComputerSystemProduct")["identifyingnumber"] =~ /^ec2/
+ if /^ec2/.match?(wmi.first_of("Win32_ComputerSystemProduct")["identifyingnumber"])
logger.trace("Plugin EC2: has_ec2_identifying_number? == true")
true
end
@@ -98,8 +98,8 @@ Ohai.plugin(:EC2) do
# @param path[String] abs path to the file
# @return [String] contents of the file if it exists
def file_val_if_exists(path)
- if ::File.exist?(path)
- ::File.read(path)
+ if file_exist?(path)
+ file_read(path)
end
end
@@ -115,17 +115,25 @@ Ohai.plugin(:EC2) do
end
collect_data do
+ require "base64" unless defined?(Base64)
+
if looks_like_ec2?
logger.trace("Plugin EC2: looks_like_ec2? == true")
ec2 Mash.new
fetch_metadata.each do |k, v|
# fetch_metadata returns IAM security credentials, including the IAM user's
# secret access key. We'd rather not have ohai send this information
- # to the server.
- # http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AESDG-chapter-instancedata.html#instancedata-data-categories
- next if k == "iam" && !hint?("iam")
-
- ec2[k] = v
+ # to the server. If the instance is associated with an IAM role we grab
+ # only the "info" key and the IAM role name.
+ # https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-data-categories.html
+ if k == "iam" && !hint?("iam")
+ ec2[:iam] = v.select { |key, value| key == "info" }
+ if v["security-credentials"] && v["security-credentials"].keys.length == 1
+ ec2[:iam]["role_name"] = v["security-credentials"].keys[0]
+ end
+ else
+ ec2[k] = v
+ end
end
ec2[:userdata] = fetch_userdata
ec2[:account_id] = fetch_dynamic_data["accountId"]
diff --git a/lib/ohai/plugins/elixir.rb b/lib/ohai/plugins/elixir.rb
index 233a9b9d..abf2f618 100644
--- a/lib/ohai/plugins/elixir.rb
+++ b/lib/ohai/plugins/elixir.rb
@@ -15,7 +15,7 @@
Ohai.plugin(:Elixir) do
provides "languages/elixir"
- depends "languages"
+ depends "languages".freeze
collect_data do
diff --git a/lib/ohai/plugins/erlang.rb b/lib/ohai/plugins/erlang.rb
index 108b0473..be33baba 100644
--- a/lib/ohai/plugins/erlang.rb
+++ b/lib/ohai/plugins/erlang.rb
@@ -1,6 +1,7 @@
+# frozen_string_literal: true
#
# Author:: Joe Williams (<joe@joetify.com>)
-# Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/lib/ohai/plugins/eucalyptus.rb b/lib/ohai/plugins/eucalyptus.rb
index a03ece31..25f995ea 100644
--- a/lib/ohai/plugins/eucalyptus.rb
+++ b/lib/ohai/plugins/eucalyptus.rb
@@ -1,8 +1,9 @@
+# frozen_string_literal: true
#
# Author:: Tim Dysinger (<tim@dysinger.net>)
# Author:: Benjamin Black (<bb@chef.io>)
# Author:: Christopher Brown (<cb@chef.io>)
-# Copyright:: Copyright (c) 2009-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -28,6 +29,8 @@ Ohai.plugin(:Eucalyptus) do
provides "eucalyptus"
depends "network/interfaces"
+ MAC_MATCH = /^[dD]0:0[dD]:/.freeze
+
# returns the mac address from the collection of all address types
def get_mac_address(addresses)
detected_addresses = addresses.detect { |address, keypair| keypair == { "family" => "lladdr" } }
@@ -42,7 +45,7 @@ Ohai.plugin(:Eucalyptus) do
def has_euca_mac?
network[:interfaces].each_value do |iface|
mac = get_mac_address(iface[:addresses])
- if mac =~ /^[dD]0:0[dD]:/
+ if MAC_MATCH.match?(mac)
logger.trace("Plugin Eucalyptus: has_euca_mac? == true (#{mac})")
return true
end
diff --git a/lib/ohai/plugins/filesystem.rb b/lib/ohai/plugins/filesystem.rb
index ab3f8f99..5049e1bd 100644
--- a/lib/ohai/plugins/filesystem.rb
+++ b/lib/ohai/plugins/filesystem.rb
@@ -6,7 +6,7 @@
# Author:: Prabhu Das (<prabhu.das@clogeny.com>)
# Author:: Isa Farnik (<isa@chef.io>)
# Author:: James Gartrell (<jgartrel@gmail.com>)
-# Copyright:: Copyright (c) 2008-2020 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# Copyright:: Copyright (c) 2015 Facebook, Inc.
# License:: Apache License, Version 2.0
#
@@ -23,15 +23,13 @@
# limitations under the License.
#
-require "set"
-
Ohai.plugin(:Filesystem) do
- provides "filesystem"
+ provides "filesystem".freeze
def find_device(name)
%w{/dev /dev/mapper}.each do |dir|
path = File.join(dir, name)
- return path if File.exist?(path)
+ return path if file_exist?(path)
end
name
end
@@ -286,12 +284,10 @@ Ohai.plugin(:Filesystem) do
# Grab filesystem data from df
run_with_check("df") do
- so = shell_out("df -P")
- fs.merge!(parse_common_df(so.stdout))
+ fs.merge!(parse_common_df(shell_out("df -P").stdout))
# Grab filesystem inode data from df
- so = shell_out("df -iP")
- so.stdout.each_line do |line|
+ shell_out("df -iP").stdout.each_line do |line|
case line
when /^Filesystem\s+Inodes/
next
@@ -310,8 +306,7 @@ Ohai.plugin(:Filesystem) do
# Grab mount information from /bin/mount
run_with_check("mount") do
- so = shell_out("mount")
- so.stdout.each_line do |line|
+ shell_out("mount").stdout.each_line do |line|
if line =~ /^(.+?) on (.+?) type (.+?) \((.+?)\)$/
key = "#{$1},#{$2}"
fs[key] ||= Mash.new
@@ -346,8 +341,7 @@ Ohai.plugin(:Filesystem) do
# this is to allow machines with large amounts of attached LUNs
# to respond back to the command successfully
run_with_check(cmdtype) do
- so = shell_out(cmd, timeout: 60)
- so.stdout.each_line do |line|
+ shell_out(cmd, timeout: 60).stdout.each_line do |line|
parsed = parse_line(line, cmdtype)
next if parsed.nil?
@@ -377,13 +371,12 @@ Ohai.plugin(:Filesystem) do
end
# Grab any missing mount information from /proc/mounts
- if File.exist?("/proc/mounts")
+ if file_exist?("/proc/mounts")
mounts = ""
# Due to https://tickets.opscode.com/browse/OHAI-196
# we have to non-block read dev files. Ew.
- f = File.open("/proc/mounts")
+ f = file_open("/proc/mounts")
loop do
-
data = f.read_nonblock(4096)
mounts << data
# We should just catch EOFError, but the kernel had a period of
@@ -392,9 +385,9 @@ Ohai.plugin(:Filesystem) do
# whatever data we might have
rescue Exception
break
-
end
f.close
+
mounts.each_line do |line|
if line =~ /^(\S+) (\S+) (\S+) (\S+) \S+ \S+$/
key = "#{$1},#{$2}"
@@ -590,16 +583,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("/")
@@ -718,7 +711,8 @@ Ohai.plugin(:Filesystem) do
end
collect_data(:windows) do
- require "wmi-lite/wmi"
+ require "set" unless defined?(Set)
+ require "wmi-lite/wmi" unless defined?(WmiLite::Wmi)
require_relative "../mash"
fs = merge_info(logical_info, encryptable_info)
diff --git a/lib/ohai/plugins/fips.rb b/lib/ohai/plugins/fips.rb
index 4c63be88..7cf40fdf 100644
--- a/lib/ohai/plugins/fips.rb
+++ b/lib/ohai/plugins/fips.rb
@@ -1,6 +1,7 @@
+# frozen_string_literal: true
#
# Author:: Matt Wrock (<matt@mattwrock.com>)
-# Copyright:: Copyright (c) 2016-2018 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -29,10 +30,6 @@ Ohai.plugin(:Fips) do
fips Mash.new
require "openssl" unless defined?(OpenSSL)
- if defined?(OpenSSL.fips_mode) && OpenSSL.fips_mode && !$FIPS_TEST_MODE
- fips["kernel"] = { "enabled" => true }
- else
- fips["kernel"] = { "enabled" => false }
- end
+ fips["kernel"] = { "enabled" => OpenSSL::OPENSSL_FIPS }
end
end
diff --git a/lib/ohai/plugins/freebsd/memory.rb b/lib/ohai/plugins/freebsd/memory.rb
index 0b0cf327..82fcef6d 100644
--- a/lib/ohai/plugins/freebsd/memory.rb
+++ b/lib/ohai/plugins/freebsd/memory.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Author:: Bryan McLellan (btm@loftninjas.org)
# Copyright:: Copyright (c) 2009 Bryan McLellan
@@ -25,22 +26,22 @@ Ohai.plugin(:Memory) do
# /usr/src/sys/sys/vmmeter.h
so = shell_out("sysctl -n vm.stats.vm.v_page_size")
- memory[:page_size] = so.stdout.split($/)[0]
+ memory[:page_size] = so.stdout.strip
so = shell_out("sysctl -n vm.stats.vm.v_page_count")
- memory[:page_count] = so.stdout.split($/)[0]
+ memory[:page_count] = so.stdout.strip
memory[:total] = memory[:page_size].to_i * memory[:page_count].to_i
so = shell_out("sysctl -n vm.stats.vm.v_free_count")
- memory[:free] = memory[:page_size].to_i * so.stdout.split($/)[0].to_i
+ memory[:free] = memory[:page_size].to_i * so.stdout.strip.to_i
so = shell_out("sysctl -n vm.status.vm.v_active_count")
- memory[:active] = memory[:page_size].to_i * so.stdout.split($/)[0].to_i
+ memory[:active] = memory[:page_size].to_i * so.stdout.strip.to_i
so = shell_out("sysctl -n vm.status.vm.v_inactive_count")
- memory[:inactive] = memory[:page_size].to_i * so.stdout.split($/)[0].to_i
+ memory[:inactive] = memory[:page_size].to_i * so.stdout.strip.to_i
so = shell_out("sysctl -n vm.stats.vm.v_cache_count")
- memory[:cache] = memory[:page_size].to_i * so.stdout.split($/)[0].to_i
+ memory[:cache] = memory[:page_size].to_i * so.stdout.strip.to_i
so = shell_out("sysctl -n vm.stats.vm.v_wire_count")
- memory[:wired] = memory[:page_size].to_i * so.stdout.split($/)[0].to_i
+ memory[:wired] = memory[:page_size].to_i * so.stdout.strip.to_i
so = shell_out("sysctl -n vfs.bufspace")
- memory[:buffers] = so.stdout.split($/)[0]
+ memory[:buffers] = so.stdout.strip
so = shell_out("swapinfo")
so.stdout.lines do |line|
diff --git a/lib/ohai/plugins/freebsd/network.rb b/lib/ohai/plugins/freebsd/network.rb
index 1263086a..9ec9498c 100644
--- a/lib/ohai/plugins/freebsd/network.rb
+++ b/lib/ohai/plugins/freebsd/network.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Author:: Bryan McLellan (btm@loftninjas.org)
# Copyright:: Copyright (c) 2009 Bryan McLellan
diff --git a/lib/ohai/plugins/freebsd/platform.rb b/lib/ohai/plugins/freebsd/platform.rb
index bef7b73e..1e53e249 100644
--- a/lib/ohai/plugins/freebsd/platform.rb
+++ b/lib/ohai/plugins/freebsd/platform.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Author:: Bryan McLellan (btm@loftninjas.org)
# Copyright:: Copyright (c) 2009 Bryan McLellan
@@ -20,10 +21,8 @@ Ohai.plugin(:Platform) do
provides "platform", "platform_version", "platform_family"
collect_data(:freebsd) do
- so = shell_out("uname -s")
- platform so.stdout.split($/)[0].downcase
- so = shell_out("uname -r")
- platform_version so.stdout.split($/)[0]
+ platform shell_out("uname -s").stdout.strip.downcase
+ platform_version shell_out("uname -r").stdout.strip
platform_family "freebsd"
end
end
diff --git a/lib/ohai/plugins/gce.rb b/lib/ohai/plugins/gce.rb
index 0b2a0155..90d63e96 100644
--- a/lib/ohai/plugins/gce.rb
+++ b/lib/ohai/plugins/gce.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Author:: Ranjib Dey (<dey.ranjib@google.com>)
# License:: Apache License, Version 2.0
@@ -27,7 +28,7 @@ Ohai.plugin(:GCE) do
# this works even if the system lacks dmidecode use by the Dmi plugin
# @return [Boolean] do we have Google Compute Engine DMI data?
def has_gce_dmi?
- if file_val_if_exists("/sys/class/dmi/id/product_name") =~ /Google Compute Engine/
+ if /Google Compute Engine/.match?(file_val_if_exists("/sys/class/dmi/id/product_name"))
logger.trace("Plugin GCE: has_gce_dmi? == true")
true
else
@@ -40,16 +41,16 @@ Ohai.plugin(:GCE) do
# @param path[String] abs path to the file
# @return [String] contents of the file if it exists
def file_val_if_exists(path)
- if ::File.exist?(path)
- ::File.read(path)
+ if file_exist?(path)
+ file_read(path)
end
end
# looks at the Manufacturer and Model WMI values to see if they starts with Google.
# @return [Boolean] Are the manufacturer and model Google?
def has_gce_system_info?
- if RUBY_PLATFORM =~ /mswin|mingw32|windows/
- require "wmi-lite/wmi"
+ if RUBY_PLATFORM.match?(/mswin|mingw32|windows/)
+ require "wmi-lite/wmi" unless defined?(WmiLite::Wmi)
wmi = WmiLite::Wmi.new
computer_system = wmi.first_of("Win32_ComputerSystem")
if computer_system["Manufacturer"] =~ /^Google/ && computer_system["Model"] =~ /^Google/
diff --git a/lib/ohai/plugins/go.rb b/lib/ohai/plugins/go.rb
index 65eb23c8..8c1ccbc2 100644
--- a/lib/ohai/plugins/go.rb
+++ b/lib/ohai/plugins/go.rb
@@ -15,7 +15,7 @@
Ohai.plugin(:Go) do
provides "languages/go"
- depends "languages"
+ depends "languages".freeze
collect_data do
diff --git a/lib/ohai/plugins/groovy.rb b/lib/ohai/plugins/groovy.rb
index 7b4134ff..a9d2024d 100644
--- a/lib/ohai/plugins/groovy.rb
+++ b/lib/ohai/plugins/groovy.rb
@@ -18,7 +18,7 @@
Ohai.plugin(:Groovy) do
provides "languages/groovy"
- depends "languages"
+ depends "languages".freeze
collect_data do
diff --git a/lib/ohai/plugins/haskell.rb b/lib/ohai/plugins/haskell.rb
index 50d08b3d..5ae27ae1 100644
--- a/lib/ohai/plugins/haskell.rb
+++ b/lib/ohai/plugins/haskell.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Author:: Chris Dituri (<csdituri@gmail.com>)
# Copyright:: Copyright (c) 2016 Chris Dituri
# License:: Apache License, Version 2.0
diff --git a/lib/ohai/plugins/hostname.rb b/lib/ohai/plugins/hostname.rb
index 1a624b00..7940ada2 100644
--- a/lib/ohai/plugins/hostname.rb
+++ b/lib/ohai/plugins/hostname.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Author:: Adam Jacob (<adam@chef.io>)
# Author:: Benjamin Black (<nostromo@gmail.com>)
@@ -6,7 +7,7 @@
# Author:: Doug MacEachern (<dougm@vmware.com>)
# Author:: James Gartrell (<jgartrel@gmail.com>)
# Author:: Isa Farnik (<isa@chef.io>)
-# Copyright:: Copyright (c) 2008-2018, Chef Software Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# Copyright:: Copyright (c) 2009 Bryan McLellan
# Copyright:: Copyright (c) 2009 Daniel DeLeo
# Copyright:: Copyright (c) 2010 VMware, Inc.
@@ -26,9 +27,6 @@
#
Ohai.plugin(:Hostname) do
- require "socket" unless defined?(Socket)
- require "ipaddr"
-
provides "domain", "hostname", "fqdn", "machinename"
# hostname : short hostname
@@ -40,13 +38,15 @@ Ohai.plugin(:Hostname) do
# fqdn and domain may be broken if DNS is broken on the host
def from_cmd(cmd)
- so = shell_out(cmd)
- so.stdout.split($/)[0]
+ shell_out(cmd).stdout.strip
end
# forward and reverse lookup to canonicalize FQDN (hostname -f equivalent)
# this is ipv6-safe, works on ruby 1.8.7+
def resolve_fqdn
+ require "socket" unless defined?(Socket)
+ require "ipaddr" unless defined?(IPAddr)
+
hostname = from_cmd("hostname")
addrinfo = Socket.getaddrinfo(hostname, nil).first
iaddr = IPAddr.new(addrinfo[3])
@@ -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")
@@ -161,7 +161,7 @@ Ohai.plugin(:Hostname) do
end
collect_data(:windows) do
- require "wmi-lite/wmi"
+ require "wmi-lite/wmi" unless defined?(WmiLite::Wmi)
require "socket" unless defined?(Socket)
wmi = WmiLite::Wmi.new
@@ -171,14 +171,14 @@ Ohai.plugin(:Hostname) do
machinename host["name"].to_s
info = Socket.gethostbyname(Socket.gethostname)
- if info.first =~ /.+?\.(.*)/
+ if /.+?\.(.*)/.match?(info.first)
fqdn info.first
else
# host is not in dns. optionally use:
# C:\WINDOWS\system32\drivers\etc\hosts
info[3..info.length].reverse_each do |addr|
hostent = Socket.gethostbyaddr(addr)
- if hostent.first =~ /.+?\.(.*)/
+ if /.+?\.(.*)/.match?(hostent.first)
fqdn hostent.first
break
end
diff --git a/lib/ohai/plugins/init_package.rb b/lib/ohai/plugins/init_package.rb
index e3162cf0..fa2b9453 100644
--- a/lib/ohai/plugins/init_package.rb
+++ b/lib/ohai/plugins/init_package.rb
@@ -1,6 +1,7 @@
+# frozen_string_literal: true
#
# Author:: Caleb Tennis (<caleb.tennis@gmail.com>)
-# Copyright:: Copyright (c) 2012-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -20,6 +21,6 @@ Ohai.plugin(:InitPackage) do
provides "init_package"
collect_data(:linux) do
- init_package File.exist?("/proc/1/comm") ? File.open("/proc/1/comm").gets.chomp : "init"
+ init_package file_exist?("/proc/1/comm") ? file_open("/proc/1/comm").gets.chomp : "init"
end
end
diff --git a/lib/ohai/plugins/java.rb b/lib/ohai/plugins/java.rb
index 1beff3fa..55b9ce70 100644
--- a/lib/ohai/plugins/java.rb
+++ b/lib/ohai/plugins/java.rb
@@ -1,6 +1,7 @@
+# frozen_string_literal: true
#
# Author:: Benjamin Black (<bb@chef.io>)
-# Copyright:: Copyright (c) 2009-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/lib/ohai/plugins/joyent.rb b/lib/ohai/plugins/joyent.rb
deleted file mode 100644
index 118ea907..00000000
--- a/lib/ohai/plugins/joyent.rb
+++ /dev/null
@@ -1,77 +0,0 @@
-#
-# Author: sawanoboriyu@higanworks.com
-# Copyright (C) 2014 HiganWorks LLC
-# License:: Apache License, Version 2.0
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-#
-
-# Reference from: sm-summary command
-
-Ohai.plugin(:Joyent) do
- provides "joyent"
- provides "virtualization/guest_id"
- depends "os", "platform", "virtualization"
-
- def collect_product_file
- data = ::File.read("/etc/product") rescue nil
- if data
- data.strip.split("\n")
- else
- []
- end
- end
-
- def collect_pkgsrc
- data = ::File.read("/opt/local/etc/pkg_install.conf") rescue nil
- if data
- /PKG_PATH=(.*)/.match(data)[1] rescue nil
- end
- end
-
- def is_smartos?
- platform == "smartos"
- end
-
- collect_data do
- if is_smartos?
- joyent Mash.new
-
- # copy uuid
- joyent[:sm_uuid] = virtualization[:guest_uuid]
-
- # get zone id unless globalzone
- unless joyent[:sm_uuid] == "global"
- joyent[:sm_id] = virtualization[:guest_id]
- end
-
- # retrieve image name and pkgsrc
- collect_product_file.each do |line|
- case line
- when /^Image/
- sm_image = line.split(" ")
- joyent[:sm_image_id] = sm_image[1]
- joyent[:sm_image_ver] = sm_image[2]
- when /^Base Image/
- sm_baseimage = line.split(" ")
- joyent[:sm_baseimage_id] = sm_baseimage[2]
- joyent[:sm_baseimage_ver] = sm_baseimage[3]
- end
- end
-
- ## retrieve pkgsrc
- joyent[:sm_pkgsrc] = collect_pkgsrc
- end
- end
-end
diff --git a/lib/ohai/plugins/kernel.rb b/lib/ohai/plugins/kernel.rb
index 7a1e85e7..e96967d6 100644
--- a/lib/ohai/plugins/kernel.rb
+++ b/lib/ohai/plugins/kernel.rb
@@ -1,10 +1,11 @@
+# frozen_string_literal: true
#
# Author:: Adam Jacob (<adam@chef.io>)
# Author:: Benjamin Black (<nostromo@gmail.com>)
# Author:: Bryan McLellan (<btm@loftninjas.org>)
# Author:: Claire McQuin (<claire@chef.io>)
# Author:: James Gartrell (<jgartrel@gmail.com>)
-# Copyright:: Copyright (c) 2008-2018 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# Copyright:: Copyright (c) 2009 Bryan McLellan
# License:: Apache License, Version 2.0
#
@@ -33,7 +34,7 @@ Ohai.plugin(:Kernel) do
["uname -v", :version], ["uname -m", :machine],
["uname -p", :processor]].each do |cmd, property|
so = shell_out(cmd)
- kernel[property] = so.stdout.split($/)[0]
+ kernel[property] = so.stdout.strip
end
kernel
end
@@ -42,7 +43,7 @@ Ohai.plugin(:Kernel) do
# @return [Mash]
def bsd_modules(path)
modules = Mash.new
- so = shell_out((Ohai.abs_path(path)).to_s)
+ so = shell_out(Ohai.abs_path(path).to_s)
so.stdout.lines do |line|
# 1 7 0xc0400000 97f830 kernel
if line =~ /(\d+)\s+(\d+)\s+([0-9a-fx]+)\s+([0-9a-fx]+)\s+([a-zA-Z0-9\_]+)/
@@ -137,11 +138,12 @@ Ohai.plugin(:Kernel) do
end
end
- # see if a WMI name is blacklisted so we can avoid writing out
- # useless data to ohai
+ # see if a WMI name is in the blocked list so we can avoid writing
+ # out useless data to ohai
+ #
# @param [String] name the wmi name to check
- # @return [Boolean] is the wmi name blacklisted
- def blacklisted_wmi_name?(name)
+ # @return [Boolean] is the wmi name in the blocked list
+ def blocked_wmi_name?(name)
[
"creation_class_name", # this is just the wmi name
"cs_creation_class_name", # this is just the wmi name
@@ -155,6 +157,10 @@ Ohai.plugin(:Kernel) do
].include?(name)
end
+ collect_data(:target) do
+ # intentionally left blank
+ end
+
collect_data(:default) do
kernel init_kernel
end
@@ -164,7 +170,7 @@ Ohai.plugin(:Kernel) do
kernel[:os] = kernel[:name]
so = shell_out("sysctl -n hw.optional.x86_64")
- if so.stdout.split($/)[0].to_i == 1
+ if so.stdout.strip.to_i == 1
kernel[:machine] = "x86_64"
end
@@ -184,7 +190,7 @@ Ohai.plugin(:Kernel) do
kernel[:os] = kernel[:name]
so = shell_out("uname -i")
- kernel[:ident] = so.stdout.split($/)[0]
+ kernel[:ident] = so.stdout.strip
so = shell_out("sysctl kern.securelevel")
kernel[:securelevel] = so.stdout.split($/).select { |e| e =~ /kern.securelevel: (.+)$/ }
@@ -195,7 +201,7 @@ Ohai.plugin(:Kernel) do
kernel init_kernel
so = shell_out("uname -o")
- kernel[:os] = so.stdout.split($/)[0]
+ kernel[:os] = so.stdout.strip
modules = Mash.new
so = shell_out("env lsmod")
@@ -203,8 +209,8 @@ Ohai.plugin(:Kernel) do
if line =~ /([a-zA-Z0-9\_]+)\s+(\d+)\s+(\d+)/
modules[$1] = { size: $2, refcount: $3 }
# Making sure to get the module version that has been loaded
- if File.exist?("/sys/module/#{$1}/version")
- version = File.read("/sys/module/#{$1}/version").chomp.strip
+ if file_exist?("/sys/module/#{$1}/version")
+ version = file_read("/sys/module/#{$1}/version").chomp.strip
modules[$1]["version"] = version unless version.empty?
end
end
@@ -227,9 +233,9 @@ Ohai.plugin(:Kernel) do
kernel init_kernel
so = shell_out("uname -s")
- kernel[:os] = so.stdout.split($/)[0]
+ kernel[:os] = so.stdout.strip
- so = File.open("/etc/release", &:gets)
+ so = file_open("/etc/release", &:gets)
md = /(?<update>\d.*\d)/.match(so)
kernel[:update] = md[:update] if md
@@ -239,7 +245,7 @@ Ohai.plugin(:Kernel) do
# EXAMPLE:
# Id Loadaddr Size Info Rev Module Name
# 6 1180000 4623 1 1 specfs (filesystem for specfs)
- module_description = /[\s]*([\d]+)[\s]+([a-f\d]+)[\s]+([a-f\d]+)[\s]+(?:[\-\d]+)[\s]+(?:[\d]+)[\s]+([\S]+)[\s]+\((.+)\)$/
+ module_description = /\s*(\d+)\s+([a-f\d]+)\s+([a-f\d]+)\s+(?:[\-\d]+)\s+(?:\d+)\s+(\S+)\s+\((.+)\)$/
so.stdout.lines do |line|
if ( mod = module_description.match(line) )
modules[mod[4]] = { id: mod[1].to_i, loadaddr: mod[2], size: mod[3].to_i(16), description: mod[5] }
@@ -251,7 +257,7 @@ Ohai.plugin(:Kernel) do
collect_data(:windows) do
require "win32ole" unless defined?(WIN32OLE)
- require "wmi-lite/wmi"
+ require "wmi-lite/wmi" unless defined?(WmiLite::Wmi)
WIN32OLE.codepage = WIN32OLE::CP_UTF8
@@ -262,7 +268,7 @@ Ohai.plugin(:Kernel) do
host = wmi.first_of("Win32_OperatingSystem")
kernel[:os_info] = Mash.new
host.wmi_ole_object.properties_.each do |p|
- next if blacklisted_wmi_name?(p.name.wmi_underscore)
+ next if blocked_wmi_name?(p.name.wmi_underscore)
kernel[:os_info][p.name.wmi_underscore.to_sym] = host[p.name.downcase]
end
@@ -277,7 +283,7 @@ Ohai.plugin(:Kernel) do
kernel[:cs_info] = Mash.new
host = wmi.first_of("Win32_ComputerSystem")
host.wmi_ole_object.properties_.each do |p|
- next if blacklisted_wmi_name?(p.name.wmi_underscore)
+ next if blocked_wmi_name?(p.name.wmi_underscore)
kernel[:cs_info][p.name.wmi_underscore.to_sym] = host[p.name.downcase]
end
diff --git a/lib/ohai/plugins/keys.rb b/lib/ohai/plugins/keys.rb
index 72cb8b99..920a06b5 100644
--- a/lib/ohai/plugins/keys.rb
+++ b/lib/ohai/plugins/keys.rb
@@ -1,8 +1,9 @@
+# frozen_string_literal: true
#
# Cookbook Name:: apache2
# Recipe:: default
#
-# Copyright 2008-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/ohai/plugins/languages.rb b/lib/ohai/plugins/languages.rb
index a0894f1f..68e87d8a 100644
--- a/lib/ohai/plugins/languages.rb
+++ b/lib/ohai/plugins/languages.rb
@@ -1,6 +1,7 @@
+# frozen_string_literal: true
#
# Author:: Adam Jacob (<adam@chef.io>)
-# Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/lib/ohai/plugins/libvirt.rb b/lib/ohai/plugins/libvirt.rb
index 12778aa3..15b0fa40 100644
--- a/lib/ohai/plugins/libvirt.rb
+++ b/lib/ohai/plugins/libvirt.rb
@@ -1,6 +1,7 @@
+# frozen_string_literal: true
#
# Author:: Benjamin Black (<bb@chef.io>)
-# Copyright:: Copyright (c) 2009-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/lib/ohai/plugins/linode.rb b/lib/ohai/plugins/linode.rb
index 64e8a62f..c1cb8ae3 100644
--- a/lib/ohai/plugins/linode.rb
+++ b/lib/ohai/plugins/linode.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Author:: Aaron Kalin (<akalin@martinisoftware.com>)
# License:: Apache License, Version 2.0
@@ -25,7 +26,7 @@ Ohai.plugin(:Linode) do
# Returns true or false
def has_linode_kernel?
if ( kernel_data = kernel )
- kernel_data[:release].split("-").last =~ /linode/
+ kernel_data[:release].split("-").last.include?("linode")
end
end
diff --git a/lib/ohai/plugins/linux/block_device.rb b/lib/ohai/plugins/linux/block_device.rb
index e0133189..36905fc4 100644
--- a/lib/ohai/plugins/linux/block_device.rb
+++ b/lib/ohai/plugins/linux/block_device.rb
@@ -1,6 +1,7 @@
+# frozen_string_literal: true
#
# Author:: Adam Jacob (<adam@chef.io>)
-# Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -20,24 +21,24 @@ Ohai.plugin(:BlockDevice) do
provides "block_device"
collect_data(:linux) do
- if File.exist?("/sys/block")
+ if file_exist?("/sys/block")
block = Mash.new
- Dir["/sys/block/*"].each do |block_device_dir|
+ dir_glob("/sys/block/*").each do |block_device_dir|
dir = File.basename(block_device_dir)
block[dir] = Mash.new
%w{size removable}.each do |check|
- if File.exist?("/sys/block/#{dir}/#{check}")
- File.open("/sys/block/#{dir}/#{check}") { |f| block[dir][check] = f.read_nonblock(1024).strip }
+ if file_exist?("/sys/block/#{dir}/#{check}")
+ file_open("/sys/block/#{dir}/#{check}") { |f| block[dir][check] = f.read_nonblock(1024).strip }
end
end
%w{model rev state timeout vendor queue_depth}.each do |check|
- if File.exist?("/sys/block/#{dir}/device/#{check}")
- File.open("/sys/block/#{dir}/device/#{check}") { |f| block[dir][check] = f.read_nonblock(1024).strip }
+ if file_exist?("/sys/block/#{dir}/device/#{check}")
+ file_open("/sys/block/#{dir}/device/#{check}") { |f| block[dir][check] = f.read_nonblock(1024).strip }
end
end
%w{rotational physical_block_size logical_block_size}.each do |check|
- if File.exist?("/sys/block/#{dir}/queue/#{check}")
- File.open("/sys/block/#{dir}/queue/#{check}") { |f| block[dir][check] = f.read_nonblock(1024).strip }
+ if file_exist?("/sys/block/#{dir}/queue/#{check}")
+ file_open("/sys/block/#{dir}/queue/#{check}") { |f| block[dir][check] = f.read_nonblock(1024).strip }
end
end
end
diff --git a/lib/ohai/plugins/linux/hostnamectl.rb b/lib/ohai/plugins/linux/hostnamectl.rb
index 960b7c42..8f16e246 100644
--- a/lib/ohai/plugins/linux/hostnamectl.rb
+++ b/lib/ohai/plugins/linux/hostnamectl.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Author:: Davide Cavalca (<dcavalca@fb.com>)
# Copyright:: Copyright (c) 2016 Facebook
@@ -24,10 +25,9 @@ Ohai.plugin(:Hostnamectl) do
hostnamectl_path = which("hostnamectl")
if hostnamectl_path
- hostnamectl_cmd = shell_out(hostnamectl_path)
- hostnamectl_cmd.stdout.split("\n").each do |line|
- key, val = line.split(":")
- hostnamectl[key.chomp.lstrip.tr(" ", "_").downcase] = val.chomp.lstrip
+ shell_out(hostnamectl_path).stdout.split("\n").each do |line|
+ key, val = line.split(": ", 2)
+ hostnamectl[key.chomp.lstrip.tr(" ", "_").downcase] = val
end
end
end
diff --git a/lib/ohai/plugins/linux/interrupts.rb b/lib/ohai/plugins/linux/interrupts.rb
index 7f0ceda7..79023339 100644
--- a/lib/ohai/plugins/linux/interrupts.rb
+++ b/lib/ohai/plugins/linux/interrupts.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Author:: Davide Cavalca <dcavalca@fb.com>
# Copyright:: Copyright (c) 2020 Facebook
@@ -25,7 +26,7 @@ Ohai.plugin(:Interrupts) do
# format: comma-separate list of 32bit bitmask in hex
# each bit is a CPU, right to left ordering (i.e. CPU0 is rightmost)
def parse_smp_affinity(path, cpus)
- masks = File.read(path).strip
+ masks = file_read(path).strip
bit_masks = []
masks.split(",").each do |mask|
bit_masks << mask.rjust(8, "0").to_i(16).to_s(2)
@@ -47,7 +48,7 @@ Ohai.plugin(:Interrupts) do
parse_smp_affinity("/proc/irq/default_smp_affinity", cpus)
interrupts[:irq] = Mash.new
- File.open("/proc/interrupts").each do |line|
+ file_open("/proc/interrupts").each do |line|
# Documentation: https://www.kernel.org/doc/Documentation/filesystems/proc.txt
# format is "{irqn}: {CPUn...} [type] [vector] [device]"
irqn, fields = line.split(":", 2)
@@ -65,12 +66,12 @@ Ohai.plugin(:Interrupts) do
interrupts[:irq][irqn][:events_by_cpu][cpu] = fields[cpu].to_i
end
# Only regular IRQs have extra fields and affinity settings
- if /^\d+$/.match(irqn)
+ if /^\d+$/.match?(irqn)
interrupts[:irq][irqn][:type],
interrupts[:irq][irqn][:vector],
interrupts[:irq][irqn][:device] =
fields[cpus].split
- if File.exist?("/proc/irq/#{irqn}/smp_affinity")
+ if file_exist?("/proc/irq/#{irqn}/smp_affinity")
interrupts[:irq][irqn][:smp_affinity_by_cpu] =
parse_smp_affinity("/proc/irq/#{irqn}/smp_affinity", cpus)
end
diff --git a/lib/ohai/plugins/linux/ipc.rb b/lib/ohai/plugins/linux/ipc.rb
index 6a063192..a11b50ad 100644
--- a/lib/ohai/plugins/linux/ipc.rb
+++ b/lib/ohai/plugins/linux/ipc.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Author:: Jay Vana <jsvana@fb.com>
# Author:: Davide Cavalca <dcavalca@fb.com>
@@ -41,7 +42,7 @@ Ohai.plugin(:IPC) do
"perms" => parts[3],
"bytes" => parts[4].to_i,
"nattch" => parts[5].to_i,
- "status" => parts[6] ? parts[6] : "",
+ "status" => parts[6] || "",
}
ipc["shm"][parts[1].to_i] = segment
diff --git a/lib/ohai/plugins/linux/lsb.rb b/lib/ohai/plugins/linux/lsb.rb
index eb15178c..4b18a355 100644
--- a/lib/ohai/plugins/linux/lsb.rb
+++ b/lib/ohai/plugins/linux/lsb.rb
@@ -1,6 +1,7 @@
+# frozen_string_literal: true
#
# Author:: Adam Jacob (<adam@chef.io>)
-# Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -22,39 +23,24 @@ Ohai.plugin(:LSB) do
collect_data(:linux) do
lsb Mash.new
- if File.exist?("/usr/bin/lsb_release")
+ if file_exist?("/usr/bin/lsb_release")
# From package redhat-lsb on Fedora/Redhat, lsb-release on Debian/Ubuntu
- so = shell_out("lsb_release -a")
- so.stdout.lines do |line|
+ shell_out("lsb_release -a").stdout.lines do |line|
case line
- when /^Distributor ID:\s+(.+)$/
+ when /^Distributor ID:\s+(.+)/
lsb[:id] = $1
- when /^Description:\s+(.+)$/
+ when /^Description:\s+(.+)/
lsb[:description] = $1
- when /^Release:\s+(.+)$/
+ when /^Release:\s+(.+)/
lsb[:release] = $1
- when /^Codename:\s+(.+)$/
+ when /^Codename:\s+(.+)/
lsb[:codename] = $1
else
lsb[:id] = line
end
end
- elsif File.exist?("/etc/lsb-release")
- # Old, non-standard Debian support
- File.open("/etc/lsb-release").each do |line|
- case line
- when /^DISTRIB_ID=["']?(.+?)["']?$/
- lsb[:id] = $1
- when /^DISTRIB_RELEASE=["']?(.+?)["']?$/
- lsb[:release] = $1
- when /^DISTRIB_CODENAME=["']?(.+?)["']?$/
- lsb[:codename] = $1
- when /^DISTRIB_DESCRIPTION=["']?(.+?)["']?$/
- lsb[:description] = $1
- end
- end
else
- logger.trace("Plugin LSB: Skipping LSB, cannot find /etc/lsb-release or /usr/bin/lsb_release")
+ logger.trace("Plugin LSB: Skipping LSB, cannot find /usr/bin/lsb_release")
end
end
end
diff --git a/lib/ohai/plugins/linux/lspci.rb b/lib/ohai/plugins/linux/lspci.rb
index 997544a5..08b2a6d9 100644
--- a/lib/ohai/plugins/linux/lspci.rb
+++ b/lib/ohai/plugins/linux/lspci.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Author:: Joerg Herzinger <joerg.herzinger@oiml.at>
# Author:: Phil Dibowitz <phil@ipom.com>
@@ -24,7 +25,6 @@ Ohai.plugin(:Lspci) do
collect_data(:linux) do
devices = Mash.new
- lspci = shell_out("lspci -vnnmk")
h = /[0-9a-fA-F]/ # any hex digit
hh = /#{h}#{h}/ # any 2 hex digits
@@ -46,7 +46,7 @@ Ohai.plugin(:Lspci) do
end
end
- lspci.stdout.split("\n").each do |line|
+ shell_out("lspci -vnnmk").stdout.split("\n").each do |line|
dev = line.scan(/^(.*):\s(.*)$/)[0]
next if dev.nil?
diff --git a/lib/ohai/plugins/linux/machineid.rb b/lib/ohai/plugins/linux/machineid.rb
index 56b22227..1877afb9 100644
--- a/lib/ohai/plugins/linux/machineid.rb
+++ b/lib/ohai/plugins/linux/machineid.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Author:: Davide Cavalca (<dcavalca@fb.com>)
# Copyright:: Copyright (c) 2016 Facebook
@@ -20,12 +21,12 @@ Ohai.plugin(:Machineid) do
provides "machine_id"
collect_data(:linux) do
- mid = nil
-
- if ::File.exist?("/etc/machine-id")
- mid = ::File.read("/etc/machine-id").chomp
- elsif ::File.exist?("/var/lib/dbus/machine-id")
- mid = ::File.read("/var/lib/dbus/machine-id").chomp
+ if file_exist?("/etc/machine-id")
+ mid = file_read("/etc/machine-id").chomp
+ elsif file_exist?("/var/lib/dbus/machine-id")
+ mid = file_read("/var/lib/dbus/machine-id").chomp
+ else
+ mid = nil
end
if mid
diff --git a/lib/ohai/plugins/linux/mdadm.rb b/lib/ohai/plugins/linux/mdadm.rb
index 407e1dd9..f7bfc528 100644
--- a/lib/ohai/plugins/linux/mdadm.rb
+++ b/lib/ohai/plugins/linux/mdadm.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Author:: Tim Smith <tsmith@limelight.com>
# Author:: Phil Dibowitz <phild@ipomc.com>
@@ -53,9 +54,9 @@ Ohai.plugin(:Mdadm) do
collect_data(:linux) do
# gather a list of all raid arrays
- if File.exist?("/proc/mdstat")
+ if file_exist?("/proc/mdstat")
devices = {}
- File.open("/proc/mdstat").each do |line|
+ file_open("/proc/mdstat").each do |line|
if line =~ /(md[0-9]+)/
device = Regexp.last_match[1]
pieces = line.split(/\s+/)
@@ -105,7 +106,7 @@ Ohai.plugin(:Mdadm) do
# 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
+ # if the mdadm command was successful 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]["active"]
mdadm[device]["spares"] = devices[device]["spare"]
diff --git a/lib/ohai/plugins/linux/memory.rb b/lib/ohai/plugins/linux/memory.rb
index 324364f4..216d89ba 100644
--- a/lib/ohai/plugins/linux/memory.rb
+++ b/lib/ohai/plugins/linux/memory.rb
@@ -1,6 +1,7 @@
+# frozen_string_literal: true
#
# Author:: Adam Jacob (<adam@chef.io>)
-# Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -25,79 +26,79 @@ Ohai.plugin(:Memory) do
memory[:hugepages] = Mash.new
memory[:directmap] = Mash.new
- File.open("/proc/meminfo").each do |line|
+ file_open("/proc/meminfo").each do |line|
case line
- when /^MemTotal:\s+(\d+) (.+)$/
+ when /^MemTotal:\s+(\d+) (.+)/
memory[:total] = "#{$1}#{$2}"
- when /^MemFree:\s+(\d+) (.+)$/
+ when /^MemFree:\s+(\d+) (.+)/
memory[:free] = "#{$1}#{$2}"
- when /^MemAvailable:\s+(\d+) (.+)$/
+ when /^MemAvailable:\s+(\d+) (.+)/
memory[:available] = "#{$1}#{$2}"
- when /^Buffers:\s+(\d+) (.+)$/
+ when /^Buffers:\s+(\d+) (.+)/
memory[:buffers] = "#{$1}#{$2}"
- when /^Cached:\s+(\d+) (.+)$/
+ when /^Cached:\s+(\d+) (.+)/
memory[:cached] = "#{$1}#{$2}"
- when /^Active:\s+(\d+) (.+)$/
+ when /^Active:\s+(\d+) (.+)/
memory[:active] = "#{$1}#{$2}"
- when /^Inactive:\s+(\d+) (.+)$/
+ when /^Inactive:\s+(\d+) (.+)/
memory[:inactive] = "#{$1}#{$2}"
- when /^HighTotal:\s+(\d+) (.+)$/
+ when /^HighTotal:\s+(\d+) (.+)/
memory[:high_total] = "#{$1}#{$2}"
- when /^HighFree:\s+(\d+) (.+)$/
+ when /^HighFree:\s+(\d+) (.+)/
memory[:high_free] = "#{$1}#{$2}"
- when /^LowTotal:\s+(\d+) (.+)$/
+ when /^LowTotal:\s+(\d+) (.+)/
memory[:low_total] = "#{$1}#{$2}"
- when /^LowFree:\s+(\d+) (.+)$/
+ when /^LowFree:\s+(\d+) (.+)/
memory[:low_free] = "#{$1}#{$2}"
- when /^Dirty:\s+(\d+) (.+)$/
+ when /^Dirty:\s+(\d+) (.+)/
memory[:dirty] = "#{$1}#{$2}"
- when /^Writeback:\s+(\d+) (.+)$/
+ when /^Writeback:\s+(\d+) (.+)/
memory[:writeback] = "#{$1}#{$2}"
- when /^AnonPages:\s+(\d+) (.+)$/
+ when /^AnonPages:\s+(\d+) (.+)/
memory[:anon_pages] = "#{$1}#{$2}"
- when /^Mapped:\s+(\d+) (.+)$/
+ when /^Mapped:\s+(\d+) (.+)/
memory[:mapped] = "#{$1}#{$2}"
- when /^Slab:\s+(\d+) (.+)$/
+ when /^Slab:\s+(\d+) (.+)/
memory[:slab] = "#{$1}#{$2}"
- when /^SReclaimable:\s+(\d+) (.+)$/
+ when /^SReclaimable:\s+(\d+) (.+)/
memory[:slab_reclaimable] = "#{$1}#{$2}"
- when /^SUnreclaim:\s+(\d+) (.+)$/
+ when /^SUnreclaim:\s+(\d+) (.+)/
memory[:slab_unreclaim] = "#{$1}#{$2}"
- when /^PageTables:\s+(\d+) (.+)$/
+ when /^PageTables:\s+(\d+) (.+)/
memory[:page_tables] = "#{$1}#{$2}"
- when /^NFS_Unstable:\s+(\d+) (.+)$/
+ when /^NFS_Unstable:\s+(\d+) (.+)/
memory[:nfs_unstable] = "#{$1}#{$2}"
- when /^Bounce:\s+(\d+) (.+)$/
+ when /^Bounce:\s+(\d+) (.+)/
memory[:bounce] = "#{$1}#{$2}"
- when /^CommitLimit:\s+(\d+) (.+)$/
+ when /^CommitLimit:\s+(\d+) (.+)/
memory[:commit_limit] = "#{$1}#{$2}"
- when /^Committed_AS:\s+(\d+) (.+)$/
+ when /^Committed_AS:\s+(\d+) (.+)/
memory[:committed_as] = "#{$1}#{$2}"
- when /^VmallocTotal:\s+(\d+) (.+)$/
+ when /^VmallocTotal:\s+(\d+) (.+)/
memory[:vmalloc_total] = "#{$1}#{$2}"
- when /^VmallocUsed:\s+(\d+) (.+)$/
+ when /^VmallocUsed:\s+(\d+) (.+)/
memory[:vmalloc_used] = "#{$1}#{$2}"
- when /^VmallocChunk:\s+(\d+) (.+)$/
+ when /^VmallocChunk:\s+(\d+) (.+)/
memory[:vmalloc_chunk] = "#{$1}#{$2}"
- when /^SwapCached:\s+(\d+) (.+)$/
+ when /^SwapCached:\s+(\d+) (.+)/
memory[:swap][:cached] = "#{$1}#{$2}"
- when /^SwapTotal:\s+(\d+) (.+)$/
+ when /^SwapTotal:\s+(\d+) (.+)/
memory[:swap][:total] = "#{$1}#{$2}"
- when /^SwapFree:\s+(\d+) (.+)$/
+ when /^SwapFree:\s+(\d+) (.+)/
memory[:swap][:free] = "#{$1}#{$2}"
- when /^HugePages_Total:\s+(\d+)$/
+ when /^HugePages_Total:\s+(\d+)/
memory[:hugepages][:total] = $1.to_s
- when /^HugePages_Free:\s+(\d+)$/
+ when /^HugePages_Free:\s+(\d+)/
memory[:hugepages][:free] = $1.to_s
- when /^HugePages_Rsvd:\s+(\d+)$/
+ when /^HugePages_Rsvd:\s+(\d+)/
memory[:hugepages][:reserved] = $1.to_s
- when /^HugePages_Surp:\s+(\d+)$/
+ when /^HugePages_Surp:\s+(\d+)/
memory[:hugepages][:surplus] = $1.to_s
- when /^Hugepagesize:\s+(\d+) (.+)$/
+ when /^Hugepagesize:\s+(\d+) (.+)/
memory[:hugepage_size] = "#{$1}#{$2}"
- when /^Hugetlb:\s+(\d+) (.+)$/
+ when /^Hugetlb:\s+(\d+) (.+)/
memory[:hugetlb] = "#{$1}#{$2}"
- when /^DirectMap([0-9]+[a-zA-Z]):\s+(\d+) (.+)$/
+ when /^DirectMap([0-9]+[a-zA-Z]):\s+(\d+) (.+)/
memory[:directmap][$1.to_sym] = "#{$2}#{$3}"
end
end
diff --git a/lib/ohai/plugins/linux/network.rb b/lib/ohai/plugins/linux/network.rb
index e92c149a..01f4af47 100644
--- a/lib/ohai/plugins/linux/network.rb
+++ b/lib/ohai/plugins/linux/network.rb
@@ -1,7 +1,8 @@
+# frozen_string_literal: true
#
# Author:: Adam Jacob (<adam@chef.io>)
# Author:: Chris Read <chris.read@gmail.com>
-# Copyright:: Copyright (c) 2008-2017, Chef Software Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -35,7 +36,7 @@ Ohai.plugin(:Network) do
end
def ipv6_enabled?
- File.exist? "/proc/net/if_inet6"
+ file_exist? "/proc/net/if_inet6"
end
def ethtool_binary_path
@@ -43,11 +44,11 @@ Ohai.plugin(:Network) do
end
def is_openvz?
- @openvz ||= ::File.directory?("/proc/vz")
+ @openvz ||= file_directory?("/proc/vz")
end
def is_openvz_host?
- is_openvz? && ::File.directory?("/proc/bc")
+ is_openvz? && file_directory?("/proc/bc")
end
def extract_neighbors(family, iface, neigh_attr)
@@ -78,7 +79,7 @@ Ohai.plugin(:Network) do
so.stdout.lines do |line|
line.strip!
logger.trace("Plugin Network: Parsing #{line}")
- if line =~ /\\/
+ if /\\/.match?(line)
parts = line.split('\\')
route_dest = parts.shift.strip
route_endings = parts
@@ -108,6 +109,8 @@ Ohai.plugin(:Network) do
# http://rubular.com/r/pwTNp65VFf
route_entry[k] = $1 if route_ending =~ /\b#{k}\s+([^\s]+)/
end
+ # https://rubular.com/r/k1sMrRn5yLjgVi
+ route_entry["via"] = $1 if route_ending =~ /\bvia\s+inet6\s+([^\s]+)/
# a sanity check, especially for Linux-VServer, OpenVZ and LXC:
# don't report the route entry if the src address isn't set on the node
@@ -139,12 +142,12 @@ Ohai.plugin(:Network) do
# using a temporary var to hold routes and their interface name
def parse_routes(family, iface)
iface.collect do |i, iv|
- if iv[:routes]
- iv[:routes].collect do |r|
- r.merge(dev: i) if r[:family] == family[:name]
- end.compact
- end
- end.compact.flatten
+ next unless iv[:routes]
+
+ iv[:routes].collect do |r|
+ r.merge(dev: i) if r[:family] == family[:name]
+ end.compact # @todo: when we drop ruby 2.6 this should be a filter_map
+ end.compact.flatten # @todo: when we drop ruby 2.6 this should be a filter_map
end
# determine layer 1 details for the interface using ethtool
@@ -189,11 +192,11 @@ Ohai.plugin(:Network) do
next if line.start_with?("Ring parameters for")
next if line.strip.nil?
- if line =~ /Pre-set maximums/
+ if /Pre-set maximums/.match?(line)
type = "max"
next
end
- if line =~ /Current hardware settings/
+ if /Current hardware settings/.match?(line)
type = "current"
next
end
@@ -222,11 +225,11 @@ Ohai.plugin(:Network) do
next if line.start_with?("Channel parameters for")
next if line.strip.nil?
- if line =~ /Pre-set maximums/
+ if /Pre-set maximums/.match?(line)
type = "max"
next
end
- if line =~ /Current hardware settings/
+ if /Current hardware settings/.match?(line)
type = "current"
next
end
@@ -262,7 +265,7 @@ Ohai.plugin(:Network) do
end
key, val = line.split(/:\s+/)
if val
- coalesce_key = "#{key.downcase.tr(" ", "_")}"
+ coalesce_key = key.downcase.tr(" ", "_").to_s
iface[tmp_int]["coalesce_params"][coalesce_key] = val.to_i
end
end
@@ -287,7 +290,7 @@ Ohai.plugin(:Network) do
if val.nil?
val = ""
end
- driver_key = "#{key.downcase.tr(" ", "_")}"
+ driver_key = key.downcase.tr(" ", "_").to_s
iface[tmp_int]["driver_info"][driver_key] = val.chomp
end
end
@@ -306,7 +309,7 @@ Ohai.plugin(:Network) do
net_counters[tmp_int] ||= Mash.new
end
- if line =~ /^\s+(ip6tnl|ipip)/
+ if /^\s+(ip6tnl|ipip)/.match?(line)
iface[tmp_int][:tunnel_info] = {}
words = line.split
words.each_with_index do |word, index|
@@ -463,7 +466,7 @@ Ohai.plugin(:Network) do
iface[cint][:addresses] ||= Mash.new
tmp_addr = $1
tags = $4 || ""
- tags = tags.split(" ")
+ tags = tags.split
iface[cint][:addresses][tmp_addr] = {
"family" => "inet6",
@@ -476,7 +479,7 @@ Ohai.plugin(:Network) do
# returns the macaddress for interface from a hash of interfaces (iface elsewhere in this file)
def get_mac_for_interface(interfaces, interface)
- interfaces[interface][:addresses].select { |k, v| v["family"] == "lladdr" }.first.first unless interfaces[interface][:addresses].nil? || interfaces[interface][:flags].include?("NOARP")
+ interfaces[interface][:addresses].find { |k, v| v["family"] == "lladdr" }.first unless interfaces[interface][:addresses].nil? || interfaces[interface][:flags].include?("NOARP")
end
# returns the default route with the lowest metric (unspecified metric is 0)
@@ -514,8 +517,16 @@ Ohai.plugin(:Network) do
# if the route destination is a default route, it's good
return true if route[:destination] == "default"
+ return false if default_route[:via].nil?
+
+ dest_ipaddr = IPAddr.new(route[:destination])
+ default_route_via = IPAddr.new(default_route[:via])
+
+ # check if nexthop is the same address family
+ return false if dest_ipaddr.ipv4? != default_route_via.ipv4?
+
# the default route has a gateway and the route matches the gateway
- !default_route[:via].nil? && IPAddress(route[:destination]).include?(IPAddress(default_route[:via]))
+ dest_ipaddr.include?(default_route_via)
end
# ipv4/ipv6 routes are different enough that having a single algorithm to select the favored route for both creates unnecessary complexity
@@ -567,7 +578,7 @@ Ohai.plugin(:Network) do
# If the 'ip' binary is available, this plugin may set {ip,mac,ip6}address. The network plugin should not overwrite these.
# The older code section below that relies on the deprecated net-tools, e.g. netstat and ifconfig, provides less functionality.
collect_data(:linux) do
- require "ipaddr"
+ require "ipaddr" unless defined?(IPAddr)
iface = Mash.new
net_counters = Mash.new
@@ -636,7 +647,7 @@ Ohai.plugin(:Network) do
logger.trace("Plugin Network: #{default_prefix}_interface set to #{default_route[:dev]}")
# setting gateway to 0.0.0.0 or :: if the default route is a link level one
- network["#{default_prefix}_gateway"] = default_route[:via] ? default_route[:via] : family[:default_route].chomp("/0")
+ network["#{default_prefix}_gateway"] = default_route[:via] || family[:default_route].chomp("/0")
logger.trace("Plugin Network: #{default_prefix}_gateway set to #{network["#{default_prefix}_gateway"]}")
# deduce the default route the user most likely cares about to pick {ip,mac,ip6}address below
diff --git a/lib/ohai/plugins/linux/platform.rb b/lib/ohai/plugins/linux/platform.rb
index 12bc4f7a..61518532 100644
--- a/lib/ohai/plugins/linux/platform.rb
+++ b/lib/ohai/plugins/linux/platform.rb
@@ -1,6 +1,7 @@
+# frozen_string_literal: true
#
# Author:: Adam Jacob (<adam@chef.io>)
-# Copyright:: Copyright (c) 2015-2017, Chef Software Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -20,21 +21,6 @@ Ohai.plugin(:Platform) do
provides "platform", "platform_version", "platform_family"
depends "lsb"
- # the platform mappings between the 'ID' field in /etc/os-release and the value
- # ohai uses. If you're adding a new platform here and you want to change the name
- # you'll want to add it here and then add a spec for the platform_id_remap method
- PLATFORM_MAPPINGS ||= {
- "rhel" => "redhat",
- "amzn" => "amazon",
- "ol" => "oracle",
- "sles" => "suse",
- "sles_sap" => "suse",
- "opensuse-leap" => "opensuseleap",
- "xenenterprise" => "xenserver",
- "cumulus-linux" => "cumulus",
- "archarm" => "arch",
- }.freeze
-
# @deprecated
def get_redhatish_platform(contents)
contents[/^Red Hat/i] ? "redhat" : contents[/(\w+)/i, 1].downcase
@@ -58,9 +44,9 @@ Ohai.plugin(:Platform) do
# @returns [Hash] the file parsed into a Hash or nil
#
def read_os_release_info(file)
- return nil unless File.exist?(file)
+ return nil unless file_exist?(file)
- File.read(file).split.inject({}) do |map, line|
+ file_read(file).split.inject({}) do |map, line|
key, value = line.split("=")
map[key] = value.gsub(/\A"|"\Z/, "") if value
map
@@ -79,7 +65,7 @@ Ohai.plugin(:Platform) do
begin
os_release_info = read_os_release_info("/etc/os-release")
cisco_release_info = os_release_info["CISCO_RELEASE_INFO"] if os_release_info
- if cisco_release_info && File.exist?(cisco_release_info)
+ if cisco_release_info && file_exist?(cisco_release_info)
os_release_info.merge!(read_os_release_info(cisco_release_info))
end
os_release_info
@@ -92,7 +78,7 @@ Ohai.plugin(:Platform) do
# @returns [Boolean] if we are Cisco according to /etc/os-release
#
def os_release_file_is_cisco?
- File.exist?("/etc/os-release") && os_release_info["CISCO_RELEASE_INFO"]
+ file_exist?("/etc/os-release") && os_release_info["CISCO_RELEASE_INFO"]
end
#
@@ -103,7 +89,7 @@ Ohai.plugin(:Platform) do
# @returns [String] bigip Linux version from /etc/f5-release
#
def bigip_version
- release_contents = File.read("/etc/f5-release")
+ release_contents = file_read("/etc/f5-release")
release_contents.match(/BIG-IP release (\S*)/)[1] # http://rubular.com/r/O8nlrBVqSb
rescue NoMethodError, Errno::ENOENT, Errno::EACCES # rescue regex failure, file missing, or permission denied
logger.warn("Detected F5 Big-IP, but /etc/f5-release could not be parsed to determine platform_version")
@@ -122,8 +108,20 @@ Ohai.plugin(:Platform) do
# this catches the centos guest shell in the nexus switch which identifies itself as centos
return "nexus_centos" if id == "centos" && os_release_file_is_cisco?
- # remap based on the hash of platforms
- PLATFORM_MAPPINGS[id] || id
+ # the platform mappings between the 'ID' field in /etc/os-release and the value
+ # ohai uses. If you're adding a new platform here and you want to change the name
+ # you'll want to add it here and then add a spec for the platform_id_remap method
+ {
+ "rhel" => "redhat",
+ "amzn" => "amazon",
+ "ol" => "oracle",
+ "sles" => "suse",
+ "sles_sap" => "suse",
+ "opensuse-leap" => "opensuseleap",
+ "xenenterprise" => "xenserver",
+ "cumulus-linux" => "cumulus",
+ "archarm" => "arch",
+ }[id] || id
end
#
@@ -135,7 +133,7 @@ Ohai.plugin(:Platform) do
#
def platform_family_from_platform(plat)
case plat
- when /debian/, /ubuntu/, /linuxmint/, /raspbian/, /cumulus/, /kali/
+ when /debian/, /ubuntu/, /linuxmint/, /raspbian/, /cumulus/, /kali/, /pop/
# apt-get+dpkg almost certainly goes here
"debian"
when /oracle/, /centos/, /redhat/, /scientific/, /enterpriseenterprise/, /xcp/, /xenserver/, /cloudlinux/, /ibm_powerkvm/, /parallels/, /nexus_centos/, /clearos/, /bigip/ # Note that 'enterpriseenterprise' is oracle's LSB "distributor ID"
@@ -181,48 +179,48 @@ Ohai.plugin(:Platform) do
# @deprecated
def legacy_platform_detection
# platform [ and platform_version ? ] should be lower case to avoid dealing with RedHat/Redhat/redhat matching
- if File.exist?("/etc/oracle-release")
- contents = File.read("/etc/oracle-release").chomp
+ if file_exist?("/etc/oracle-release")
+ contents = file_read("/etc/oracle-release").chomp
platform "oracle"
platform_version get_redhatish_version(contents)
- elsif File.exist?("/etc/enterprise-release")
- contents = File.read("/etc/enterprise-release").chomp
+ elsif file_exist?("/etc/enterprise-release")
+ contents = file_read("/etc/enterprise-release").chomp
platform "oracle"
platform_version get_redhatish_version(contents)
- elsif File.exist?("/etc/f5-release")
+ elsif file_exist?("/etc/f5-release")
platform "bigip"
platform_version bigip_version
- elsif File.exist?("/etc/debian_version")
+ elsif file_exist?("/etc/debian_version")
# Ubuntu and Debian both have /etc/debian_version
# Ubuntu should always have a working lsb, debian does not by default
- if lsb[:id] =~ /Ubuntu/i
+ if /Ubuntu/i.match?(lsb[:id])
platform "ubuntu"
platform_version lsb[:release]
else
platform "debian"
- platform_version File.read("/etc/debian_version").chomp
+ platform_version file_read("/etc/debian_version").chomp
end
- elsif File.exist?("/etc/parallels-release")
- contents = File.read("/etc/parallels-release").chomp
+ elsif file_exist?("/etc/parallels-release")
+ contents = file_read("/etc/parallels-release").chomp
platform get_redhatish_platform(contents)
platform_version contents.match(/(\d\.\d\.\d)/)[0]
- elsif File.exist?("/etc/Eos-release")
+ elsif file_exist?("/etc/Eos-release")
platform "arista_eos"
- platform_version File.read("/etc/Eos-release").strip.split[-1]
- elsif File.exist?("/etc/redhat-release")
- contents = File.read("/etc/redhat-release").chomp
+ platform_version file_read("/etc/Eos-release").strip.split[-1]
+ elsif file_exist?("/etc/redhat-release")
+ contents = file_read("/etc/redhat-release").chomp
platform get_redhatish_platform(contents)
platform_version get_redhatish_version(contents)
- elsif File.exist?("/etc/system-release")
- contents = File.read("/etc/system-release").chomp
+ elsif file_exist?("/etc/system-release")
+ contents = file_read("/etc/system-release").chomp
platform get_redhatish_platform(contents)
platform_version get_redhatish_version(contents)
- elsif File.exist?("/etc/SuSE-release")
- suse_release = File.read("/etc/SuSE-release")
+ elsif file_exist?("/etc/SuSE-release")
+ suse_release = file_read("/etc/SuSE-release")
suse_version = suse_release.scan(/VERSION = (\d+)\nPATCHLEVEL = (\d+)/).flatten.join(".")
suse_version = suse_release[/VERSION = ([\d\.]{2,})/, 1] if suse_version == ""
platform_version suse_version
- if suse_release =~ /^openSUSE/
+ if /^openSUSE/.match?(suse_release)
# opensuse releases >= 42 are openSUSE Leap
if platform_version.to_i < 42
platform "opensuse"
@@ -246,33 +244,33 @@ Ohai.plugin(:Platform) do
end
platform_version os_release_info["VERSION"]
- elsif File.exist?("/etc/slackware-version")
+ elsif file_exist?("/etc/slackware-version")
platform "slackware"
- platform_version File.read("/etc/slackware-version").scan(/(\d+|\.+)/).join
- elsif File.exist?("/etc/exherbo-release")
+ platform_version file_read("/etc/slackware-version").scan(/(\d+|\.+)/).join
+ elsif file_exist?("/etc/exherbo-release")
platform "exherbo"
# no way to determine platform_version in a rolling release distribution
# kernel release will be used - ex. 3.13
platform_version shell_out("/bin/uname -r").stdout.strip
- elsif File.exist?("/usr/lib/os-release")
- contents = File.read("/usr/lib/os-release")
- if /clear-linux-os/ =~ contents # Clear Linux https://clearlinux.org/
+ elsif file_exist?("/usr/lib/os-release")
+ contents = file_read("/usr/lib/os-release")
+ if /clear-linux-os/.match?(contents) # Clear Linux https://clearlinux.org/
platform "clearlinux"
platform_version contents[/VERSION_ID=(\d+)/, 1]
end
- elsif lsb[:id] =~ /RedHat/i
+ elsif /RedHat/i.match?(lsb[:id])
platform "redhat"
platform_version lsb[:release]
- elsif lsb[:id] =~ /Amazon/i
+ elsif /Amazon/i.match?(lsb[:id])
platform "amazon"
platform_version lsb[:release]
- elsif lsb[:id] =~ /ScientificSL/i
+ elsif /ScientificSL/i.match?(lsb[:id])
platform "scientific"
platform_version lsb[:release]
- elsif lsb[:id] =~ /XenServer/i
+ elsif /XenServer/i.match?(lsb[:id])
platform "xenserver"
platform_version lsb[:release]
- elsif lsb[:id] =~ /XCP/i
+ elsif /XCP/i.match?(lsb[:id])
platform "xcp"
platform_version lsb[:release]
elsif lsb[:id] # LSB can provide odd data that changes between releases, so we currently fall back on it rather than dealing with its subtleties
@@ -288,14 +286,14 @@ Ohai.plugin(:Platform) do
def determine_os_version
# centos only includes the major version in os-release for some reason
if os_release_info["ID"] == "centos"
- get_redhatish_version(File.read("/etc/redhat-release").chomp)
+ get_redhatish_version(file_read("/etc/redhat-release").chomp)
else
os_release_info["VERSION_ID"] || shell_out("/bin/uname -r").stdout.strip
end
end
collect_data(:linux) do
- if ::File.exist?("/etc/os-release")
+ if file_exist?("/etc/os-release")
logger.trace("Plugin platform: Using /etc/os-release for platform detection")
# fixup os-release names to ohai platform names
diff --git a/lib/ohai/plugins/linux/selinux.rb b/lib/ohai/plugins/linux/selinux.rb
new file mode 100644
index 00000000..25115df8
--- /dev/null
+++ b/lib/ohai/plugins/linux/selinux.rb
@@ -0,0 +1,69 @@
+# frozen_string_literal: true
+#
+# Author:: Davide Cavalca <dcavalca@fb.com>
+# Copyright:: Copyright (c) 2020 Facebook
+# License:: Apache License, Version 2.0
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+Ohai.plugin(:Selinux) do
+ provides "selinux/status", "selinux/policy_booleans", "selinux/process_contexts", "selinux/file_contexts"
+ optional true
+
+ collect_data(:linux) do
+ sestatus_path = which("sestatus")
+ if sestatus_path
+ sestatus = shell_out("#{sestatus_path} -v -b")
+
+ selinux Mash.new unless selinux
+ selinux[:status] ||= Mash.new
+ selinux[:policy_booleans] ||= Mash.new
+ selinux[:process_contexts] ||= Mash.new
+ selinux[:file_contexts] ||= Mash.new
+ section = nil
+
+ sestatus.stdout.split("\n").each do |line|
+ line.chomp!
+
+ case line
+ when "Policy booleans:"
+ section = :policy_booleans
+ next
+ when "Process contexts:"
+ section = :process_contexts
+ next
+ when "File contexts:"
+ section = :file_contexts
+ next
+ else
+ if section.nil?
+ section = :status
+ end
+ end
+
+ key, val = line.split(/:?\s\s+/, 2)
+ next if key.nil?
+
+ unless key.start_with?("/")
+ key.downcase!
+ key.tr!(" ", "_")
+ end
+
+ selinux[section][key] = val
+ end
+ else
+ logger.debug("Plugin Selinux: Could not find sestatus. Skipping plugin.")
+ end
+ end
+end
diff --git a/lib/ohai/plugins/linux/sessions.rb b/lib/ohai/plugins/linux/sessions.rb
index bc503f85..96295ddb 100644
--- a/lib/ohai/plugins/linux/sessions.rb
+++ b/lib/ohai/plugins/linux/sessions.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Author:: Davide Cavalca <dcavalca@fb.com>
# Copyright:: Copyright (c) 2016 Facebook
diff --git a/lib/ohai/plugins/linux/sysctl.rb b/lib/ohai/plugins/linux/sysctl.rb
index 2d621183..1ea6f5fd 100644
--- a/lib/ohai/plugins/linux/sysctl.rb
+++ b/lib/ohai/plugins/linux/sysctl.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Author:: Joshua Miller <joshmiller@fb.com>
# Copyright:: Copyright (c) 2019 Facebook
diff --git a/lib/ohai/plugins/linux/systemd_paths.rb b/lib/ohai/plugins/linux/systemd_paths.rb
index 31451e46..37c41296 100644
--- a/lib/ohai/plugins/linux/systemd_paths.rb
+++ b/lib/ohai/plugins/linux/systemd_paths.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Author:: Davide Cavalca <dcavalca@fb.com>
# Copyright:: Copyright (c) 2017 Facebook
diff --git a/lib/ohai/plugins/linux/virtualization.rb b/lib/ohai/plugins/linux/virtualization.rb
index 1cb125aa..7d748571 100644
--- a/lib/ohai/plugins/linux/virtualization.rb
+++ b/lib/ohai/plugins/linux/virtualization.rb
@@ -1,6 +1,7 @@
+# frozen_string_literal: true
#
# Author:: Thom May (<thom@clearairturbulence.org>)
-# Copyright:: Copyright (c) 2009-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -51,15 +52,15 @@ Ohai.plugin(:Virtualization) do
# - may be able to determine if under paravirt from /dev/xen/evtchn (See OHAI-253)
# - Additional edge cases likely should not change the above assumptions
# but rather be additive - btm
- if File.exist?("/proc/xen")
+ if file_exist?("/proc/xen")
virtualization[:system] = "xen"
# Assume guest
virtualization[:role] = "guest"
virtualization[:systems][:xen] = "guest"
# This file should exist on most Xen systems, normally empty for guests
- if File.exist?("/proc/xen/capabilities")
- if File.read("/proc/xen/capabilities") =~ /control_d/i
+ if file_exist?("/proc/xen/capabilities")
+ if /control_d/i.match?(file_read("/proc/xen/capabilities"))
logger.trace("Plugin Virtualization: /proc/xen/capabilities contains control_d. Detecting as Xen host")
virtualization[:role] = "host"
virtualization[:systems][:xen] = "host"
@@ -68,14 +69,14 @@ Ohai.plugin(:Virtualization) do
end
# Detect Virtualbox from kernel module
- if File.exist?("/proc/modules")
- modules = File.read("/proc/modules")
- if modules =~ /^vboxdrv/
+ if file_exist?("/proc/modules")
+ modules = file_read("/proc/modules")
+ if /^vboxdrv/.match?(modules)
logger.trace("Plugin Virtualization: /proc/modules contains vboxdrv. Detecting as vbox host")
virtualization[:system] = "vbox"
virtualization[:role] = "host"
virtualization[:systems][:vbox] = "host"
- elsif modules =~ /^vboxguest/
+ elsif /^vboxguest/.match?(modules)
logger.trace("Plugin Virtualization: /proc/modules contains vboxguest. Detecting as vbox guest")
virtualization[:system] = "vbox"
virtualization[:role] = "guest"
@@ -92,8 +93,8 @@ Ohai.plugin(:Virtualization) do
end
# Detect paravirt KVM/QEMU from cpuinfo, report as KVM
- if File.exist?("/proc/cpuinfo")
- if File.read("/proc/cpuinfo") =~ /QEMU Virtual CPU|Common KVM processor|Common 32-bit KVM processor/
+ if file_exist?("/proc/cpuinfo")
+ if /QEMU Virtual CPU|Common KVM processor|Common 32-bit KVM processor/.match?(file_read("/proc/cpuinfo"))
logger.trace("Plugin Virtualization: /proc/cpuinfo lists a KVM paravirt CPU string. Detecting as kvm guest")
virtualization[:system] = "kvm"
virtualization[:role] = "guest"
@@ -103,9 +104,9 @@ Ohai.plugin(:Virtualization) do
# Detect KVM systems via /sys
# guests will have the hypervisor cpu feature that hosts don't have
- if File.exist?("/sys/devices/virtual/misc/kvm")
+ if file_exist?("/sys/devices/virtual/misc/kvm")
virtualization[:system] = "kvm"
- if File.read("/proc/cpuinfo") =~ /hypervisor/
+ if /hypervisor/.match?(file_read("/proc/cpuinfo"))
logger.trace("Plugin Virtualization: /sys/devices/virtual/misc/kvm present and /proc/cpuinfo lists the hypervisor feature. Detecting as kvm guest")
virtualization[:role] = "guest"
virtualization[:systems][:kvm] = "guest"
@@ -129,12 +130,12 @@ Ohai.plugin(:Virtualization) do
# Detect OpenVZ / Virtuozzo.
# http://wiki.openvz.org/BC_proc_entries
- if File.exist?("/proc/bc/0")
+ if file_exist?("/proc/bc/0")
logger.trace("Plugin Virtualization: /proc/bc/0 exists. Detecting as openvz host")
virtualization[:system] = "openvz"
virtualization[:role] = "host"
virtualization[:systems][:openvz] = "host"
- elsif File.exist?("/proc/vz")
+ elsif file_exist?("/proc/vz")
logger.trace("Plugin Virtualization: /proc/vz exists. Detecting as openvz guest")
virtualization[:system] = "openvz"
virtualization[:role] = "guest"
@@ -142,9 +143,9 @@ Ohai.plugin(:Virtualization) do
end
# Detect Hyper-V guest and the hostname of the host
- if File.exist?("/var/lib/hyperv/.kvp_pool_3")
+ if file_exist?("/var/lib/hyperv/.kvp_pool_3")
logger.trace("Plugin Virtualization: /var/lib/hyperv/.kvp_pool_3 contains string indicating Hyper-V guest")
- data = File.read("/var/lib/hyperv/.kvp_pool_3")
+ data = file_read("/var/lib/hyperv/.kvp_pool_3")
hyperv_host = data[/\HostName(.*?)HostingSystemEditionId/, 1].scan(/[[:print:]]/).join.downcase
virtualization[:system] = "hyperv"
virtualization[:role] = "guest"
@@ -153,8 +154,8 @@ Ohai.plugin(:Virtualization) do
end
# Detect Linux-VServer
- if File.exist?("/proc/self/status")
- proc_self_status = File.read("/proc/self/status")
+ if file_exist?("/proc/self/status")
+ proc_self_status = file_read("/proc/self/status")
vxid = proc_self_status.match(/^(s_context|VxID):\s*(\d+)$/)
if vxid && vxid[2]
virtualization[:system] = "linux-vserver"
@@ -188,25 +189,28 @@ Ohai.plugin(:Virtualization) do
#
# Full notes, https://tickets.opscode.com/browse/OHAI-551
# Kernel docs, https://www.kernel.org/doc/Documentation/cgroups
- if File.exist?("/proc/self/cgroup")
- cgroup_content = File.read("/proc/self/cgroup")
- if cgroup_content =~ %r{^\d+:[^:]+:/(lxc|docker)/.+$} ||
- cgroup_content =~ %r{^\d+:[^:]+:/[^/]+/(lxc|docker)-?.+$}
+ if file_exist?("/proc/self/cgroup")
+ cgroup_content = file_read("/proc/self/cgroup")
+ # These two REs catch many different examples. Here's a specific one
+ # from when it is docker and there is no subsystem name.
+ # https://rubular.com/r/dV13hiU9KxmiWB
+ if cgroup_content =~ %r{^\d+:[^:]*:/(lxc|docker)/.+$} ||
+ cgroup_content =~ %r{^\d+:[^:]*:/[^/]+/(lxc|docker)-?.+$}
logger.trace("Plugin Virtualization: /proc/self/cgroup indicates #{$1} container. Detecting as #{$1} guest")
virtualization[:system] = $1
virtualization[:role] = "guest"
virtualization[:systems][$1.to_sym] = "guest"
- elsif File.read("/proc/1/environ") =~ /container=lxc/
+ elsif /container=lxc/.match?(file_read("/proc/1/environ"))
logger.trace("Plugin Virtualization: /proc/1/environ indicates lxc container. Detecting as lxc guest")
virtualization[:system] = "lxc"
virtualization[:role] = "guest"
virtualization[:systems][:lxc] = "guest"
- elsif File.read("/proc/1/environ") =~ /container=systemd-nspawn/
+ elsif /container=systemd-nspawn/.match?(file_read("/proc/1/environ"))
logger.trace("Plugin Virtualization: /proc/1/environ indicates nspawn container. Detecting as nspawn guest")
virtualization[:system] = "nspawn"
virtualization[:role] = "guest"
virtualization[:systems][:nspawn] = "guest"
- elsif lxc_version_exists? && File.read("/proc/self/cgroup") =~ %r{\d:[^:]+:/$}
+ elsif lxc_version_exists? && file_read("/proc/self/cgroup") =~ %r{\d:[^:]+:/$}
# lxc-version shouldn't be installed by default
# Even so, it is likely we are on an LXC capable host that is not being used as such
# So we're cautious here to not overwrite other existing values (OHAI-573)
@@ -221,7 +225,7 @@ Ohai.plugin(:Virtualization) do
# If so, we may need to look further for a differentiator (OHAI-573)
virtualization[:systems][:lxc] = "host"
end
- elsif File.exist?("/.dockerenv") || File.exist?("/.dockerinit")
+ elsif file_exist?("/.dockerenv") || file_exist?("/.dockerinit")
logger.trace("Plugin Virtualization: .dockerenv or .dockerinit exist. Detecting as docker guest")
virtualization[:system] = "docker"
virtualization[:role] = "guest"
@@ -230,7 +234,7 @@ Ohai.plugin(:Virtualization) do
# Detect LXD
# See https://github.com/lxc/lxd/blob/master/doc/dev-lxd.md
- if File.exist?("/dev/lxd/sock")
+ if file_exist?("/dev/lxd/sock")
logger.trace("Plugin Virtualization: /dev/lxd/sock exists. Detecting as lxd guest")
virtualization[:system] = "lxd"
virtualization[:role] = "guest"
@@ -245,7 +249,7 @@ Ohai.plugin(:Virtualization) do
# Snap based installations utilize '/var/snap/lxd/common/lxd/'
# - includes all future releases starting with 2.21, and will be the only source of 3.1+ feature releases post-bionic
["/var/lib/lxd/devlxd", "/var/snap/lxd/common/lxd/devlxd"].each do |devlxd|
- if File.exist?(devlxd)
+ if file_exist?(devlxd)
logger.trace("Plugin Virtualization: #{devlxd} exists. Detecting as lxd host")
virtualization[:system] = "lxd"
virtualization[:role] = "host"
diff --git a/lib/ohai/plugins/lua.rb b/lib/ohai/plugins/lua.rb
index 94379ba0..6abf7c9c 100644
--- a/lib/ohai/plugins/lua.rb
+++ b/lib/ohai/plugins/lua.rb
@@ -18,7 +18,7 @@
Ohai.plugin(:Lua) do
provides "languages/lua"
- depends "languages"
+ depends "languages".freeze
collect_data do
diff --git a/lib/ohai/plugins/mono.rb b/lib/ohai/plugins/mono.rb
index e7b2483b..1666a294 100644
--- a/lib/ohai/plugins/mono.rb
+++ b/lib/ohai/plugins/mono.rb
@@ -18,7 +18,7 @@
Ohai.plugin(:Mono) do
provides "languages/mono"
- depends "languages"
+ depends "languages".freeze
collect_data do
diff --git a/lib/ohai/plugins/netbsd/memory.rb b/lib/ohai/plugins/netbsd/memory.rb
index 65cc8699..7583ed42 100644
--- a/lib/ohai/plugins/netbsd/memory.rb
+++ b/lib/ohai/plugins/netbsd/memory.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Author:: Mathieu Sauve-Frankel <msf@kisoku.net>
# Copyright:: Copyright (c) 2009 Bryan McLellan
diff --git a/lib/ohai/plugins/netbsd/network.rb b/lib/ohai/plugins/netbsd/network.rb
index 66cb6a20..5e970058 100644
--- a/lib/ohai/plugins/netbsd/network.rb
+++ b/lib/ohai/plugins/netbsd/network.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Author:: Bryan McLellan (btm@loftninjas.org)
# Copyright:: Copyright (c) 2009 Bryan McLellan
@@ -26,8 +27,7 @@ Ohai.plugin(:Network) do
counters Mash.new unless counters
counters[:network] ||= Mash.new
- so = shell_out("route -n get default")
- so.stdout.lines do |line|
+ shell_out("route -n get default").stdout.lines do |line|
if line =~ /(\w+): ([\w\.]+)/
case $1
when "gateway"
@@ -39,9 +39,8 @@ Ohai.plugin(:Network) do
end
iface = Mash.new
- so = shell_out("#{Ohai.abs_path( "/sbin/ifconfig" )} -a")
cint = nil
- so.stdout.lines do |line|
+ shell_out("#{Ohai.abs_path( "/sbin/ifconfig" )} -a").stdout.lines do |line|
if line =~ /^([0-9a-zA-Z\.]+):\s+/
cint = $1
iface[cint] = Mash.new
@@ -85,8 +84,7 @@ Ohai.plugin(:Network) do
end
end
- so = shell_out("arp -an")
- so.stdout.lines do |line|
+ shell_out("arp -an").stdout.lines do |line|
if line =~ /\((\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})\) at ([a-fA-F0-9\:]+) on ([0-9a-zA-Z\.\:\-]+)/
next unless iface[$3] # this should never happen
@@ -102,8 +100,7 @@ Ohai.plugin(:Network) do
# Show the state of all network interfaces or a single interface
# which have been auto-configured (interfaces statically configured
# into a system, but not located at boot time are not shown).
- so = shell_out("netstat -idn")
- so.stdout.lines do |line|
+ shell_out("netstat -idn").stdout.lines do |line|
# Name Mtu Network Address Ipkts Ierrs Opkts Oerrs Coll Drop
# em0 1500 <Link> 00:11:25:2d:90:be 3719557 0 3369969 0 0 0
# $1 $2 $3 $4 $5 $6 $7 $8
diff --git a/lib/ohai/plugins/netbsd/platform.rb b/lib/ohai/plugins/netbsd/platform.rb
index 9293787b..6cf4530c 100644
--- a/lib/ohai/plugins/netbsd/platform.rb
+++ b/lib/ohai/plugins/netbsd/platform.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Author:: Bryan McLellan (btm@loftninjas.org)
# Copyright:: Copyright (c) 2009 Bryan McLellan
@@ -20,10 +21,8 @@ Ohai.plugin(:Platform) do
provides "platform", "platform_version", "platform_family"
collect_data(:netbsd) do
- so = shell_out("uname -s")
- platform so.stdout.split($/)[0].downcase
- so = shell_out("uname -r")
- platform_version so.stdout.split($/)[0]
+ platform shell_out("uname -s").stdout.strip.downcase
+ platform_version shell_out("uname -r").stdout.strip
platform_family "netbsd"
end
end
diff --git a/lib/ohai/plugins/network.rb b/lib/ohai/plugins/network.rb
index 03003eb2..be8f26f3 100644
--- a/lib/ohai/plugins/network.rb
+++ b/lib/ohai/plugins/network.rb
@@ -1,6 +1,7 @@
+# frozen_string_literal: true
#
# Author:: Adam Jacob (<adam@chef.io>)
-# Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -17,7 +18,6 @@
#
Ohai.plugin(:NetworkAddresses) do
- require "ipaddress"
require_relative "../mixin/network_helper"
include Ohai::Mixin::NetworkHelper
@@ -54,7 +54,7 @@ Ohai.plugin(:NetworkAddresses) do
ipaddresses.sort_by do |v|
[ ( scope_prio.index(v[:scope]) || 999999 ),
128 - v[:ipaddress].prefix.to_i,
- ( family == "inet" ? v[:ipaddress].to_u32 : v[:ipaddress].to_u128 ),
+ v[:ipaddress].to_i,
]
end
end
@@ -88,9 +88,9 @@ Ohai.plugin(:NetworkAddresses) do
r = gw_if_ips.first
else
# checking network masks
- r = gw_if_ips.select do |v|
+ r = gw_if_ips.find do |v|
network_contains_address(network[gw_attr], v[:ipaddress], v[:iface])
- end.first
+ end
if r.nil?
r = gw_if_ips.first
logger.trace("Plugin Network: [#{family}] no ipaddress/mask on #{network[int_attr]} matching the gateway #{network[gw_attr]}, picking #{r[:ipaddress]}")
@@ -134,6 +134,8 @@ Ohai.plugin(:NetworkAddresses) do
# time as ipaddress. if ipaddress is set and macaddress is nil, that means
# the interface ipaddress is bound to has the NOARP flag
collect_data do
+ require "ipaddress" unless defined?(IPAddress)
+
results = {}
network Mash.new unless network
diff --git a/lib/ohai/plugins/nodejs.rb b/lib/ohai/plugins/nodejs.rb
index a24a0454..136ce1ba 100644
--- a/lib/ohai/plugins/nodejs.rb
+++ b/lib/ohai/plugins/nodejs.rb
@@ -18,7 +18,7 @@
Ohai.plugin(:Nodejs) do
provides "languages/nodejs"
- depends "languages"
+ depends "languages".freeze
collect_data do
diff --git a/lib/ohai/plugins/ohai.rb b/lib/ohai/plugins/ohai.rb
index 3b6ed737..12724318 100644
--- a/lib/ohai/plugins/ohai.rb
+++ b/lib/ohai/plugins/ohai.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Author:: Tollef Fog Heen <tfheen@err.no>
# Copyright:: Copyright (c) 2010 Tollef Fog Heen
diff --git a/lib/ohai/plugins/ohai_time.rb b/lib/ohai/plugins/ohai_time.rb
index f0f0ba7f..6347f15d 100644
--- a/lib/ohai/plugins/ohai_time.rb
+++ b/lib/ohai/plugins/ohai_time.rb
@@ -1,6 +1,7 @@
+# frozen_string_literal: true
#
# Author:: Adam Jacob (<adam@chef.io>)
-# Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -19,7 +20,7 @@
Ohai.plugin(:OhaiTime) do
provides "ohai_time"
- collect_data do
+ collect_data(:default, :target) do
ohai_time Time.now.to_f
end
end
diff --git a/lib/ohai/plugins/openbsd/memory.rb b/lib/ohai/plugins/openbsd/memory.rb
index ab7de696..95694270 100644
--- a/lib/ohai/plugins/openbsd/memory.rb
+++ b/lib/ohai/plugins/openbsd/memory.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Author:: Mathieu Sauve-Frankel <msf@kisoku.net>
# Copyright:: Copyright (c) 2009 Bryan McLellan
diff --git a/lib/ohai/plugins/openbsd/network.rb b/lib/ohai/plugins/openbsd/network.rb
index 14664860..6a2fbce9 100644
--- a/lib/ohai/plugins/openbsd/network.rb
+++ b/lib/ohai/plugins/openbsd/network.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Author:: Bryan McLellan (btm@loftninjas.org)
# Copyright:: Copyright (c) 2009 Bryan McLellan
@@ -26,8 +27,7 @@ Ohai.plugin(:Network) do
counters Mash.new unless counters
counters[:network] ||= Mash.new
- so = shell_out("route -n get default")
- so.stdout.lines do |line|
+ shell_out("route -n get default").stdout.lines do |line|
if line =~ /(\w+): ([\w\.]+)/
case $1
when "gateway"
@@ -39,9 +39,8 @@ Ohai.plugin(:Network) do
end
iface = Mash.new
- so = shell_out( "#{Ohai.abs_path( "/sbin/ifconfig" )} -a" )
cint = nil
- so.stdout.lines do |line|
+ shell_out( "#{Ohai.abs_path( "/sbin/ifconfig" )} -a" ).stdout.lines do |line|
if line =~ /^([0-9a-zA-Z\.]+):\s+/
cint = $1
iface[cint] = Mash.new
@@ -85,8 +84,7 @@ Ohai.plugin(:Network) do
end
end
- so = shell_out("arp -an")
- so.stdout.lines do |line|
+ shell_out("arp -an").stdout.lines do |line|
if line =~ /\((\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})\) at ([a-fA-F0-9\:]+) on ([0-9a-zA-Z\.\:\-]+)/
next unless iface[$3] # this should never happen
@@ -102,8 +100,7 @@ Ohai.plugin(:Network) do
# Show the state of all network interfaces or a single interface
# which have been auto-configured (interfaces statically configured
# into a system, but not located at boot time are not shown).
- so = shell_out("netstat -idn")
- so.stdout.lines do |line|
+ shell_out("netstat -idn").stdout.lines do |line|
# Name Mtu Network Address Ipkts Ierrs Opkts Oerrs Coll Drop
# em0 1500 <Link> 00:11:25:2d:90:be 3719557 0 3369969 0 0 0
# $1 $2 $3 $4 $5 $6 $7 $8
diff --git a/lib/ohai/plugins/openbsd/platform.rb b/lib/ohai/plugins/openbsd/platform.rb
index a99cf7a5..d9c2a7e7 100644
--- a/lib/ohai/plugins/openbsd/platform.rb
+++ b/lib/ohai/plugins/openbsd/platform.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Author:: Bryan McLellan (btm@loftninjas.org)
# Copyright:: Copyright (c) 2009 Bryan McLellan
@@ -20,10 +21,8 @@ Ohai.plugin(:Platform) do
provides "platform", "platform_version", "platform_family"
collect_data(:openbsd) do
- so = shell_out("uname -s")
- platform so.stdout.split($/)[0].downcase
- so = shell_out("uname -r")
- platform_version so.stdout.split($/)[0]
+ platform shell_out("uname -s").stdout.strip.downcase
+ platform_version shell_out("uname -r").stdout.strip
platform_family "openbsd"
end
end
diff --git a/lib/ohai/plugins/openstack.rb b/lib/ohai/plugins/openstack.rb
index db2a1784..1c1f7abc 100644
--- a/lib/ohai/plugins/openstack.rb
+++ b/lib/ohai/plugins/openstack.rb
@@ -1,7 +1,8 @@
+# frozen_string_literal: true
#
# Author:: Matt Ray (<matt@chef.io>)
# Author:: Tim Smith (<tsmith@chef.io>)
-# Copyright:: Copyright (c) 2012-2019 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -19,7 +20,6 @@
Ohai.plugin(:Openstack) do
require_relative "../mixin/ec2_metadata"
require_relative "../mixin/http_helper"
- require "etc" unless defined?(Etc)
include Ohai::Mixin::Ec2Metadata
include Ohai::Mixin::HttpHelper
@@ -49,7 +49,7 @@ Ohai.plugin(:Openstack) do
# https://help.dreamhost.com/hc/en-us/articles/228377408-How-to-find-the-default-user-of-an-image
def openstack_provider
# dream host doesn't support windows so bail early if we're on windows
- return "openstack" if RUBY_PLATFORM =~ /mswin|mingw32|windows/
+ return "openstack" if RUBY_PLATFORM.match?(/mswin|mingw32|windows/)
if Etc::Passwd.entries.map(&:name).include?("dhc-user")
"dreamhost"
@@ -59,6 +59,8 @@ Ohai.plugin(:Openstack) do
end
collect_data do
+ require "etc" unless defined?(Etc)
+
# fetch data if we look like openstack
if openstack_hint? || openstack_virtualization?
openstack Mash.new
diff --git a/lib/ohai/plugins/os.rb b/lib/ohai/plugins/os.rb
index d46e70af..21d825a6 100644
--- a/lib/ohai/plugins/os.rb
+++ b/lib/ohai/plugins/os.rb
@@ -1,8 +1,9 @@
+# frozen_string_literal: true
#
# Author:: Adam Jacob (<adam@chef.io>)
# Author:: Isa Farnik (<isa@chef.io>)
# Author:: Richard Manyanza (<liseki@nyikacraftsmen.com>)
-# Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# Copyright:: Copyright (c) 2014 Richard Manyanza.
# License:: Apache License, Version 2.0
#
@@ -34,7 +35,11 @@ Ohai.plugin(:OS) do
# This is __DragonFly_version / __FreeBSD_version. See sys/param.h or
# http://www.freebsd.org/doc/en/books/porters-handbook/freebsd-versions.html.
- os_version shell_out("sysctl -n kern.osreldate").stdout.split($/)[0]
+ os_version shell_out("sysctl -n kern.osreldate").stdout.strip
+ end
+
+ collect_data(:target) do
+ os collect_os
end
collect_data do
diff --git a/lib/ohai/plugins/packages.rb b/lib/ohai/plugins/packages.rb
index f9653dbf..e9ce2b3d 100644
--- a/lib/ohai/plugins/packages.rb
+++ b/lib/ohai/plugins/packages.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Author:: "Christian Höltje" <choltje@us.ibm.com>
# Author:: "Christopher M. Luciano" <cmlucian@us.ibm.com>
# Author:: Shahul Khajamohideen (<skhajamohid1@bloomberg.net>)
@@ -79,7 +80,7 @@ Ohai.plugin(:Packages) do
end
when "arch"
- require "date"
+ require "date" unless defined?(DateTime)
# Set LANG=C to force an easy to parse date format
so = shell_out("LANG=C pacman -Qi")
@@ -163,7 +164,7 @@ Ohai.plugin(:Packages) do
# Output format is
# name version
so.stdout.lines do |pkg|
- name, version = pkg.split(" ")
+ name, version = pkg.split
packages[name] = { "version" => version }
end
end
@@ -209,4 +210,24 @@ Ohai.plugin(:Packages) do
collect_ips_packages
collect_sysv_packages
end
+
+ def collect_system_profiler_apps
+ require "plist"
+ sp_std = shell_out("system_profiler SPApplicationsDataType -xml")
+ results = Plist.parse_xml(sp_std.stdout)
+ sw_array = results[0]["_items"]
+ sw_array.each do |pkg|
+ packages[pkg["_name"]] = {
+ "version" => pkg["version"],
+ "lastmodified" => pkg["lastModified"],
+ "source" => pkg["obtained_from"],
+ }
+ end
+ end
+
+ collect_data(:darwin) do
+ packages Mash.new
+ collect_system_profiler_apps
+ end
+
end
diff --git a/lib/ohai/plugins/passwd.rb b/lib/ohai/plugins/passwd.rb
index 2c43d73b..a2e33632 100644
--- a/lib/ohai/plugins/passwd.rb
+++ b/lib/ohai/plugins/passwd.rb
@@ -1,6 +1,6 @@
+# frozen_string_literal: true
Ohai.plugin(:Passwd) do
- require "etc" unless defined?(Etc)
provides "etc", "current_user"
optional true
@@ -14,6 +14,8 @@ Ohai.plugin(:Passwd) do
end
collect_data do
+ require "etc" unless defined?(Etc)
+
unless etc
etc Mash.new
@@ -41,6 +43,62 @@ Ohai.plugin(:Passwd) do
end
collect_data(:windows) do
- # Etc returns nil on Windows
+ require "wmi-lite/wmi" unless defined?(WmiLite::Wmi)
+
+ unless etc
+ etc Mash.new
+
+ wmi = WmiLite::Wmi.new
+
+ etc[:passwd] = Mash.new
+ users = wmi.query("SELECT * FROM Win32_UserAccount WHERE LocalAccount = True")
+ users.each do |user|
+ uname = user["Name"].strip.downcase
+ Ohai::Log.debug("processing user #{uname}")
+ etc[:passwd][uname] = Mash.new
+ wmi_obj = user.wmi_ole_object
+ wmi_obj.properties_.each do |key|
+ etc[:passwd][uname][key.name.downcase] = user[key.name]
+ end
+ end
+
+ etc[:group] = Mash.new
+ groups = wmi.query("SELECT * FROM Win32_Group WHERE LocalAccount = True")
+ groups.each do |group|
+ gname = group["Name"].strip.downcase
+ Ohai::Log.debug("processing group #{gname}")
+ etc[:group][gname] = Mash.new
+ wmi_obj = group.wmi_ole_object
+ wmi_obj.properties_.each do |key|
+ etc[:group][gname][key.name.downcase] = group[key.name]
+ end
+
+ # This is the primary reason that we're using WMI instead of powershell
+ # cmdlets - the powershell start up cost is huge, and you *must* do this
+ # query for every. single. group. individually.
+
+ # The query returns nothing unless you specify domain *and* name, it's
+ # a path, not a set of queries.
+ subq = "Win32_Group.Domain='#{group["Domain"]}',Name='#{group["Name"]}'"
+ members = wmi.query(
+ "SELECT * FROM Win32_GroupUser WHERE GroupComponent=\"#{subq}\""
+ )
+ etc[:group][gname]["members"] = members.map do |member|
+ mi = {}
+ info = Hash[
+ member["partcomponent"].split(",").map { |x| x.split("=") }.map { |a, b| [a, b.undump] }
+ ]
+ if info.keys.any? { |x| x.match?("Win32_UserAccount") }
+ mi["type"] = :user
+ else
+ # Note: the type here is actually Win32_SystemAccount, because,
+ # that's what groups are in the Windows universe.
+ mi["type"] = :group
+ end
+ mi["name"] = info["Name"]
+ mi
+ end
+ end
+ end
end
end
diff --git a/lib/ohai/plugins/perl.rb b/lib/ohai/plugins/perl.rb
index b3594148..dcfdcee1 100644
--- a/lib/ohai/plugins/perl.rb
+++ b/lib/ohai/plugins/perl.rb
@@ -1,6 +1,6 @@
#
# Author:: Joshua Timberman (<joshua@chef.io>)
-# Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -18,7 +18,7 @@
Ohai.plugin(:Perl) do
provides "languages/perl"
- depends "languages"
+ depends "languages".freeze
collect_data do
diff --git a/lib/ohai/plugins/php.rb b/lib/ohai/plugins/php.rb
index f9ecf917..5b86534b 100644
--- a/lib/ohai/plugins/php.rb
+++ b/lib/ohai/plugins/php.rb
@@ -20,7 +20,7 @@
Ohai.plugin(:PHP) do
provides "languages/php"
- depends "languages"
+ depends "languages".freeze
collect_data do
diff --git a/lib/ohai/plugins/platform.rb b/lib/ohai/plugins/platform.rb
index 1b4e6dc1..0c8d63de 100644
--- a/lib/ohai/plugins/platform.rb
+++ b/lib/ohai/plugins/platform.rb
@@ -1,6 +1,7 @@
+# frozen_string_literal: true
#
# Author:: Adam Jacob (<adam@chef.io>)
-# Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/lib/ohai/plugins/powershell.rb b/lib/ohai/plugins/powershell.rb
index 728e5b11..7e611aba 100644
--- a/lib/ohai/plugins/powershell.rb
+++ b/lib/ohai/plugins/powershell.rb
@@ -1,5 +1,5 @@
#
-# Copyright:: Copyright (c) 2014-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -17,7 +17,7 @@
Ohai.plugin(:Powershell) do
provides "languages/powershell"
- depends "languages"
+ depends "languages".freeze
collect_data(:windows) do
diff --git a/lib/ohai/plugins/ps.rb b/lib/ohai/plugins/ps.rb
index b427abdd..7c5ffc8f 100644
--- a/lib/ohai/plugins/ps.rb
+++ b/lib/ohai/plugins/ps.rb
@@ -1,7 +1,8 @@
+# frozen_string_literal: true
#
# Author:: Adam Jacob (<adam@chef.io>)
# Author:: Bryan McLellan (<btm@loftninjas.org>)
-# Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# Copyright:: Copyright (c) 2009 Bryan McLellan
# License:: Apache License, Version 2.0
#
diff --git a/lib/ohai/plugins/python.rb b/lib/ohai/plugins/python.rb
index 55601f79..762a4776 100644
--- a/lib/ohai/plugins/python.rb
+++ b/lib/ohai/plugins/python.rb
@@ -1,6 +1,6 @@
#
# Author:: Thom May (<thom@clearairturbulence.org>)
-# Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -19,7 +19,7 @@
Ohai.plugin(:Python) do
provides "languages/python"
- depends "languages"
+ depends "languages".freeze
collect_data do
diff --git a/lib/ohai/plugins/rackspace.rb b/lib/ohai/plugins/rackspace.rb
index a435a1ee..02b06d1a 100644
--- a/lib/ohai/plugins/rackspace.rb
+++ b/lib/ohai/plugins/rackspace.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Author:: Cary Penniman (<cary@rightscale.com>)
# License:: Apache License, Version 2.0
@@ -15,7 +16,6 @@
# limitations under the License.
Ohai.plugin(:Rackspace) do
- require "resolv"
provides "rackspace"
depends "kernel", "network/interfaces"
@@ -26,7 +26,7 @@ Ohai.plugin(:Rackspace) do
# true:: If kernel name matches
# false:: Otherwise
def has_rackspace_kernel?
- kernel[:release].split("-").last.eql?("rscloud")
+ kernel[:release].end_with?("-rscloud")
end
# Checks for rackspace provider attribute
@@ -48,9 +48,9 @@ Ohai.plugin(:Rackspace) do
# true:: If the rackspace cloud can be identified
# false:: Otherwise
def has_rackspace_manufacturer?
- return false unless RUBY_PLATFORM =~ /mswin|mingw32|windows/
+ return false unless RUBY_PLATFORM.match?(/mswin|mingw32|windows/)
- require "wmi-lite/wmi"
+ require "wmi-lite/wmi" unless defined?(WmiLite::Wmi)
wmi = WmiLite::Wmi.new
if wmi.first_of("Win32_ComputerSystem")["PrimaryOwnerName"] == "Rackspace"
logger.trace("Plugin Rackspace: has_rackspace_manufacturer? == true")
@@ -102,7 +102,7 @@ Ohai.plugin(:Rackspace) do
so = shell_out("xenstore-ls vm-data/provider_data")
if so.exitstatus == 0
so.stdout.split("\n").each do |line|
- rackspace[:region] = line.split[2].delete('\"') if line =~ /^region/
+ rackspace[:region] = line.split[2].delete('\"') if /^region/.match?(line)
end
end
rescue Ohai::Exceptions::Exec
@@ -147,6 +147,8 @@ Ohai.plugin(:Rackspace) do
end
collect_data do
+ require "resolv"
+
# Adds rackspace Mash
if looks_like_rackspace?
rackspace Mash.new
@@ -160,8 +162,8 @@ Ohai.plugin(:Rackspace) do
unless rackspace[:public_ip].nil?
rackspace[:public_hostname] = begin
Resolv.getname(rackspace[:public_ip])
- rescue Resolv::ResolvError, Resolv::ResolvTimeout
- rackspace[:public_ip]
+ rescue Resolv::ResolvError, Resolv::ResolvTimeout
+ rackspace[:public_ip]
end
end
rackspace[:local_ipv4] = rackspace[:private_ip]
diff --git a/lib/ohai/plugins/root_group.rb b/lib/ohai/plugins/root_group.rb
index ea1af938..34f677f6 100644
--- a/lib/ohai/plugins/root_group.rb
+++ b/lib/ohai/plugins/root_group.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Author:: Joseph Anthony Pasquale Holsten (<joseph@josephholsten.com>)
# Copyright:: Copyright (c) 2013 Joseph Anthony Pasquale Holsten
@@ -19,7 +20,7 @@ Ohai.plugin(:RootGroup) do
provides "root_group"
collect_data(:windows) do
- require "wmi-lite/wmi"
+ require "wmi-lite/wmi" unless defined?(WmiLite::Wmi)
wmi = WmiLite::Wmi.new
# Per http://support.microsoft.com/kb/243330 SID: S-1-5-32-544 is the
diff --git a/lib/ohai/plugins/ruby.rb b/lib/ohai/plugins/ruby.rb
index 11528724..10279182 100644
--- a/lib/ohai/plugins/ruby.rb
+++ b/lib/ohai/plugins/ruby.rb
@@ -1,6 +1,7 @@
+# frozen_string_literal: true
#
# Author:: Adam Jacob (<adam@chef.io>)
-# Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -43,34 +44,23 @@ Ohai.plugin(:Ruby) do
host_vendor: "RbConfig::CONFIG['host_vendor']",
bin_dir: "RbConfig::CONFIG['bindir']",
ruby_bin: "::File.join(RbConfig::CONFIG['bindir'], RbConfig::CONFIG['ruby_install_name'])",
+ gem_bin: "::File.join(RbConfig::CONFIG['bindir'], ::Gem.default_exec_format % 'gem')",
+ gems_dir: "::Gem.dir",
}
# Create a query string from above hash
- env_string = ""
+ env_string = []
values.each_key do |v|
env_string << "#{v}=\#{#{values[v]}},"
end
# Query the system ruby
- result = run_ruby "puts %Q(#{env_string})"
+ result = run_ruby "require 'rubygems'; puts %Q(#{env_string.join})"
# Parse results to plugin hash
result.split(",").each do |entry|
key, value = entry.split("=")
languages[:ruby][key.to_sym] = value || ""
end
-
- # Perform one more (conditional) query
- bin_dir = languages[:ruby][:bin_dir]
- ruby_bin = languages[:ruby][:ruby_bin]
- gem_binaries = [
- run_ruby("require 'rubygems'; puts ::Gem.default_exec_format % 'gem'"),
- "gem",
- ].map { |bin| ::File.join(bin_dir, bin) }
- gem_binary = gem_binaries.find { |bin| ::File.exist? bin }
- if gem_binary
- languages[:ruby][:gems_dir] = run_ruby "puts %x{#{ruby_bin} #{gem_binary} env gemdir}.chomp!"
- languages[:ruby][:gem_bin] = gem_binary
- end
end
end
diff --git a/lib/ohai/plugins/rust.rb b/lib/ohai/plugins/rust.rb
index 6cd70d78..460e91b1 100644
--- a/lib/ohai/plugins/rust.rb
+++ b/lib/ohai/plugins/rust.rb
@@ -15,7 +15,7 @@
Ohai.plugin(:Rust) do
provides "languages/rust"
- depends "languages"
+ depends "languages".freeze
collect_data do
diff --git a/lib/ohai/plugins/scala.rb b/lib/ohai/plugins/scala.rb
index 4bfb9153..c3965a12 100644
--- a/lib/ohai/plugins/scala.rb
+++ b/lib/ohai/plugins/scala.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Author:: Christopher M Luciano (<cmlucian@us.ibm.com>)
# © Copyright IBM Corporation 2015.
# License:: Apache License, Version 2.0
diff --git a/lib/ohai/plugins/scaleway.rb b/lib/ohai/plugins/scaleway.rb
index 37343f03..d6d43444 100644
--- a/lib/ohai/plugins/scaleway.rb
+++ b/lib/ohai/plugins/scaleway.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Author:: Jonathan Amiez (<jonathan.amiez@gmail.com>)
# License:: Apache License, Version 2.0
@@ -26,7 +27,7 @@ Ohai.plugin(:Scaleway) do
# looks for `scaleway` keyword in kernel command line
# @return [Boolean] do we have the keyword or not?
def has_scaleway_cmdline?
- if ::File.read("/proc/cmdline") =~ /scaleway/
+ if file_exist?("/proc/cmdline") && /scaleway/.match?(file_read("/proc/cmdline"))
logger.trace("Plugin Scaleway: has_scaleway_cmdline? == true")
return true
end
diff --git a/lib/ohai/plugins/scsi.rb b/lib/ohai/plugins/scsi.rb
index 412acecb..7a554adc 100644
--- a/lib/ohai/plugins/scsi.rb
+++ b/lib/ohai/plugins/scsi.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Author:: Phil Dibowitz <phil@ipom.com>
# Copyright:: Copyright (c) 2018 Facebook, Inc.
diff --git a/lib/ohai/plugins/shard.rb b/lib/ohai/plugins/shard.rb
index 259bdc6b..92619b3e 100644
--- a/lib/ohai/plugins/shard.rb
+++ b/lib/ohai/plugins/shard.rb
@@ -18,7 +18,7 @@
Ohai.plugin(:ShardSeed) do
depends "hostname", "dmi", "machine_id", "machinename", "fips", "hardware", "kernel"
- provides "shard_seed"
+ provides "shard_seed".freeze
def get_dmi_property(dmi, thing)
%w{system base_board chassis}.each do |section|
@@ -52,7 +52,7 @@ Ohai.plugin(:ShardSeed) do
def digest_algorithm
case Ohai.config[:plugin][:shard_seed][:digest_algorithm] || default_digest_algorithm
when "md5"
- require "digest/md5"
+ require "digest/md5" unless defined?(Digest::MD5)
Digest::MD5
when "sha256"
require "openssl/digest"
@@ -94,7 +94,7 @@ Ohai.plugin(:ShardSeed) do
end
collect_data(:windows) do
- require "wmi-lite/wmi"
+ require "wmi-lite/wmi" unless defined?(WmiLite::Wmi)
wmi = WmiLite::Wmi.new
create_seed do |src|
diff --git a/lib/ohai/plugins/shells.rb b/lib/ohai/plugins/shells.rb
index 8d94cf56..92eead7d 100644
--- a/lib/ohai/plugins/shells.rb
+++ b/lib/ohai/plugins/shells.rb
@@ -1,6 +1,7 @@
+# frozen_string_literal: true
#
# Author:: Tim Smith (<tsmith@chef.io>)
-# Copyright:: Copyright (c) 2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -20,9 +21,9 @@ Ohai.plugin(:Shells) do
provides "shells"
collect_data do
- if ::File.exist?("/etc/shells")
+ if file_exist?("/etc/shells")
shells []
- ::File.readlines("/etc/shells").each do |line|
+ file_open("/etc/shells").readlines.each do |line|
# remove carriage returns and skip over comments / empty lines
shells << line.chomp if line[0] == "/"
end
diff --git a/lib/ohai/plugins/softlayer.rb b/lib/ohai/plugins/softlayer.rb
index 34b2c343..18a373c6 100644
--- a/lib/ohai/plugins/softlayer.rb
+++ b/lib/ohai/plugins/softlayer.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Author:: Alexey Karpik <alexey.karpik@rightscale.com>
# Author:: Peter Schroeter <peter.schroeter@rightscale.com>
@@ -39,7 +40,7 @@ Ohai.plugin(:Softlayer) do
logger.trace("Plugin Softlayer: looks_like_softlayer? == true")
metadata = fetch_metadata
softlayer Mash.new
- metadata.each { |k, v| softlayer[k] = v } if metadata
+ metadata&.each { |k, v| softlayer[k] = v }
else
logger.trace("Plugin Softlayer: looks_like_softlayer? == false")
end
diff --git a/lib/ohai/plugins/solaris2/dmi.rb b/lib/ohai/plugins/solaris2/dmi.rb
index d4b91a3b..d4cf0d67 100644
--- a/lib/ohai/plugins/solaris2/dmi.rb
+++ b/lib/ohai/plugins/solaris2/dmi.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Author:: Kurt Yoder (ktyopscode@yoderhome.com)
# Copyright:: Copyright (c) 2010 Kurt Yoder
@@ -86,7 +87,7 @@ Ohai.plugin(:DMI) do
"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
- }
+ }.freeze
# all output lines should fall within one of these patterns
header_type_line = /^ID\s+SIZE\s+TYPE/
@@ -99,7 +100,6 @@ Ohai.plugin(:DMI) do
dmi_record = nil
field = nil
- so = shell_out("smbios")
# ==== EXAMPLE: ====
# ID SIZE TYPE
# 0 40 SMB_TYPE_BIOS (BIOS information)
@@ -111,7 +111,7 @@ Ohai.plugin(:DMI) do
# SMB_BIOSFL_PCI (PCI is supported)
# ... similar lines trimmed
# note the second level of indentation is via a *tab*
- so.stdout.lines do |raw_line|
+ shell_out("smbios").stdout.lines do |raw_line|
next if header_type_line.match(raw_line)
next if blank_line.match(raw_line)
@@ -129,7 +129,7 @@ Ohai.plugin(:DMI) do
id = smb_to_id[header_information[3]]
# Don't overcapture for now (OHAI-260)
- unless Ohai::Common::DMI.whitelisted_ids.include?(id)
+ unless Ohai::Common::DMI.allowlisted_ids.include?(id)
dmi_record = nil
next
end
diff --git a/lib/ohai/plugins/solaris2/memory.rb b/lib/ohai/plugins/solaris2/memory.rb
index 1c14be68..04e8dd17 100644
--- a/lib/ohai/plugins/solaris2/memory.rb
+++ b/lib/ohai/plugins/solaris2/memory.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# License:: Apache License, Version 2.0
#
@@ -20,8 +21,7 @@ Ohai.plugin(:Memory) do
collect_data(:solaris2) do
memory Mash.new
memory[:swap] = Mash.new
- meminfo = shell_out("prtconf | grep Memory").stdout
- memory[:total] = "#{meminfo.split[2].to_i * 1024}kB"
+ memory[:total] = "#{shell_out("prtconf | grep Memory").stdout.split[2].to_i * 1024}kB"
tokens = shell_out("swap -s").stdout.strip.split
used_swap = tokens[8][0..-1].to_i # strip k from end
diff --git a/lib/ohai/plugins/solaris2/network.rb b/lib/ohai/plugins/solaris2/network.rb
index aa60b21e..754a53e7 100644
--- a/lib/ohai/plugins/solaris2/network.rb
+++ b/lib/ohai/plugins/solaris2/network.rb
@@ -1,6 +1,7 @@
+# frozen_string_literal: true
#
# Author:: Benjamin Black (<nostromo@gmail.com>)
-# Copyright:: Copyright (c) 2008-2018, Chef Software Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -54,13 +55,11 @@
# inet6 fe80::203:baff:fe17:4444/128
# Extracted from http://illumos.org/hcl/
-unless defined?(ETHERNET_ENCAPS)
- ETHERNET_ENCAPS = %w{ afe amd8111s arn atge ath bfe bge bnx bnxe ce cxgbe
+ETHERNET_ENCAPS ||= %w{ afe amd8111s arn atge ath bfe bge bnx bnxe ce cxgbe
dmfe e1000g efe elxl emlxs eri hermon hme hxge igb
iprb ipw iwh iwi iwk iwp ixgb ixgbe mwl mxfe myri10ge
nge ntxn nxge pcn platform qfe qlc ral rge rtls rtw rwd
rwn sfe tavor vr wpi xge yge aggr}.freeze
-end
Ohai.plugin(:Network) do
require_relative "../../mixin/network_helper"
@@ -88,7 +87,7 @@ Ohai.plugin(:Network) do
def full_interface_name(iface, part_name, index)
iface.each do |name, attrs|
- next unless attrs && attrs.respond_to?(:[])
+ next unless attrs.respond_to?(:[])
return name if /^#{part_name}($|:)/.match(name) && attrs[:index] == index
end
@@ -102,10 +101,8 @@ Ohai.plugin(:Network) do
counters Mash.new unless counters
counters[:network] ||= Mash.new
- so = shell_out("ifconfig -a")
cint = nil
-
- so.stdout.lines do |line|
+ shell_out("ifconfig -a").stdout.lines do |line|
# regex: https://rubular.com/r/ZiIHbsnfiWPW1p
if line =~ /^([0-9a-zA-Z\.\:\-]+): \S+ mtu (\d+)(?: index (\d+))?/
cint = $1
@@ -159,12 +156,10 @@ Ohai.plugin(:Network) do
break
end
end
- if iface[ifn][:arp]
- iface[ifn][:arp].each_key do |addr|
- if addr.eql?(iaddr)
- iface[ifn][:addresses][iface[ifn][:arp][iaddr]] = { "family" => "lladdr" }
- break
- end
+ iface[ifn][:arp]&.each_key do |addr|
+ if addr.eql?(iaddr)
+ iface[ifn][:addresses][iface[ifn][:arp][iaddr]] = { "family" => "lladdr" }
+ break
end
end
end
diff --git a/lib/ohai/plugins/solaris2/platform.rb b/lib/ohai/plugins/solaris2/platform.rb
index 90cd0338..1a9d0ac5 100644
--- a/lib/ohai/plugins/solaris2/platform.rb
+++ b/lib/ohai/plugins/solaris2/platform.rb
@@ -1,6 +1,7 @@
+# frozen_string_literal: true
#
# Author:: Benjamin Black (<nostromo@gmail.com>)
-# Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -20,14 +21,13 @@ Ohai.plugin(:Platform) do
provides "platform", "platform_version", "platform_build", "platform_family"
collect_data(:solaris2) do
- if File.exist?("/sbin/uname")
+ if file_exist?("/sbin/uname")
uname_exec = "/sbin/uname"
else
uname_exec = "uname"
end
- so = shell_out("#{uname_exec} -X")
- so.stdout.lines do |line|
+ shell_out("#{uname_exec} -X").stdout.lines do |line|
case line
when /^Release =\s+(.+)$/
platform_version $1
@@ -36,26 +36,19 @@ Ohai.plugin(:Platform) do
end
end
- File.open("/etc/release") do |file|
+ file_open("/etc/release") do |file|
while ( line = file.gets )
case line
- when /^.*(SmartOS).*$/
+ when /.*SmartOS.*/
platform "smartos"
- when /^\s*(OmniOS).*r(\d+).*$/
+ when /^\s*OmniOS.*r(\d+).*$/
platform "omnios"
- platform_version $2
- when /^\s*(OpenIndiana).*oi_(\d+).*$/
+ platform_version $1
+ when /^\s*OpenIndiana.*(Development oi_|Hipster )(\d\S*)/ # https://rubular.com/r/iMtOBwbnyqDz7u
platform "openindiana"
platform_version $2
- when /^\s*(OpenSolaris).*snv_(\d+).*$/
- platform "opensolaris"
- platform_version $2
- when /^\s*(Oracle Solaris)/
- platform "solaris2"
- when /^\s*(Solaris)\s.*$/
+ when /^\s*(Oracle Solaris|Solaris)/
platform "solaris2"
- when /^\s*(NexentaCore)\s.*$/
- platform "nexentacore"
end
end
end
diff --git a/lib/ohai/plugins/solaris2/virtualization.rb b/lib/ohai/plugins/solaris2/virtualization.rb
index 3b3473f4..6a7fc2ec 100644
--- a/lib/ohai/plugins/solaris2/virtualization.rb
+++ b/lib/ohai/plugins/solaris2/virtualization.rb
@@ -1,7 +1,8 @@
+# frozen_string_literal: true
#
# Author:: Sean Walbran (<seanwalbran@gmail.com>)
# Author:: Kurt Yoder (<ktyopscode@yoderhome.com>)
-# Copyright:: Copyright (c) 2009-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# Copyright:: Copyright (c) 2010 Kurt Yoder
# License:: Apache License, Version 2.0
#
@@ -25,9 +26,7 @@ Ohai.plugin(:Virtualization) do
depends "dmi"
def collect_solaris_guestid
- command = "/usr/sbin/zoneadm list -p"
- so = shell_out(command)
- so.stdout.split(":").first
+ shell_out("/usr/sbin/zoneadm list -p").stdout.split(":").first
end
collect_data(:solaris2) do
@@ -36,9 +35,9 @@ Ohai.plugin(:Virtualization) do
# Detect paravirt KVM/QEMU from cpuinfo, report as KVM
psrinfo_path = Ohai.abs_path( "/usr/sbin/psrinfo" )
- if File.exist?(psrinfo_path)
+ if file_exist?(psrinfo_path)
so = shell_out("#{psrinfo_path} -pv")
- if so.stdout =~ /QEMU Virtual CPU|Common KVM processor|Common 32-bit KVM processor/
+ if /QEMU Virtual CPU|Common KVM processor|Common 32-bit KVM processor/.match?(so.stdout)
virtualization[:system] = "kvm"
virtualization[:role] = "guest"
virtualization[:systems][:kvm] = "guest"
@@ -56,9 +55,8 @@ Ohai.plugin(:Virtualization) do
if File.executable?("/usr/sbin/zoneadm")
zones = Mash.new
- so = shell_out("zoneadm list -pc")
- so.stdout.lines do |line|
- info = line.chomp.split(/:/)
+ shell_out("zoneadm list -pc").stdout.lines do |line|
+ info = line.chomp.split(":")
zones[info[1]] = {
"id" => info[0],
"state" => info[2],
diff --git a/lib/ohai/plugins/ssh_host_key.rb b/lib/ohai/plugins/ssh_host_key.rb
index d55d777e..12466071 100644
--- a/lib/ohai/plugins/ssh_host_key.rb
+++ b/lib/ohai/plugins/ssh_host_key.rb
@@ -1,6 +1,7 @@
+# frozen_string_literal: true
#
# Author:: Bryan McLellan <btm@chef.io>
-# Copyright:: Copyright (c) 2012-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -38,9 +39,9 @@ Ohai.plugin(:SSHHostKey) do
collect_data do
keys[:ssh] = Mash.new
- sshd_config = if File.exist?("/etc/ssh/sshd_config")
+ sshd_config = if file_exist?("/etc/ssh/sshd_config")
"/etc/ssh/sshd_config"
- elsif File.exist?("/etc/sshd_config")
+ elsif file_exist?("/etc/sshd_config")
# Darwin
"/etc/sshd_config"
else
@@ -49,11 +50,11 @@ Ohai.plugin(:SSHHostKey) do
end
if sshd_config
- File.open(sshd_config) do |conf|
+ file_open(sshd_config) do |conf|
conf.each_line do |line|
- if line =~ /^hostkey\s/i
+ if /^hostkey\s/i.match?(line)
pub_file = "#{line.split[1]}.pub"
- content = IO.read(pub_file).split
+ content = file_read(pub_file).split
key_type, key_subtype = extract_keytype?(content)
keys[:ssh]["host_#{key_type}_public"] = content[1] unless key_type.nil?
keys[:ssh]["host_#{key_type}_type"] = key_subtype unless key_subtype.nil?
@@ -62,22 +63,22 @@ Ohai.plugin(:SSHHostKey) do
end
end
- if keys[:ssh][:host_dsa_public].nil? && File.exist?("/etc/ssh/ssh_host_dsa_key.pub")
- keys[:ssh][:host_dsa_public] = IO.read("/etc/ssh/ssh_host_dsa_key.pub").split[1]
+ if keys[:ssh][:host_dsa_public].nil? && file_exist?("/etc/ssh/ssh_host_dsa_key.pub")
+ keys[:ssh][:host_dsa_public] = file_read("/etc/ssh/ssh_host_dsa_key.pub").split[1]
end
- if keys[:ssh][:host_rsa_public].nil? && File.exist?("/etc/ssh/ssh_host_rsa_key.pub")
- keys[:ssh][:host_rsa_public] = IO.read("/etc/ssh/ssh_host_rsa_key.pub").split[1]
+ if keys[:ssh][:host_rsa_public].nil? && file_exist?("/etc/ssh/ssh_host_rsa_key.pub")
+ keys[:ssh][:host_rsa_public] = file_read("/etc/ssh/ssh_host_rsa_key.pub").split[1]
end
- if keys[:ssh][:host_ecdsa_public].nil? && File.exist?("/etc/ssh/ssh_host_ecdsa_key.pub")
- content = IO.read("/etc/ssh/ssh_host_ecdsa_key.pub")
+ if keys[:ssh][:host_ecdsa_public].nil? && file_exist?("/etc/ssh/ssh_host_ecdsa_key.pub")
+ content = file_read("/etc/ssh/ssh_host_ecdsa_key.pub")
keys[:ssh][:host_ecdsa_public] = content.split[1]
keys[:ssh][:host_ecdsa_type] = content.split[0]
end
- if keys[:ssh][:host_ed25519_public].nil? && File.exist?("/etc/ssh/ssh_host_ed25519_key.pub")
- keys[:ssh][:host_ed25519_public] = IO.read("/etc/ssh/ssh_host_ed25519_key.pub").split[1]
+ if keys[:ssh][:host_ed25519_public].nil? && file_exist?("/etc/ssh/ssh_host_ed25519_key.pub")
+ keys[:ssh][:host_ed25519_public] = file_read("/etc/ssh/ssh_host_ed25519_key.pub").split[1]
end
end
end
diff --git a/lib/ohai/plugins/sysconf.rb b/lib/ohai/plugins/sysconf.rb
index c2deee96..dccdb630 100644
--- a/lib/ohai/plugins/sysconf.rb
+++ b/lib/ohai/plugins/sysconf.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Author:: Davide Cavalca <dcavalca@fb.com>
# Copyright:: Copyright (c) 2016 Facebook
diff --git a/lib/ohai/plugins/timezone.rb b/lib/ohai/plugins/timezone.rb
index 26a63e42..1d542e43 100644
--- a/lib/ohai/plugins/timezone.rb
+++ b/lib/ohai/plugins/timezone.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Author:: John Bellone (<jbellone@bloomberg.net>)
# License:: Apache License, Version 2.0
diff --git a/lib/ohai/plugins/train.rb b/lib/ohai/plugins/train.rb
new file mode 100644
index 00000000..6d48c4cc
--- /dev/null
+++ b/lib/ohai/plugins/train.rb
@@ -0,0 +1,36 @@
+# frozen_string_literal: true
+#
+# Copyright:: Copyright (c) Chef Software Inc.
+# License:: Apache License, Version 2.0
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+Ohai.plugin(:Train) do
+ provides "train"
+
+ collect_data do
+ if transport_connection
+ train Mash.new
+ train["family_hierarchy"] = transport_connection.platform.family_hierarchy
+ train["family"] = transport_connection.platform.family
+ train["platform"] = transport_connection.platform.platform
+ train["backend"] = transport_connection.backend_type
+ if transport_connection.respond_to?(:uri)
+ train["scheme"] = URI.parse(transport_connection.uri).scheme
+ train["uri"] = transport_connection.uri
+ else
+ end
+ end
+ end
+end
diff --git a/lib/ohai/plugins/uptime.rb b/lib/ohai/plugins/uptime.rb
index 5883f13c..bd6952d1 100644
--- a/lib/ohai/plugins/uptime.rb
+++ b/lib/ohai/plugins/uptime.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Author:: Adam Jacob (<adam@chef.io>)
# Author:: Bryan McLellan (<btm@loftninjas.org>)
@@ -5,7 +6,7 @@
# Author:: Doug MacEachern (<dougm@vmware.com>)
# Author:: Kurt Yoder (<ktyopscode@yoderhome.com>)
# Author:: Paul Mooring (<paul@chef.io>)
-# Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# Copyright:: Copyright (c) 2009 Bryan McLellan
# Copyright:: Copyright (c) 2010 VMware, Inc.
# License:: Apache License, Version 2.0
@@ -54,7 +55,7 @@ Ohai.plugin(:Uptime) do
end
collect_data(:linux) do
- uptime, idletime = File.open("/proc/uptime").gets.split(" ")
+ uptime, idletime = file_open("/proc/uptime").gets.split
uptime_seconds uptime.to_i
uptime seconds_to_human(uptime.to_i)
idletime_seconds idletime.to_i
@@ -84,7 +85,7 @@ Ohai.plugin(:Uptime) do
end
collect_data(:windows) do
- require "wmi-lite/wmi"
+ require "wmi-lite/wmi" unless defined?(WmiLite::Wmi)
wmi = WmiLite::Wmi.new
last_boot_up_time = wmi.first_of("Win32_OperatingSystem")["lastbootuptime"]
uptime_seconds Time.new.to_i - Time.parse(last_boot_up_time).to_i
diff --git a/lib/ohai/plugins/virtualbox.rb b/lib/ohai/plugins/virtualbox.rb
index b2549f99..60ec0213 100644
--- a/lib/ohai/plugins/virtualbox.rb
+++ b/lib/ohai/plugins/virtualbox.rb
@@ -1,7 +1,8 @@
+# frozen_string_literal: true
#
# Author:: Tim Smith <tsmith@chef.io>
# Author:: Joshua Colson <joshua.colson@gmail.com>
-# Copyright:: 2015-2019 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# Copyright:: 2019 Joshua Colson
# License:: Apache License, Version 2.0
#
@@ -93,8 +94,8 @@ Ohai.plugin(:Virtualbox) do
so_cmd = "VBoxManage list --sorted #{query_type}"
logger.trace(so_cmd)
so = shell_out(so_cmd)
- # raise an exception if the command fails
- # so.error!
+ # raise an exception if the command fails
+ # so.error!
if so.exitstatus == 0
# break the result into paragraph blocks, on successive newlines
diff --git a/lib/ohai/plugins/vmware.rb b/lib/ohai/plugins/vmware.rb
index 06b104d9..d8c89e66 100644
--- a/lib/ohai/plugins/vmware.rb
+++ b/lib/ohai/plugins/vmware.rb
@@ -1,7 +1,8 @@
+# frozen_string_literal: true
#
# Author:: "Dan Robinson" <drobinson@chef.io>
# Author:: "Christopher M. Luciano" <cmlucian@us.ibm.com>
-# Copyright:: Copyright (c) 2014-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# Copyright (C) 2015 IBM Corp.
# License:: Apache License, Version 2.0
#
@@ -36,12 +37,11 @@ Ohai.plugin(:VMware) do
depends "virtualization"
def from_cmd(cmd)
- so = shell_out(cmd)
- so.stdout.split($/)[0]
+ shell_out(cmd).stdout.strip
end
def get_vm_attributes(vmtools_path)
- if !File.exist?(vmtools_path)
+ if !file_exist?(vmtools_path)
logger.trace("Plugin VMware: #{vmtools_path} not found")
else
vmware Mash.new
@@ -51,12 +51,12 @@ Ohai.plugin(:VMware) do
# to attribute "vmware[:<parameter>]"
%w{hosttime speed sessionid balloon swap memlimit memres cpures cpulimit}.each do |param|
vmware[param] = from_cmd("#{vmtools_path} stat #{param}")
- if vmware[param] =~ /UpdateInfo failed/
+ if /UpdateInfo failed/.match?(vmware[param])
vmware[param] = nil
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/dmi.rb b/lib/ohai/plugins/windows/dmi.rb
index eea5b37f..4665dd77 100644
--- a/lib/ohai/plugins/windows/dmi.rb
+++ b/lib/ohai/plugins/windows/dmi.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Author:: Pete Higgins (pete@peterhiggins.org)
# Copyright:: Copyright (c) Chef Software Inc.
@@ -45,8 +46,8 @@ Ohai.plugin(:DMI) do
].freeze
collect_data(:windows) do
- require "ohai/common/dmi"
- require "wmi-lite/wmi"
+ require_relative "../../common/dmi"
+ require "wmi-lite/wmi" unless defined?(WmiLite::Wmi)
wmi = WmiLite::Wmi.new
dmi Mash.new
diff --git a/lib/ohai/plugins/windows/drivers.rb b/lib/ohai/plugins/windows/drivers.rb
index 425d33dc..5a3d6c4b 100644
--- a/lib/ohai/plugins/windows/drivers.rb
+++ b/lib/ohai/plugins/windows/drivers.rb
@@ -1,5 +1,6 @@
+# frozen_string_literal: true
#
-# Copyright:: Copyright (c) 2015 Chef Software
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -22,7 +23,7 @@ Ohai.plugin(:Drivers) do
collect_data(:windows) do
if configuration(:enabled)
- require "wmi-lite/wmi"
+ require "wmi-lite/wmi" unless defined?(WmiLite::Wmi)
kext = Mash.new
pnp_drivers = Mash.new
diff --git a/lib/ohai/plugins/windows/memory.rb b/lib/ohai/plugins/windows/memory.rb
index e0bb46f0..b8b682dd 100644
--- a/lib/ohai/plugins/windows/memory.rb
+++ b/lib/ohai/plugins/windows/memory.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# License:: Apache License, Version 2.0
#
@@ -17,7 +18,7 @@ Ohai.plugin(:Memory) do
provides "memory"
collect_data(:windows) do
- require "wmi-lite/wmi"
+ require "wmi-lite/wmi" unless defined?(WmiLite::Wmi)
memory Mash.new
memory[:swap] = Mash.new
diff --git a/lib/ohai/plugins/windows/network.rb b/lib/ohai/plugins/windows/network.rb
index 21f0c8c1..77c1be8c 100644
--- a/lib/ohai/plugins/windows/network.rb
+++ b/lib/ohai/plugins/windows/network.rb
@@ -1,6 +1,7 @@
+# frozen_string_literal: true
#
# Author:: James Gartrell (<jgartrel@gmail.com>)
-# Copyright:: Copyright (c) 2008-2017, Chef Software Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -93,7 +94,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>}]
@@ -117,8 +118,8 @@ Ohai.plugin(:Network) do
end
collect_data(:windows) do
-
- require "wmi-lite/wmi"
+ require "ipaddress" unless defined?(IPAddress)
+ require "wmi-lite/wmi" unless defined?(WmiLite::Wmi)
iface = Mash.new
iface_config = Mash.new
@@ -171,7 +172,7 @@ Ohai.plugin(:Network) do
iface[cint][:addresses][ip] = Mash.new(prefixlen: ip2.prefix)
if ip2.ipv6?
iface[cint][:addresses][ip][:family] = "inet6"
- iface[cint][:addresses][ip][:scope] = "Link" if ip =~ /^fe80/i
+ iface[cint][:addresses][ip][:scope] = "Link" if /^fe80/i.match?(ip)
else
if iface[cint][:configuration][:ip_subnet]
iface[cint][:addresses][ip][:netmask] = ip2.netmask.to_s
@@ -205,7 +206,7 @@ Ohai.plugin(:Network) do
so = shell_out("arp -a")
if so.exitstatus == 0
so.stdout.lines do |line|
- if line =~ /^Interface:\s+(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})\s+[-]+\s+(0x\S+)/
+ if line =~ /^Interface:\s+(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})\s+-+\s+(0x\S+)/
cint = $2.downcase
end
next unless iface[cint]
diff --git a/lib/ohai/plugins/windows/platform.rb b/lib/ohai/plugins/windows/platform.rb
index ecdcb777..727c3fd7 100644
--- a/lib/ohai/plugins/windows/platform.rb
+++ b/lib/ohai/plugins/windows/platform.rb
@@ -1,6 +1,7 @@
+# frozen_string_literal: true
#
# Author:: James Gartrell (<jgartrel@gmail.com>)
-# Copyright:: Copyright (c) 2009-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -16,7 +17,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/lib/ohai/plugins/windows/system_enclosure.rb b/lib/ohai/plugins/windows/system_enclosure.rb
index edc07d15..02d01e72 100644
--- a/lib/ohai/plugins/windows/system_enclosure.rb
+++ b/lib/ohai/plugins/windows/system_enclosure.rb
@@ -1,6 +1,7 @@
+# frozen_string_literal: true
#
# Author:: Stuart Preston (<stuart@chef.io>)
-# Copyright:: Copyright (c) 2018, Chef Software Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/lib/ohai/plugins/windows/virtualization.rb b/lib/ohai/plugins/windows/virtualization.rb
index 0ce24418..5820d973 100644
--- a/lib/ohai/plugins/windows/virtualization.rb
+++ b/lib/ohai/plugins/windows/virtualization.rb
@@ -1,8 +1,9 @@
+# frozen_string_literal: true
#
# Author:: Pavel Yudin (<pyudin@parallels.com>)
# Author:: Tim Smith (<tsmith@chef.io>)
# Copyright:: Copyright (c) 2015 Pavel Yudin
-# Copyright:: Copyright (c) 2015-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -24,7 +25,7 @@ Ohai.plugin(:Virtualization) do
include Ohai::Mixin::DmiDecode
collect_data(:windows) do
- require "wmi-lite/wmi"
+ require "wmi-lite/wmi" unless defined?(WmiLite::Wmi)
virtualization Mash.new unless virtualization
virtualization[:systems] ||= Mash.new
diff --git a/lib/ohai/plugins/zpools.rb b/lib/ohai/plugins/zpools.rb
index 6bbb9259..bd6ced99 100644
--- a/lib/ohai/plugins/zpools.rb
+++ b/lib/ohai/plugins/zpools.rb
@@ -1,6 +1,7 @@
+# frozen_string_literal: true
#
# Author:: Jason J. W. Williams (williamsjj@digitar.com)
-# Copyright:: Copyright (c) 2011-2017 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -65,7 +66,9 @@ Ohai.plugin(:Zpools) do
if platform_family == "solaris2"
command = "su adm -c \"zpool status #{pool}\""
else
- command = "zpool status #{pool}"
+ # -L is used to give us real device names not label or uuid
+ # for example sda instead of ata-WDC_WD60EZAZ-00SF3B0_WD-WX32D203UXYK
+ command = "zpool status #{pool} -L"
end
so = shell_out(command)
@@ -74,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/provides_map.rb b/lib/ohai/provides_map.rb
index e5ed2060..2c4a732a 100644
--- a/lib/ohai/provides_map.rb
+++ b/lib/ohai/provides_map.rb
@@ -1,7 +1,8 @@
+# frozen_string_literal: true
#
# Author:: Adam Jacob (<adam@chef.io>)
# Author:: Daniel DeLeo (<dan@chef.io>)
-# Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -136,8 +137,8 @@ module Ohai
private
def normalize_and_validate(attribute)
- raise Ohai::Exceptions::AttributeSyntaxError, "Attribute contains duplicate '/' characters: #{attribute}" if attribute =~ %r{//+}
- raise Ohai::Exceptions::AttributeSyntaxError, "Attribute contains a trailing '/': #{attribute}" if attribute =~ %r{/$}
+ raise Ohai::Exceptions::AttributeSyntaxError, "Attribute contains duplicate '/' characters: #{attribute}" if %r{//+}.match?(attribute)
+ raise Ohai::Exceptions::AttributeSyntaxError, "Attribute contains a trailing '/': #{attribute}" if %r{/$}.match?(attribute)
parts = attribute.split("/")
parts.shift if parts.length != 0 && parts[0].length == 0 # attribute begins with a '/'
diff --git a/lib/ohai/runner.rb b/lib/ohai/runner.rb
index 5961a2cf..02c30a19 100644
--- a/lib/ohai/runner.rb
+++ b/lib/ohai/runner.rb
@@ -1,6 +1,7 @@
+# frozen_string_literal: true
#
# Author:: Claire McQuin (<claire@chef.io>)
-# Copyright:: Copyright (c) 2013-2019, Chef Software Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License"); you
@@ -18,12 +19,15 @@
#
require_relative "dsl"
-require "benchmark"
+require "benchmark" unless defined?(Benchmark)
module Ohai
class Runner
attr_reader :failed_plugins, :logger
+
+ attr_accessor :transport_connection
+
# safe_run: set to true if this runner will run plugins in
# safe-mode. default false.
def initialize(controller, safe_run = false)
@@ -54,15 +58,13 @@ module Ohai
else
raise Ohai::Exceptions::InvalidPlugin, "Invalid plugin version #{plugin.version} for plugin #{plugin}"
end
- rescue Ohai::Exceptions::Error # rubocop: disable Lint/ShadowedException
- raise
- rescue SystemExit # abort or exit from plug-in should exit Ohai with failure code
+ rescue Ohai::Exceptions::Error, SystemExit # SystemExit: abort or exit from plug-in should exit Ohai with failure code
raise
rescue Exception => e
logger.trace("Plugin #{plugin.name} threw exception #{e.inspect} #{e.backtrace.join("\n")}")
end
end
- logger.trace("Plugin #{plugin.name} took #{elapsed} seconds to run.")
+ logger.trace("Plugin #{plugin.name} took #{"%f" % elapsed.truncate(6)} seconds to run.")
end
# @param [Ohai::DSL::Plugin] plugin
@@ -93,6 +95,7 @@ module Ohai
end
if dependency_providers.empty?
+ next_plugin.transport_connection = transport_connection
@safe_run ? next_plugin.safe_run : next_plugin.run
if next_plugin.failed
@failed_plugins << next_plugin.name
diff --git a/lib/ohai/system.rb b/lib/ohai/system.rb
index 6cddf774..ded1447e 100644
--- a/lib/ohai/system.rb
+++ b/lib/ohai/system.rb
@@ -1,6 +1,7 @@
+# frozen_string_literal: true
#
# Author:: Adam Jacob (<adam@chef.io>)
-# Copyright:: Copyright (c) 2008-2019, Chef Software Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -22,15 +23,16 @@ require_relative "log"
require_relative "mash"
require_relative "runner"
require_relative "dsl"
-require_relative "mixin/command"
+require_relative "mixin/shell_out"
require_relative "mixin/os"
require_relative "mixin/string"
require_relative "mixin/constant_helper"
require_relative "provides_map"
require_relative "hints"
-require "mixlib/shellout" unless defined?(Mixlib::ShellOut::DEFAULT_READ_TIMEOUT)
require_relative "config"
+require_relative "train_transport"
require "ffi_yajl" unless defined?(FFI_Yajl)
+require "cgi" unless defined?(CGI)
module Ohai
# The class used by Ohai::Application and Chef to actually collect data
@@ -41,6 +43,7 @@ module Ohai
attr_reader :config
attr_reader :provides_map
attr_reader :logger
+ attr_writer :transport_connection
# the cli flag is used to determine if we're being constructed by
# something like chef-client (which doesn't set this flag) and
@@ -68,7 +71,6 @@ module Ohai
configure_logging if @cli
@loader = Ohai::Loader.new(self)
- @runner = Ohai::Runner.new(self, true)
Ohai::Hints.refresh_hints
@@ -76,6 +78,13 @@ module Ohai
recursive_remove_constants(Ohai::NamedPlugin)
end
+ def runner
+ @runner ||=
+ Ohai::Runner.new(self, true).tap do |runner|
+ runner.transport_connection = transport_connection unless transport_connection.nil?
+ end
+ end
+
def [](key)
@data[key]
end
@@ -103,6 +112,13 @@ module Ohai
@loader.load_all
end
+ # get backend parameters for target mode
+ #
+ # @return [Train::Transport]
+ def transport_connection
+ @transport_connection ||= Ohai::TrainTransport.new(logger).build_transport&.connection
+ end
+
# run all plugins or those that match the attribute filter is provided
#
# @param safe [Boolean]
@@ -112,13 +128,14 @@ module Ohai
def run_plugins(safe = false, attribute_filter = nil)
begin
@provides_map.all_plugins(attribute_filter).each do |plugin|
- @runner.run_plugin(plugin)
+ runner.run_plugin(plugin)
end
+ transport_connection.close unless transport_connection.nil?
rescue Ohai::Exceptions::AttributeNotFound, Ohai::Exceptions::DependencyCycle => e
logger.error("Encountered error while running plugins: #{e.inspect}")
raise
end
- critical_failed = Ohai::Config.ohai[:critical_plugins] & @runner.failed_plugins
+ critical_failed = Ohai::Config.ohai[:critical_plugins] & runner.failed_plugins
unless critical_failed.empty?
msg = "The following Ohai plugins marked as critical failed: #{critical_failed}"
if @cli
@@ -140,7 +157,7 @@ module Ohai
def run_additional_plugins(plugin_path)
@loader.load_additional(plugin_path).each do |plugin|
logger.trace "Running plugin #{plugin}"
- @runner.run_plugin(plugin)
+ runner.run_plugin(plugin)
end
freeze_strings!
@@ -226,5 +243,16 @@ module Ohai
end
visitor.call(@data)
end
+
+ # Extract additional backend parameters from Target Mode URL.
+ #
+ # @api private
+ # @return [Hash]
+ def backend_parameters
+ uri = URI.parse(config[:target])
+ return {} unless uri.query
+
+ CGI.parse(uri.query).map { |k, v| [k.to_sym, v.first] }.to_h
+ end
end
end
diff --git a/lib/ohai/train_transport.rb b/lib/ohai/train_transport.rb
new file mode 100644
index 00000000..8bdfe694
--- /dev/null
+++ b/lib/ohai/train_transport.rb
@@ -0,0 +1,29 @@
+# frozen_string_literal: true
+# Author:: Bryan McLellan <btm@loftninjas.org>
+# Copyright:: Copyright (c) Chef Software Inc.
+# License:: Apache License, Version 2.0
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+require "chef-config/mixin/train_transport" unless defined?(ChefConfig::Mixin::TrainTransport)
+
+module Ohai
+ class TrainTransport
+ include ChefConfig::Mixin::TrainTransport
+
+ def config
+ Ohai::Config
+ end
+ end
+end
diff --git a/lib/ohai/util/file_helper.rb b/lib/ohai/util/file_helper.rb
index 87358d95..10095316 100644
--- a/lib/ohai/util/file_helper.rb
+++ b/lib/ohai/util/file_helper.rb
@@ -1,38 +1,6 @@
-# Author:: Lamont Granquist (<lamont@chef.io>)
-#
-# Copyright:: Copyright (c) 2013-14 Chef Software, Inc.
-#
-# License:: Apache License, Version 2.0
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Copied from chef/lib/chef/util/selinux.rb
-
-module Ohai
- module Util
- module FileHelper
- def which(cmd)
- paths = ENV["PATH"].split(File::PATH_SEPARATOR) + [ "/bin", "/usr/bin", "/sbin", "/usr/sbin" ]
- paths.each do |path|
- filename = File.join(path, cmd)
- if File.executable?(filename)
- logger.trace("Plugin #{name}: found #{cmd} at #{filename}")
- return filename
- end
- end
- logger.trace("Plugin #{name}: did not find #{cmd}")
- false
- end
- end
- end
+# frozen_string_literal: true
+$stderr.puts "WARN: Ohai::Util::FileHelper is deprecated, please use Ohai::Mixin::Which or remove if the reference is unnecessary"
+require_relative "../mixin/which"
+module Ohai::Util
+ FileHelper = Ohai::Mixin::Which
end
diff --git a/lib/ohai/util/ip_helper.rb b/lib/ohai/util/ip_helper.rb
index f22c4fdd..86617935 100644
--- a/lib/ohai/util/ip_helper.rb
+++ b/lib/ohai/util/ip_helper.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#
# Author:: Stafford Brunk (<stafford.brunk@gmail.com>)
# License:: Apache License, Version 2.0
@@ -14,11 +15,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-require "ipaddress"
-
module Ohai
module Util
module IpHelper
+ require "ipaddress" unless defined?(IPAddress)
+
# Corresponding to RFC 4192 + RFC 4193
IPV6_LINK_LOCAL_UNICAST_BLOCK = IPAddress("fe80::/10")
IPV6_PRIVATE_ADDRESS_BLOCK = IPAddress("fc00::/7")
diff --git a/lib/ohai/util/win32.rb b/lib/ohai/util/win32.rb
index 8a62c07a..6adcd3ca 100644
--- a/lib/ohai/util/win32.rb
+++ b/lib/ohai/util/win32.rb
@@ -1,6 +1,7 @@
+# frozen_string_literal: true
# Author:: Adam Edwards (<adamed@chef.io>)
#
-# Copyright:: Copyright (c) 2013-14 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
#
# License:: Apache License, Version 2.0
#
@@ -19,7 +20,7 @@
module Ohai
module Util
module Win32
- if RUBY_PLATFORM =~ /mswin|mingw|windows/
+ if RUBY_PLATFORM.match?(/mswin|mingw|windows/)
require "ffi" unless defined?(FFI)
diff --git a/lib/ohai/version.rb b/lib/ohai/version.rb
index 167ac87c..cc3106d7 100644
--- a/lib/ohai/version.rb
+++ b/lib/ohai/version.rb
@@ -1,6 +1,7 @@
+# frozen_string_literal: true
#
# Author:: Adam Jacob (<adam@chef.io>)
-# Copyright:: Copyright (c) 2008-2018, Chef Software Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -17,6 +18,6 @@
#
module Ohai
- OHAI_ROOT = File.expand_path(File.dirname(__FILE__))
- VERSION = "16.0.20".freeze
+ OHAI_ROOT = File.expand_path(__dir__)
+ VERSION = "16.7.33"
end
diff --git a/ohai.gemspec b/ohai.gemspec
index c242fd9c..854805db 100644
--- a/ohai.gemspec
+++ b/ohai.gemspec
@@ -1,5 +1,5 @@
-
-$:.unshift File.expand_path("../lib", __FILE__)
+# frozen_string_literal: true
+$:.unshift File.expand_path("lib", __dir__)
require "ohai/version"
Gem::Specification.new do |s|
@@ -12,19 +12,20 @@ Gem::Specification.new do |s|
s.email = "adam@chef.io"
s.homepage = "https://github.com/chef/ohai/"
- s.required_ruby_version = ">= 2.5"
+ s.required_ruby_version = ">= 2.6"
- s.add_dependency "systemu", "~> 2.6.4"
+ s.add_dependency "chef-config", ">= 12.8", "< 17"
+ s.add_dependency "chef-utils", ">= 16.0", "< 17"
+ s.add_dependency "ffi", "~> 1.9"
s.add_dependency "ffi-yajl", "~> 2.2"
+ s.add_dependency "ipaddress"
s.add_dependency "mixlib-cli", ">= 1.7.0" # 1.7+ needed to support passing multiple options
s.add_dependency "mixlib-config", ">= 2.0", "< 4.0"
s.add_dependency "mixlib-log", ">= 2.0.1", "< 4.0"
s.add_dependency "mixlib-shellout", ">= 2.0", "< 4.0"
s.add_dependency "plist", "~> 3.1"
- s.add_dependency "ipaddress"
s.add_dependency "wmi-lite", "~> 1.0"
- s.add_dependency "ffi", "~> 1.9"
- s.add_dependency "chef-config", ">= 12.8", "< 17"
+ s.add_dependency "train-core"
# Note for ohai developers: If chef-config causes you grief, try:
# bundle install --with development
# this should work as long as chef is a development dependency in Gemfile.
diff --git a/spec/data/plugins/system_profiler_spapplicationsdatatype.output b/spec/data/plugins/system_profiler_spapplicationsdatatype.output
new file mode 100644
index 00000000..72c36667
--- /dev/null
+++ b/spec/data/plugins/system_profiler_spapplicationsdatatype.output
@@ -0,0 +1,8675 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<array>
+ <dict>
+ <key>_SPCommandLineArguments</key>
+ <array>
+ <string>/usr/sbin/system_profiler</string>
+ <string>-nospawn</string>
+ <string>-xml</string>
+ <string>SPApplicationsDataType</string>
+ <string>-detailLevel</string>
+ <string>full</string>
+ </array>
+ <key>_SPCompletionInterval</key>
+ <real>3.1721349954605103</real>
+ <key>_SPResponseTime</key>
+ <real>3.2803900241851807</real>
+ <key>_dataType</key>
+ <string>SPApplicationsDataType</string>
+ <key>_detailLevel</key>
+ <integer>1</integer>
+ <key>_items</key>
+ <array>
+ <dict>
+ <key>_name</key>
+ <string>System Preferences</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-07-23T23:08:07Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/Applications/System Preferences.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>14.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>WhatsApp</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-09-04T04:55:43Z</date>
+ <key>obtained_from</key>
+ <string>mac_app_store</string>
+ <key>path</key>
+ <string>/Applications/WhatsApp.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Apple Mac OS Application Signing</string>
+ <string>Apple Worldwide Developer Relations Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>2.2035.15</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>App Store</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/Applications/App Store.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>3.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Install macOS Catalina</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>Install macOS Catalina, Copyright © 2007-2020 Apple Inc. All rights reserved.</string>
+ <key>lastModified</key>
+ <date>2020-09-04T04:54:33Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/Applications/Install macOS Catalina.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>15.6.00</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>iTunes</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>iTunes 12.9.5.5, © 2000–2019 Apple Inc. All rights reserved.</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/Applications/iTunes.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>12.9.5</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Chef Workstation App</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-09-03T03:16:22Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Applications/Chef Workstation App.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: Chef Software, Inc. (EU3VF8YLX2)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>0.1.82</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>iTerm</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>3.3.12</string>
+ <key>lastModified</key>
+ <date>2020-07-03T01:27:02Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Applications/iTerm.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: GEORGE NACHMAN (H7V7XYVQ7D)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>3.3.12</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Installer</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-07-23T23:08:07Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/Installer.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>6.2.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>DiskImageMounter</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/DiskImageMounter.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>480.260.1</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Emacs</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>Emacs 27.1 Copyright (C) 2020 Free Software Foundation, Inc.</string>
+ <key>lastModified</key>
+ <date>2020-08-19T07:08:51Z</date>
+ <key>obtained_from</key>
+ <string>unknown</string>
+ <key>path</key>
+ <string>/usr/local/Cellar/emacs-plus@27/27.1/Emacs.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>version</key>
+ <string>27.1</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Firefox</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>Firefox 80.0.1</string>
+ <key>lastModified</key>
+ <date>2020-09-03T10:58:18Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Applications/Firefox.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+n <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: Mozilla Corporation (43AQ936H96)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>80.0.1</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Slack</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-08-12T22:24:32Z</date>
+ <key>obtained_from</key>
+ <string>mac_app_store</string>
+ <key>path</key>
+ <string>/Applications/Slack.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Apple Mac OS Application Signing</string>
+ <string>Apple Worldwide Developer Relations Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>4.8.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Brother Status Monitor</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2018-07-22T04:45:03Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Library/Printers/Brother/Utilities/BrStatusMonitor.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: Brother Industries, LTD.</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>3.23.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>EPSON Scanner</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>5.7.25, Copyright(C) Seiko Epson Corporation 2002-2015 All rights reserved.</string>
+ <key>lastModified</key>
+ <date>2019-01-02T07:04:55Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Library/Image Capture/Devices/EPSON Scanner.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: EPSON (TXAEAV5RN4)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>5.7.25</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Assistive Control</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/Input Methods/Assistive Control.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>2.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>JapaneseIM</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/Input Methods/JapaneseIM.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>KoreanIM</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/Input Methods/KoreanIM.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>VietnameseIM</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/Input Methods/VietnameseIM.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>syncuid</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>4.0, Copyright Apple Computer Inc. 2004</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/PrivateFrameworks/SyncServicesUI.framework/Versions/A/Resources/syncuid.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>8.1</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>universalAccessAuthWarn</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/PrivateFrameworks/UniversalAccess.framework/Versions/A/Resources/universalAccessAuthWarn.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>ImageCaptureService</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/Services/ImageCaptureService.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>6.7</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Dock</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>Dock 1.8</string>
+ <key>lastModified</key>
+ <date>2019-07-23T23:08:07Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/Dock.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.8</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Photo Library Migration Utility</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-07-23T23:08:07Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/Photo Library Migration Utility.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>2.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>quicklookd</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>5.0, Copyright Apple Inc. 2007-2013</string>
+ <key>lastModified</key>
+ <date>2019-07-23T23:08:07Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/Frameworks/QuickLook.framework/Versions/A/Resources/quicklookd.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>5.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>CharacterPalette</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-07-23T23:08:07Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/Input Methods/CharacterPalette.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>2.0.1</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>VoiceOver Quickstart</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-07-23T23:08:07Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/PrivateFrameworks/ScreenReader.framework/Versions/A/Resources/VoiceOver Quickstart.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>9</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>iGlasses</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-05-11T06:22:52Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Library/Application Support/iGlasses3/iGlasses.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: Ecamm Network, LLC (5EJH68M642)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>3.5.2</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Karabiner-Elements</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-07T07:15:03Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Library/Application Support/org.pqrs/Karabiner-Elements/updater/Karabiner-Elements.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: Fumihiko Takayama (G43BCU2T37)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>12.10.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>AddPrinter</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/AddPrinter.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>14.4</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Certificate Assistant</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/Certificate Assistant.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>5.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>ControlStrip</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/ControlStrip.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>ManagedClient</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/ManagedClient.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>11.2</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Set-up Assistant</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/Setup Assistant.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>10.10</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Siri</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/Siri.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>146.16.1</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>loginwindow</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/loginwindow.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>9.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Pixlr</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2018-07-17T21:57:02Z</date>
+ <key>obtained_from</key>
+ <string>mac_app_store</string>
+ <key>path</key>
+ <string>/Applications/Pixlr.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Apple Mac OS Application Signing</string>
+ <string>Apple Worldwide Developer Relations Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.1.1</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Growl</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2018-07-17T22:02:33Z</date>
+ <key>obtained_from</key>
+ <string>mac_app_store</string>
+ <key>path</key>
+ <string>/Applications/Growl.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Apple Mac OS Application Signing</string>
+ <string>Apple Worldwide Developer Relations Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>2.1.3</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Preview</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>10.1, Copyright 2002-2018 Apple Inc.</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/Applications/Preview.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>10.1</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>ColorSync Utility</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/Applications/Utilities/ColorSync Utility.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>4.14.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Script Editor</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/Applications/Utilities/Script Editor.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>2.11</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Contacts</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-07-23T23:08:07Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/Applications/Contacts.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>12.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>FaceTime</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-07-23T23:08:07Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/Applications/FaceTime.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>5.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Font Book</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>9.0, Copyright © 2003–2018 Apple Inc.</string>
+ <key>lastModified</key>
+ <date>2019-07-23T23:08:07Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/Applications/Font Book.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>9.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Terminal</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-07-23T23:08:07Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/Applications/Utilities/Terminal.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>2.9.5</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>VoiceOver Utility</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-07-23T23:08:07Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/Applications/Utilities/VoiceOver Utility.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>9</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>iMovie</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-12-12T11:06:36Z</date>
+ <key>obtained_from</key>
+ <string>mac_app_store</string>
+ <key>path</key>
+ <string>/Applications/iMovie.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Apple Mac OS Application Signing</string>
+ <string>Apple Worldwide Developer Relations Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>10.1.14</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Seashore</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-05-12T21:00:14Z</date>
+ <key>obtained_from</key>
+ <string>mac_app_store</string>
+ <key>path</key>
+ <string>/Applications/Seashore.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Apple Mac OS Application Signing</string>
+ <string>Apple Worldwide Developer Relations Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>2.5.9</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Skype for Business</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-05-29T22:44:40Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Applications/Skype for Business.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: Skype Communications S.a.r.l (AL798K98FX)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>16.28.192</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Pages</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-10T21:02:05Z</date>
+ <key>obtained_from</key>
+ <string>mac_app_store</string>
+ <key>path</key>
+ <string>/Applications/Pages.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Apple Mac OS Application Signing</string>
+ <string>Apple Worldwide Developer Relations Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>10.1</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Numbers</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-10T21:02:57Z</date>
+ <key>obtained_from</key>
+ <string>mac_app_store</string>
+ <key>path</key>
+ <string>/Applications/Numbers.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Apple Mac OS Application Signing</string>
+ <string>Apple Worldwide Developer Relations Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>10.1</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Keynote</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-10T21:03:53Z</date>
+ <key>obtained_from</key>
+ <string>mac_app_store</string>
+ <key>path</key>
+ <string>/Applications/Keynote.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Apple Mac OS Application Signing</string>
+ <string>Apple Worldwide Developer Relations Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>10.1</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Safari</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>13.1.2, Copyright © 2003-2020 Apple Inc.</string>
+ <key>lastModified</key>
+ <date>2020-07-16T08:41:03Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/Applications/Safari.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>13.1.2</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Books</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/Applications/Books.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.19</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Calculator</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>10.14.6, Copyright © 2001-2020, Apple Inc.</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/Applications/Calculator.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>10.14.6</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Calendar</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/Applications/Calendar.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>11.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Mail</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/Applications/Mail.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>12.4</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Maps</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/Applications/Maps.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>2.1</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Messages</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/Applications/Messages.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>12.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Notes</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/Applications/Notes.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>4.6</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Photos</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/Applications/Photos.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>4.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>QuickTime Player</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>10.4, Copyright © 2009-2014 Apple Inc. All Rights Reserved.</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/Applications/QuickTime Player.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>10.5</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>AirPort Utility</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>6.3.9, Copyright 2001 -2019 Apple Inc.</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/Applications/Utilities/AirPort Utility.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>6.3.9</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Grapher</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/Applications/Utilities/Grapher.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>2.7</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Keychain Access</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/Applications/Utilities/Keychain Access.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>10.5</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>System Information</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/Applications/Utilities/System Information.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>10.14</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>GarageBand</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>GarageBand 10.3.5, Copyright © 2004–2020 Apple Inc. All Rights Reserved</string>
+ <key>lastModified</key>
+ <date>2020-07-21T21:53:55Z</date>
+ <key>obtained_from</key>
+ <string>mac_app_store</string>
+ <key>path</key>
+ <string>/Applications/GarageBand.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Apple Mac OS Application Signing</string>
+ <string>Apple Worldwide Developer Relations Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>10.3.5</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>VirtualBox</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>Oracle VM VirtualBox Manager 6.1.12, © 2007-2020 Oracle Corporation</string>
+ <key>lastModified</key>
+ <date>2020-07-28T08:01:52Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Applications/VirtualBox.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: Oracle America, Inc. (VB5E2TV963)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>6.1.12</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Microsoft Remote Desktop</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-08-05T01:03:53Z</date>
+ <key>obtained_from</key>
+ <string>mac_app_store</string>
+ <key>path</key>
+ <string>/Applications/Microsoft Remote Desktop.localized/Microsoft Remote Desktop.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Apple Mac OS Application Signing</string>
+ <string>Apple Worldwide Developer Relations Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>10.4.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Microsoft Excel</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-08-12T03:09:44Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Applications/Microsoft Excel.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: Microsoft Corporation (UBF8T346G9)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>16.40</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Microsoft PowerPoint</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-08-12T03:11:27Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Applications/Microsoft PowerPoint.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: Microsoft Corporation (UBF8T346G9)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>16.40</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Cisco Webex Meetings</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-30T03:37:47Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Users/ohaiuser/Library/Application Support/WebEx Folder/T33_64UMC_40.6.6.7/Meeting Center.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: Cisco (DE8Y96K9QP)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>2006.3000.4006.6</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Microsoft Word</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-08-12T03:07:02Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Applications/Microsoft Word.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: Microsoft Corporation (UBF8T346G9)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>16.40</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Cisco Webex Meetings</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-08-19T05:03:09Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Users/ohaiuser/Library/Application Support/WebEx Folder/T33_64UMC_40.8.6.2/Meeting Center.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: Cisco (DE8Y96K9QP)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>2008.0823.4008.6</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>GitX</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2014-11-10T13:33:48Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Applications/GitX.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: Rowan James</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>0.15.1964 dev</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Transmission</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>2.94 (d8e60ee44f)</string>
+ <key>lastModified</key>
+ <date>2018-05-01T17:26:48Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Applications/Transmission.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: Digital Ignition LLC (5DPYRBHEAR)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>2.94</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>TinkerTool</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>TinkerTool version 7.1, Copyright © 2001 – 2018 by Marcel Bresink Software-Systeme</string>
+ <key>lastModified</key>
+ <date>2018-12-17T14:46:12Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Applications/TinkerTool.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: Marcel Bresink (GFSRQKPPG2)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>7.1</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>ScreenFlow</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>6.2.4, Copyright 2017 Telestream LLC</string>
+ <key>lastModified</key>
+ <date>2017-12-06T16:57:55Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Applications/ScreenFlow.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: Telestream LLC (WSG985FR47)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>6.2.4</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Swinsian</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-10-23T13:44:17Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Applications/Swinsian.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: James Burton (L3F8JS4ERD)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>2.2.2</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Sourcetree</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-01-08T11:56:08Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Applications/Sourcetree.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: Atlassian Pty Ltd (UPXU4CQZ5P)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>4.0.1</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>balenaEtcher</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-01-13T19:59:00Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Applications/balenaEtcher.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: Rulemotion Ltd (66H43P8FRG)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.5.71</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>calibre</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>calibre, an E-book management application. Visit https://calibre-ebook.com for details.</string>
+ <key>lastModified</key>
+ <date>2020-02-22T10:48:09Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Applications/calibre.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: Kovid Goyal (NTY7FVCEKP)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>4.11.2</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Image2Icon</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-08-19T07:06:47Z</date>
+ <key>obtained_from</key>
+ <string>mac_app_store</string>
+ <key>path</key>
+ <string>/Applications/Image2Icon.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Apple Mac OS Application Signing</string>
+ <string>Apple Worldwide Developer Relations Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>2.11</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>OmniGraffle</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>OmniGraffle 7.17.3, version 203.7.0, Copyright 2000–2020 The Omni Group</string>
+ <key>lastModified</key>
+ <date>2020-08-20T00:48:26Z</date>
+ <key>obtained_from</key>
+ <string>mac_app_store</string>
+ <key>path</key>
+ <string>/Applications/OmniGraffle.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Apple Mac OS Application Signing</string>
+ <string>Apple Worldwide Developer Relations Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>7.17.3</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Xperia Companion</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-10-23T04:22:10Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Applications/Xperia Companion.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: Sony Mobile Communications AB (LEG7PUMD84)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>2.8.3</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>zoom.us</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-05-12T04:01:03Z</date>
+ <key>obtained_from</key>
+ <string>unknown</string>
+ <key>path</key>
+ <string>/Applications/zoom.us.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>version</key>
+ <string>5.0.2 (24030.0508)</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Adobe Acrobat Reader DC</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>Adobe Reader X 20.012.20043, ©1984 -2020 Adobe Systems Incorporated. All rights reserved.</string>
+ <key>lastModified</key>
+ <date>2020-08-20T04:33:46Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Applications/Adobe Acrobat Reader DC.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: Adobe Systems, Inc. (JQ525L2MZD)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>20.012.20043</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Cisco Webex Meetings</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-30T03:39:12Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Applications/Cisco Webex Meetings.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: Cisco (DE8Y96K9QP)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>40.6.6.7</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Docker</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-08-10T12:14:55Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Applications/Docker.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: Docker Inc (9BNSXJN65R)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>2.3.0.4</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Directory Utility</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/Applications/Directory Utility.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>6.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>VLC</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>Copyright © 1996-2020 the VideoLAN team</string>
+ <key>lastModified</key>
+ <date>2020-08-15T01:08:40Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Applications/VLC.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: VideoLAN (75GAHG3SZQ)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>3.0.11.1</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Screen Sharing</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-07-23T23:08:07Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/Applications/Screen Sharing.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.7.2</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>System Image Utility</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/Applications/System Image Utility.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>10.14</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Signal</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-08-04T21:49:17Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Applications/Signal.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: Quiet Riddle Ventures LLC (U68MSDN6DR)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.34.5</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Google Chrome</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-08-23T04:16:28Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Applications/Google Chrome.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: Google, Inc. (EQHXZ8M8AV)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>85.0.4183.83</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Wireless Diagnostics</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/Applications/Wireless Diagnostics.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Skype</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-08-28T07:33:12Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Applications/Skype.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: Skype Communications S.a.r.l (AL798K98FX)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>8.64</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Finder</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>macOS Finder 10.14.5</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/Finder.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>10.14.5</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Dropbox</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-08-14T22:44:36Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Applications/Dropbox.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: Dropbox, Inc. (G7HH3F8CAK)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>104.4.175</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Quicksilver</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2018-03-12T12:33:48Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Applications/Quicksilver.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: Rob McBroom (ATVCND8EAP)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.5.9</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>1Password 7</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-07T14:49:19Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Applications/1Password 7.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: AgileBits Inc. (2BUA8C4S2C)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>7.6</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Disk Utility</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-07-23T23:08:07Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/Applications/Utilities/Disk Utility.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>18.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>HardwareGrowler</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2018-07-17T22:02:13Z</date>
+ <key>obtained_from</key>
+ <string>mac_app_store</string>
+ <key>path</key>
+ <string>/Applications/HardwareGrowler.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Apple Mac OS Application Signing</string>
+ <string>Apple Worldwide Developer Relations Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>2.2</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>HazeOver</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-06-26T00:45:54Z</date>
+ <key>obtained_from</key>
+ <string>mac_app_store</string>
+ <key>path</key>
+ <string>/Applications/HazeOver.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Apple Mac OS Application Signing</string>
+ <string>Apple Worldwide Developer Relations Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.8.6</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Mail Notifr</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2018-07-21T12:35:52Z</date>
+ <key>obtained_from</key>
+ <string>mac_app_store</string>
+ <key>path</key>
+ <string>/Applications/Mail Notifr.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Apple Mac OS Application Signing</string>
+ <string>Apple Worldwide Developer Relations Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.3.5</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Day-O</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2016-10-20T17:29:14Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Applications/Day-O.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: Shaun Inman</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>2.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Divvy</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2017-02-01T08:16:30Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Applications/Divvy.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: Mizage, LLC</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.5.1</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Okta Extension App</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-09-04T04:20:22Z</date>
+ <key>obtained_from</key>
+ <string>mac_app_store</string>
+ <key>path</key>
+ <string>/Applications/Okta Extension App.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Apple Mac OS Application Signing</string>
+ <string>Apple Worldwide Developer Relations Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>5.41.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Recents</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/Finder.app/Contents/Applications/Recents.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>iCloud Drive</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/Finder.app/Contents/Applications/iCloud Drive.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Computer</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/Finder.app/Contents/Applications/Computer.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Network</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/Finder.app/Contents/Applications/Network.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>AirDrop</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/Finder.app/Contents/Applications/AirDrop.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Recents</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/Finder.app/Contents/Applications/All My Files.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>HelpViewer</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/HelpViewer.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>6.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Storage Management</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/Applications/Storage Management.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>RAID Utility</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>RAID Utility 3.0 (405), Copyright © 2007-2013 Apple Inc.</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/Applications/RAID Utility.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>4.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Network Utility</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>1.9.2, Copyright © 2000-2017 Apple Inc. All rights reserved.</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/Applications/Network Utility.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.9.2</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Feedback Assistant</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/Applications/Feedback Assistant.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>4.6</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>About This Mac</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/Applications/About This Mac.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Archive Utility</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-07-23T23:08:07Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/Applications/Archive Utility.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>10.11</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Folder Actions Set-up</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/Applications/Folder Actions Setup.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.2</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>DVD Player</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/Applications/DVD Player.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>6.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Tweetbot</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-09-02T21:14:26Z</date>
+ <key>obtained_from</key>
+ <string>mac_app_store</string>
+ <key>path</key>
+ <string>/Applications/Tweetbot.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Apple Mac OS Application Signing</string>
+ <string>Apple Worldwide Developer Relations Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>3.4.1</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>SelfControl</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:34:13Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Applications/SelfControl.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: Charlie Stigler (L6W5L88KN7)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>3.0.2</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Boot Camp Assistant</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/Applications/Utilities/Boot Camp Assistant.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>6.1.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Bluetooth File Exchange</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>6.0.14, Copyright © 2002-2019 Apple Inc. All rights reserved.</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/Applications/Utilities/Bluetooth File Exchange.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>6.0.14</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Activity Monitor</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>10.14, Copyright © 2000-2018 Apple Inc.</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/Applications/Utilities/Activity Monitor.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>10.14</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>News</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/Applications/News.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>4.4</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Karabiner-Elements</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-06-27T05:37:40Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Applications/Karabiner-Elements.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: Fumihiko Takayama (G43BCU2T37)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>12.10.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Karabiner-EventViewer</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-06-27T05:37:40Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Applications/Karabiner-EventViewer.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: Fumihiko Takayama (G43BCU2T37)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>12.10.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Battle.net</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>Blizzard Battle.net App 1.22.0, © 2012-2020 Blizzard Entertainment. All rights reserved.</string>
+ <key>lastModified</key>
+ <date>2020-06-22T05:27:34Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Applications/Battle.net.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: Blizzard Entertainment, Inc. (G847MC6JZ5)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.22.0.12040</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Steam</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-06-18T04:01:23Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Applications/Steam.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: Valve Corporation (MXGJJ98X76)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>2.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>The Unarchiver</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-06-04T10:55:49Z</date>
+ <key>obtained_from</key>
+ <string>mac_app_store</string>
+ <key>path</key>
+ <string>/Applications/The Unarchiver.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Apple Mac OS Application Signing</string>
+ <string>Apple Worldwide Developer Relations Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>4.2.2</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>net.downloadhelper.coapp</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-05-19T11:15:01Z</date>
+ <key>obtained_from</key>
+ <string>unknown</string>
+ <key>path</key>
+ <string>/Applications/net.downloadhelper.coapp.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>version</key>
+ <string>1.5.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>DEPNotify</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-04-20T00:33:00Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Applications/Utilities/DEPNotify.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: Orchard &amp; Grove Inc. (VRPY9KHGX6)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.1.5</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Dictionary</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-01-28T21:15:47Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/Applications/Dictionary.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>2.3.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>OverDrive Media Console</string>
+ <key>has64BitIntelCode</key>
+ <string>no</string>
+ <key>info</key>
+ <string>Version 1.2.0, © OverDrive Inc. 2014</string>
+ <key>lastModified</key>
+ <date>2020-01-28T03:47:44Z</date>
+ <key>obtained_from</key>
+ <string>unknown</string>
+ <key>path</key>
+ <string>/Applications/OverDrive Media Console.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>iPhone Developer: Dale Liao (JB4YN8TG6A)</string>
+ <string>Apple Worldwide Developer Relations Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>Version 1.2.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>HandBrake</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>2020010400</string>
+ <key>lastModified</key>
+ <date>2020-01-27T04:00:20Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Applications/HandBrake.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: Damiano Galassi (5X9DE89KYV)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.3.1</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>unetbootin</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>Created by Qt/QMake</string>
+ <key>lastModified</key>
+ <date>2019-10-01T02:29:00Z</date>
+ <key>obtained_from</key>
+ <string>unknown</string>
+ <key>path</key>
+ <string>/Applications/unetbootin.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Paintbrush</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-01-12T21:41:03Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Applications/Paintbrush.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: Michael Schreiber (G966ML7VBG)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>2.5</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Textual</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-10-30T00:23:24Z</date>
+ <key>obtained_from</key>
+ <string>mac_app_store</string>
+ <key>path</key>
+ <string>/Applications/Textual.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Apple Mac OS Application Signing</string>
+ <string>Apple Worldwide Developer Relations Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>6.0.12</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Double Shot</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-10-09T06:55:35Z</date>
+ <key>obtained_from</key>
+ <string>mac_app_store</string>
+ <key>path</key>
+ <string>/Applications/Double Shot.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Apple Mac OS Application Signing</string>
+ <string>Apple Worldwide Developer Relations Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0.2</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Blackmagic Disk Speed Test</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-10-08T05:35:19Z</date>
+ <key>obtained_from</key>
+ <string>mac_app_store</string>
+ <key>path</key>
+ <string>/Applications/Blackmagic Disk Speed Test.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Apple Mac OS Application Signing</string>
+ <string>Apple Worldwide Developer Relations Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>3.2</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Minecraft</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-07-16T13:50:25Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Applications/Minecraft.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: Mojang AB (HR992ZEAE6)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>777</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Getflix</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2017-10-23T14:16:56Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Applications/Getflix.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: Getflix Pty Ltd (K85VMRV9ZS)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.1</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Voice Memos</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-07-23T23:08:07Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/Applications/VoiceMemos.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>2.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Console</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-07-23T23:08:07Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/Applications/Utilities/Console.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.1</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Audio MIDI Setup</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>3.3, Copyright 2002-2017 Apple, Inc.</string>
+ <key>lastModified</key>
+ <date>2019-07-23T23:08:07Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/Applications/Utilities/Audio MIDI Setup.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>3.3</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Stocks</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-07-23T23:08:07Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/Applications/Stocks.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Home</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-07-23T23:08:07Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/Applications/Home.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>3.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Tunnelblick</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-07-23T10:26:51Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Applications/Tunnelblick.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: Jonathan Bullard (Z2SG5H3HC8)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>3.8.0 (build 5370)</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Managed Software Centre</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-07-09T22:39:27Z</date>
+ <key>obtained_from</key>
+ <string>unknown</string>
+ <key>path</key>
+ <string>/Applications/Managed Software Center.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>version</key>
+ <string>5.1.0.3774</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>TrackballWorks Uninstaller</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>1.5.0, (C)2010-2018 Kensington</string>
+ <key>lastModified</key>
+ <date>2019-05-14T06:42:12Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Applications/Utilities/TrackballWorks Uninstaller.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: Kensington Computer Products Group (293UQF7R4S)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.5.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Screenshot</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/Applications/Utilities/Screenshot.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Migration Assistant</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/Applications/Utilities/Migration Assistant.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>10.14</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Digital Colour Meter</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>5.13, © Copyright 2001-2018 Apple Inc. All Rights Reserved.</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/Applications/Utilities/Digital Color Meter.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>5.13</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Time Machine</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>1.3, Copyright 2007-2014 Apple Inc.</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/Applications/Time Machine.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.3</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>TextEdit</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/Applications/TextEdit.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.14</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Stickies</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/Applications/Stickies.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>10.2</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Siri</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>1.0, Copyright 2016 Apple Inc.</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/Applications/Siri.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Reminders</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/Applications/Reminders.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>6.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Photo Booth</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/Applications/Photo Booth.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>10.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Mission Control</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>1.2, Copyright 2007-2014 Apple Inc.</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/Applications/Mission Control.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.2</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Launchpad</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>1.0, Copyright 2010-2014 Apple Inc.</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/Applications/Launchpad.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Image Capture</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/Applications/Image Capture.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>8.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Dashboard</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>1.8, Copyright 2006-2014 Apple Inc.</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/Applications/Dashboard.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.8</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Chess</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>3.16, Copyright 2003-2017 Apple Inc.</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/Applications/Chess.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>3.16</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Automator</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/Applications/Automator.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>2.9</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Microsoft Teams</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>1.00.21761</string>
+ <key>lastModified</key>
+ <date>2019-02-14T04:14:52Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Applications/Microsoft Teams.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: Microsoft Corporation (UBF8T346G9)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.00.21761</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Android File Transfer</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2018-10-16T06:08:58Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Applications/Android File Transfer.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: Google, Inc. (EQHXZ8M8AV)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0.12</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>RipIt</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2016-06-12T06:20:47Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Applications/RipIt.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: The Little App Factory Pty. Ltd.</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.6.9</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>ControlPlane</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2017-03-25T03:35:52Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Applications/ControlPlane.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: Dustin Rue</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.6.6</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Blizzard Error</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>Blizzard Error 2.3.17.0, Copyright © 2011-2019 Blizzard Entertainment. All rights reserved.</string>
+ <key>lastModified</key>
+ <date>2020-06-22T05:26:44Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Users/Shared/Battle.net/Agent/Blizzard Error.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: Blizzard Entertainment, Inc. (G847MC6JZ5)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>2.3.17.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Agent</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>Blizzard File Switcher 2.20.1 (7093), Copyright © 2010-2019 Blizzard Entertainment. All rights reserved.</string>
+ <key>lastModified</key>
+ <date>2020-06-22T05:26:44Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Users/Shared/Battle.net/Agent/Agent.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: Blizzard Entertainment, Inc. (G847MC6JZ5)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>2.20.1 (7093)</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Agent</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>Blizzard Update Agent 2.20.1 (7093), Copyright © 2010-2019 Blizzard Entertainment. All rights reserved.</string>
+ <key>lastModified</key>
+ <date>2020-06-22T05:26:43Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Users/Shared/Battle.net/Agent/Agent.7093/Agent.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: Blizzard Entertainment, Inc. (G847MC6JZ5)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>2.20.1 (7093)</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Agent</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>Blizzard Update Agent 2.19.4 (7010), Copyright © 2010-2019 Blizzard Entertainment. All rights reserved.</string>
+ <key>lastModified</key>
+ <date>2020-04-01T20:24:12Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Users/Shared/Battle.net/Agent/Agent.7010/Agent.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: Blizzard Entertainment, Inc. (G847MC6JZ5)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>2.19.4 (7010)</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Brother HL-1210W series</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-03-28T17:47:29Z</date>
+ <key>obtained_from</key>
+ <string>unknown</string>
+ <key>path</key>
+ <string>/Users/ohaiuser/Library/Printers/Brother HL-1210W series.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>version</key>
+ <string>14.4</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>EPSON XP-220 Series</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2018-07-20T23:00:16Z</date>
+ <key>obtained_from</key>
+ <string>unknown</string>
+ <key>path</key>
+ <string>/Users/ohaiuser/Library/Printers/EPSON XP-220 Series.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>version</key>
+ <string>13.4</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>left dock</string>
+ <key>has64BitIntelCode</key>
+ <string>no</string>
+ <key>lastModified</key>
+ <date>2007-11-14T22:50:15Z</date>
+ <key>obtained_from</key>
+ <string>unknown</string>
+ <key>path</key>
+ <string>/Users/ohaiuser/Projects/applescripts/left dock.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Xperia Companion Updater</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2018-12-12T01:31:36Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Users/ohaiuser/Documents/Sony/Xperia Companion/autoupdate/Xperia Companion Updater.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: Sony Mobile Communications AB (LEG7PUMD84)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>2.4.3</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Start Screen Saver</string>
+ <key>has64BitIntelCode</key>
+ <string>no</string>
+ <key>lastModified</key>
+ <date>2008-09-29T16:40:25Z</date>
+ <key>obtained_from</key>
+ <string>unknown</string>
+ <key>path</key>
+ <string>/Users/ohaiuser/Documents/Start Screen Saver.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>RDOCK</string>
+ <key>has64BitIntelCode</key>
+ <string>no</string>
+ <key>lastModified</key>
+ <date>2007-11-14T22:50:43Z</date>
+ <key>obtained_from</key>
+ <string>unknown</string>
+ <key>path</key>
+ <string>/Users/ohaiuser/Documents/RDOCK.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>LDOCK</string>
+ <key>has64BitIntelCode</key>
+ <string>no</string>
+ <key>lastModified</key>
+ <date>2007-11-14T22:51:11Z</date>
+ <key>obtained_from</key>
+ <string>unknown</string>
+ <key>path</key>
+ <string>/Users/ohaiuser/Documents/LDOCK.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>FTL</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-08-26T03:59:41Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Users/ohaiuser/Library/Application Support/Steam/steamapps/common/FTL Faster Than Light/FTL.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: Subset Games, LLC (C6ATQ577CA)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.6.13</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>MRT</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-08-22T03:49:06Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/MRT.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.66</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>WebexAppLauncher</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-08-19T05:03:06Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Users/ohaiuser/Library/Application Support/WebEx Folder/T33_64UMC_40.8.6.2/WebexAppLauncher.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: Cisco (DE8Y96K9QP)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>40.4.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Cisco WebEx Start</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-08-19T05:03:02Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Users/ohaiuser/Library/Application Support/WebEx Folder/Add-ons/Cisco WebEx Start.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: Cisco (DE8Y96K9QP)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>9.40.0804</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Microsoft AutoUpdate</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-08-12T03:03:51Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: Microsoft Corporation (UBF8T346G9)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>4.26</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Acrobat Update Helper</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>1 . 0 . 20, ©2009-2015 Adobe Systems Incorporated. All rights reserved.</string>
+ <key>lastModified</key>
+ <date>2020-07-15T12:14:57Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Library/Application Support/Adobe/ARMDC/Application/Acrobat Update Helper.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: Adobe Systems, Inc. (JQ525L2MZD)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1 . 0 . 20</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Python Launcher 3</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>3.8.5, © 2001-2020 Python Software Foundation</string>
+ <key>lastModified</key>
+ <date>2020-07-20T13:26:22Z</date>
+ <key>obtained_from</key>
+ <string>unknown</string>
+ <key>path</key>
+ <string>/usr/local/Cellar/python@3.8/3.8.5/Python Launcher 3.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>version</key>
+ <string>3.8.5</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Python</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>3.8.5, (c) 2001-2020 Python Software Foundation.</string>
+ <key>lastModified</key>
+ <date>2020-07-20T13:26:22Z</date>
+ <key>obtained_from</key>
+ <string>unknown</string>
+ <key>path</key>
+ <string>/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/Resources/Python.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>version</key>
+ <string>3.8.5</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>WebexAppLauncher</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-30T03:37:45Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Users/ohaiuser/Library/Application Support/WebEx Folder/T33_64UMC_40.6.6.7/WebexAppLauncher.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: Cisco (DE8Y96K9QP)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>40.4.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>ARDAgent</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/RemoteManagement/ARDAgent.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>3.9.8</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>MiniTerm</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>Terminal window application for PPP</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/usr/libexec/MiniTerm.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.9</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>SpeechRecognitionServer</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/PrivateFrameworks/SpeechObjects.framework/Versions/A/SpeechRecognitionServer.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>8.5.2</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Speech Downloader</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/PrivateFrameworks/SpeechObjects.framework/Versions/A/SpeechDataInstallerd.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>8.5.2</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>SoftwareUpdateNotificationManager</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/PrivateFrameworks/SoftwareUpdate.framework/Versions/A/Resources/SoftwareUpdateNotificationManager.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>soagent</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/PrivateFrameworks/MessagesKit.framework/Versions/A/Resources/soagent.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>7.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>IMTransferAgent</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/PrivateFrameworks/IMTransferServices.framework/IMTransferAgent.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>10.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>IMAutomaticHistoryDeletionAgent</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/PrivateFrameworks/IMDPersistence.framework/IMAutomaticHistoryDeletionAgent.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>10.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>imagent</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/PrivateFrameworks/IMCore.framework/imagent.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>10.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>IDSRemoteURLConnectionAgent</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/PrivateFrameworks/IDSFoundation.framework/IDSRemoteURLConnectionAgent.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>10.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>identityservicesd</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/PrivateFrameworks/IDS.framework/identityservicesd.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>10.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>ParentalControls</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>2.0, Copyright Apple Inc. 2007-2009</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/PrivateFrameworks/FamilyControls.framework/Versions/A/Resources/ParentalControls.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>4.1</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>DiskImages UI Agent</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/PrivateFrameworks/DiskImages.framework/Versions/A/Resources/DiskImages UI Agent.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>480.260.1</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>storeuid</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/PrivateFrameworks/CommerceKit.framework/Versions/A/Resources/storeuid.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>LaterAgent</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/PrivateFrameworks/CommerceKit.framework/Versions/A/Resources/LaterAgent.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>iCloud Drive</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/PrivateFrameworks/CloudDocsDaemon.framework/Versions/A/Resources/iCloud Drive.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Calibration Assistant</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/PrivateFrameworks/AmbientDisplay.framework/Versions/A/Resources/Calibration Assistant.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>WebKitPluginHost</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/Frameworks/WebKit.framework/Versions/A/Frameworks/WebKitLegacy.framework/Versions/A/WebKitPluginHost.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>14607</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>QuickLookUIHelper</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>5.0, Copyright Apple Inc. 2007-2013</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/Frameworks/Quartz.framework/Versions/A/Frameworks/QuickLookUI.framework/Versions/A/Resources/QuickLookUIHelper.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>5.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Quick Look Simulator</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/Frameworks/Quartz.framework/Versions/A/Frameworks/QuickLookUI.framework/Versions/A/Resources/Quick Look Simulator.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Python</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>2.7.16, (c) 2001-2016 Python Software Foundation.</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>2.7.16</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>PrinterProxy</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Print.framework/Versions/A/Plugins/PrinterProxy.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>14.4</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>SpeechSynthesisServer</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>8.1.3</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/SpeechSynthesis.framework/Versions/A/SpeechSynthesisServer.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>8.1.3</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>FontRegistryUIAgent</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>Copyright © 2008-2013 Apple Inc.</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/Support/FontRegistryUIAgent.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>81.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>iCloud</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/iCloud.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Photos Agent</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/cloudphotosd.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>4.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>WiFiAgent</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>13.0, Copyright © 2012-2017 Apple Inc. All rights reserved.</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/WiFiAgent.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>13.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Stocks</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/Stocks.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Spotlight</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/Spotlight.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Software Update</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>Software Update version 4.0, Copyright © 2000-2009, Apple Inc. All rights reserved.</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/Software Update.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>6</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>ScreenSaverEngine</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/ScreenSaverEngine.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>5.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>ReportPanic</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/ReportPanic.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>10.13</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>SSMenuAgent</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/RemoteManagement/SSMenuAgent.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>3.9.8</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Problem Reporter</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/Problem Reporter.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>10.13</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Pass Viewer</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/Pass Viewer.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>OBEXAgent</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>6.0.14, Copyright © 2002-2019 Apple Inc. All rights reserved.</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/OBEXAgent.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>6.0.14</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Memory Slot Utility</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/Memory Slot Utility.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.5.3</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Language Chooser</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/Language Chooser.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Keychain Circle Notification</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/Keychain Circle Notification.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Installer Progress</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/Installer Progress.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Install in Progress</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/Install in Progress.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>3.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Games</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/Games.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Expansion Slot Utility</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/Expansion Slot Utility.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>2.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>CoreServicesUIAgent</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>Copyright © 2009 Apple Inc.</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/CoreServicesUIAgent.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>226</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>BluetoothUIServer</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>6.0.14, Copyright © 2002-2019 Apple Inc. All rights reserved.</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/BluetoothUIServer.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>6.0.14</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Bluetooth Set-up Assistant</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>6.0.14, Copyright © 2002-2019 Apple Inc. All rights reserved.</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/Bluetooth Setup Assistant.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>6.0.14</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>AirPlayUIAgent</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-17T01:11:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/AirPlayUIAgent.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>2.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Karabiner-Menu</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-07T07:15:03Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Library/Application Support/org.pqrs/Karabiner-Elements/Karabiner-Menu.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: Fumihiko Takayama (G43BCU2T37)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>12.10.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Karabiner-MultitouchExtension</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-07T07:15:03Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Library/Application Support/org.pqrs/Karabiner-Elements/Karabiner-MultitouchExtension.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: Fumihiko Takayama (G43BCU2T37)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>12.10.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Karabiner-NotificationWindow</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-07-07T07:15:03Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Library/Application Support/org.pqrs/Karabiner-Elements/Karabiner-NotificationWindow.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: Fumihiko Takayama (G43BCU2T37)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>12.10.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Battle.net Helper</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>Battle.net Helper 1.0 © 2012-2020 Blizzard Entertainment. All rights reserved.</string>
+ <key>lastModified</key>
+ <date>2020-06-22T05:27:02Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Users/ohaiuser/Library/Application Support/Battle.net/Versions/Battle.net.12040/battle.net-core.framework/Frameworks/Battle.net Helper.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: Blizzard Entertainment, Inc. (G847MC6JZ5)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0.0.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Battle.net</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>Blizzard Battle.net App 1.22.0, © 2012-2020 Blizzard Entertainment. All rights reserved.</string>
+ <key>lastModified</key>
+ <date>2020-06-22T05:27:01Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Users/ohaiuser/Library/Application Support/Battle.net/Versions/Battle.net.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: Blizzard Entertainment, Inc. (G847MC6JZ5)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.22.0.12040</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>MobileDeviceUpdater</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-05-24T00:55:28Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/Resources/MobileDeviceUpdater.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>AppleMobileDeviceHelper</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-05-24T00:55:28Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/AppleMobileDeviceHelper.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>5.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>AppleMobileSync</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-05-24T00:55:28Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/AppleMobileSync.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>5.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>NativeMessagingHost</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-05-13T01:42:37Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Library/Application Support/Adobe/WebExtnUtils/DC_Reader/NativeMessagingHost.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: Adobe Systems, Inc. (JQ525L2MZD)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>3.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>NativeMessagingHost</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-05-13T01:42:37Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Library/Application Support/Adobe/WebExtnUtils/NativeMessagingHost.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: Adobe Systems, Inc. (JQ525L2MZD)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>3.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Install iGlasses</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-05-11T06:22:52Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Library/Application Support/iGlasses3/Install iGlasses.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: Ecamm Network, LLC (5EJH68M642)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>Ecamm iGlasses v3.5.2 Installer</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Battle.net Helper</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>Battle.net Helper 1.0 © 2012-2020 Blizzard Entertainment. All rights reserved.</string>
+ <key>lastModified</key>
+ <date>2020-04-01T18:24:22Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Users/ohaiuser/Library/Application Support/Battle.net/Versions/Battle.net.11943/battle.net-core.framework/Frameworks/Battle.net Helper.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: Blizzard Entertainment, Inc. (G847MC6JZ5)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0.0.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>screencaptureui</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2020-01-28T21:15:47Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/screencaptureui.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Python</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>2.7.17, (c) 2001-2016 Python Software Foundation.</string>
+ <key>lastModified</key>
+ <date>2019-10-19T18:58:51Z</date>
+ <key>obtained_from</key>
+ <string>unknown</string>
+ <key>path</key>
+ <string>/usr/local/Cellar/python@2/2.7.17_1/Frameworks/Python.framework/Versions/2.7/Resources/Python.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>version</key>
+ <string>2.7.17</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Python Launcher</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>2.7.17, © 2001-2019 Python Software Foundation</string>
+ <key>lastModified</key>
+ <date>2019-10-19T18:58:51Z</date>
+ <key>obtained_from</key>
+ <string>unknown</string>
+ <key>path</key>
+ <string>/usr/local/Cellar/python@2/2.7.17_1/Python Launcher.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>version</key>
+ <string>2.7.17</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Steam Helper</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-11-13T07:00:18Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Users/ohaiuser/Library/Application Support/Steam/Steam.AppBundle/Steam/Contents/MacOS/Frameworks/Steam Helper.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: Valve Corporation (MXGJJ98X76)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>31.0.1650.57</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Steam Helper EH</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-11-13T07:00:18Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Users/ohaiuser/Library/Application Support/Steam/Steam.AppBundle/Steam/Contents/MacOS/Frameworks/Steam Helper EH.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: Valve Corporation (MXGJJ98X76)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>31.0.1650.57</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>HTML5App</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-11-13T07:00:18Z</date>
+ <key>obtained_from</key>
+ <string>unknown</string>
+ <key>path</key>
+ <string>/Users/ohaiuser/Library/Application Support/Steam/Steam.AppBundle/Steam/Contents/MacOS/Frameworks/HTML5App.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: Valve Corporation (MXGJJ98X76)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0.0.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Crash Reporter</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-11-13T07:00:18Z</date>
+ <key>obtained_from</key>
+ <string>unknown</string>
+ <key>path</key>
+ <string>/Users/ohaiuser/Library/Application Support/Steam/Steam.AppBundle/Steam/Contents/MacOS/Frameworks/Breakpad.framework/Versions/A/Resources/crash_report_sender.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>version</key>
+ <string>1.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>DropboxMacUpdate</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-07-30T12:25:33Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Users/ohaiuser/Library/Dropbox/DropboxMacUpdate.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: Dropbox, Inc. (G7HH3F8CAK)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>78.4.119</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>ScreenReaderUIServer</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-07-23T23:08:07Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/PrivateFrameworks/ScreenReader.framework/Versions/A/Resources/ScreenReaderUIServer.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>9</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Family</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-07-23T23:08:07Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/PrivateFrameworks/FamilyNotification.framework/Versions/A/Resources/Family.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>FollowUpUI</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-07-23T23:08:07Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/PrivateFrameworks/CoreFollowUp.framework/Versions/A/Resources/FollowUpUI.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>CIMFindInputCodeTool</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-07-23T23:08:07Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/PrivateFrameworks/CoreChineseEngine.framework/Versions/A/SharedSupport/CIMFindInputCodeTool.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>102</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>AOSPushRelay</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-07-23T23:08:07Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/PrivateFrameworks/AOSKit.framework/Versions/A/Helpers/AOSPushRelay.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.07</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>AOSHeartbeat</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-07-23T23:08:07Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/PrivateFrameworks/AOSKit.framework/Versions/A/Helpers/AOSHeartbeat.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.07</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>AOSAlertManager</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-07-23T23:08:07Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/PrivateFrameworks/AOSKit.framework/Versions/A/Helpers/AOSAlertManager.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.07</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>TrackpadIM</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-07-23T23:08:07Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/Input Methods/TrackpadIM.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>TCIM</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-07-23T23:08:07Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/Input Methods/TCIM.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>SCIM</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-07-23T23:08:07Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/Input Methods/SCIM.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>EmojiFunctionRowIM</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-07-23T23:08:07Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/Input Methods/EmojiFunctionRowIM.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>AirScanScanner</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-07-23T23:08:07Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/Image Capture/Devices/AirScanScanner.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>14.4</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>quicklookd32</string>
+ <key>has64BitIntelCode</key>
+ <string>no</string>
+ <key>info</key>
+ <string>5.0, Copyright Apple Inc. 2007-2013</string>
+ <key>lastModified</key>
+ <date>2019-07-23T23:08:07Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/Frameworks/QuickLook.framework/Versions/A/Resources/quicklookd32.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>5.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Widget Simulator</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-07-23T23:08:07Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/Frameworks/NotificationCenter.framework/Versions/A/Resources/Widget Simulator.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>AddressBookSync</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-07-23T23:08:07Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/Frameworks/AddressBook.framework/Versions/A/Helpers/AddressBookSync.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>11.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>AddressBookSourceSync</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-07-23T23:08:07Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/Frameworks/AddressBook.framework/Versions/A/Helpers/AddressBookSourceSync.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>11.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>AddressBookManager</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-07-23T23:08:07Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/Frameworks/AddressBook.framework/Versions/A/Helpers/AddressBookManager.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>11.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>ABAssistantService</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-07-23T23:08:07Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/Frameworks/AddressBook.framework/Versions/A/Helpers/ABAssistantService.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>11.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>VoiceOver</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-07-23T23:08:07Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/VoiceOver.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>9</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>UIKitSystem</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-07-23T23:08:07Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/UIKitSystem.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>SystemUIServer</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>SystemUIServer version 1.7, Copyright 2000-2010 Apple Computer, Inc.</string>
+ <key>lastModified</key>
+ <date>2019-07-23T23:08:07Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/SystemUIServer.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.7</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>RapportUIAgent</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-07-23T23:08:07Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/RapportUIAgent.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.7</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Paired Devices</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-07-23T23:08:07Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/Paired Devices.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.7</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>PIPAgent</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-07-23T23:08:07Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/PIPAgent.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>OSDUIHelper</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-07-23T23:08:07Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/OSDUIHelper.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>NowPlayingWidgetContainer</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-07-23T23:08:07Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/NowPlayingWidgetContainer.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>NowPlayingTouchUI</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-07-23T23:08:07Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/NowPlayingTouchUI.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Notification Centre</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-07-23T23:08:07Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/NotificationCenter.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Install Command Line Developer Tools</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-07-23T23:08:07Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/Install Command Line Developer Tools.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>CoreLocationAgent</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>Copyright © 2013 Apple Inc.</string>
+ <key>lastModified</key>
+ <date>2019-07-23T23:08:07Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/CoreLocationAgent.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1486.12</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>AddressBookUrlForwarder</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-07-23T23:08:07Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/AddressBookUrlForwarder.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>11.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>AVB Audio Configuration</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-07-23T23:08:07Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/AVB Audio Configuration.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Summary Service</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>Summary Service Version 2</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/Services/SummaryService.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>2.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>ChineseTextConverterService</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>Chinese Text Converter 1.1</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/Services/ChineseTextConverterService.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>2.1</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>UASharedPasteboardProgressUI</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/PrivateFrameworks/UserActivity.framework/Agents/UASharedPasteboardProgressUI.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>54.1</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>UniversalAccessHUD</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/PrivateFrameworks/UniversalAccess.framework/Versions/A/Resources/UniversalAccessHUD.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>DFRHUD</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/PrivateFrameworks/UniversalAccess.framework/Versions/A/Resources/DFRHUD.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Conflict Resolver</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>1.0, Copyright Apple Computer Inc. 2004</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/PrivateFrameworks/SyncServicesUI.framework/Versions/A/Resources/Conflict Resolver.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>8.1</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>STMUIHelper</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/PrivateFrameworks/StorageManagement.framework/Versions/A/Resources/STMUIHelper.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>PubSubAgent</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/PrivateFrameworks/PubSub.framework/Versions/A/Resources/PubSubAgent.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0.5</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>nbagent</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/PrivateFrameworks/Noticeboard.framework/Versions/A/Resources/nbagent.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>FindMyMacMessenger</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/PrivateFrameworks/FindMyMac.framework/Versions/A/Resources/FindMyMacMessenger.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>4.1</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>eaptlstrust</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/PrivateFrameworks/EAP8021X.framework/Support/eaptlstrust.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>13.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>AskPermissionUI</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/PrivateFrameworks/AskPermission.framework/Versions/A/Resources/AskPermissionUI.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>AccessibilityVisualsAgent</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/PrivateFrameworks/AccessibilitySupport.framework/Versions/A/Resources/AccessibilityVisualsAgent.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>iCloudUserNotificationsd</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/PrivateFrameworks/AOSAccounts.framework/Versions/A/Resources/iCloudUserNotificationsd.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>TamilIM</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>Tamil Input Method 1.5</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/Input Methods/TamilIM.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.6</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>PressAndHold</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/Input Methods/PressAndHold.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>PluginIM</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/Input Methods/PluginIM.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>18.15.1</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>KeyboardViewer</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>2.0, Copyright © 2004-2009 Apple Inc., All Rights Reserved</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/Input Methods/KeyboardViewer.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>3.2</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>InkServer</string>
+ <key>has64BitIntelCode</key>
+ <string>no</string>
+ <key>info</key>
+ <string>10.9, Copyright 2012 Apple Inc.</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/Input Methods/InkServer.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>10.9</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>HindiIM</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/Input Methods/HindiIM.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Dictation</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/Input Methods/DictationIM.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>5.0.7</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>AinuIM</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/Input Methods/AinuIM.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>50onPaletteServer</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/Input Methods/50onPaletteServer.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.1.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>AutoImporter</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/Image Capture/Support/Application/AutoImporter.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>6.7</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>VirtualScanner</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/Image Capture/Devices/VirtualScanner.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>4.1</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Type4Camera</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>10.1, © Copyright 2001-2014 Apple Inc. All rights reserved.</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/Image Capture/Devices/Type4Camera.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>10.1</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>PTPCamera</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>10.1, © Copyright 2004-2014 Apple Inc., all rights reserved.</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/Image Capture/Devices/PTPCamera.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>10.1</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>MassStorageCamera</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>10.1, © Copyright 2000-2014 Apple Inc. All rights reserved.</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/Image Capture/Devices/MassStorageCamera.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>10.1</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>MakePDF</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>10.1, © Copyright 2003-2015 Apple Inc. All rights reserved.</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/Image Capture/Automatic Tasks/MakePDF.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>10.1</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Build Webpage</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>10.1, © Copyright 2003-2014 Apple Inc. All rights reserved.</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/Image Capture/Automatic Tasks/Build Web Page.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>10.1</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Wish</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>Wish Shell 8.5.9,
+Copyright © 1989-2019 Tcl Core Team,
+Copyright © 2002-2019 Daniel A. Steffen,
+Copyright © 2001-2009 Apple Inc.,
+Copyright © 2001-2002 Jim Ingham &amp; Ian Reid</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/Frameworks/Tk.framework/Versions/8.5/Resources/Wish.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>8.5.9</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>SyncServer</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>© 2002-2003 Apple</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/Frameworks/SyncServices.framework/Versions/A/Resources/SyncServer.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>8.1</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>rcd</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>354</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/rcd.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>354</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Weather</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/Weather.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>UserNotificationCenter</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/UserNotificationCenter.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>3.3.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>UnmountAssistantAgent</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/UnmountAssistantAgent.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>5.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>UniversalAccessControl</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/UniversalAccessControl.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>7.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Ticket Viewer</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/Ticket Viewer.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>4.1</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>ThermalTrap</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/ThermalTrap.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>System Events</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/System Events.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.3.6</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>SocialPushAgent</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/SocialPushAgent.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>61</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>ScriptMonitor</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/ScriptMonitor.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0.1</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Script Menu</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/Script Menu.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>RegisterPluginIMApp</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/RegisterPluginIMApp.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>18.15.1</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>PowerChime</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/PowerChime.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>ODSAgent</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>1.8 (180.8), Copyright © 2007-2009 Apple Inc. All Rights Reserved.</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/ODSAgent.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.8</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>NetAuthAgent</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/NetAuthAgent.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>6.2</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>LocationMenu</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/LocationMenu.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>KeyboardSetupAssistant</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/KeyboardSetupAssistant.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>10.7</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Java Web Start</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/Java Web Start.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>15.0.1</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Jar Launcher</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/Jar Launcher.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>15.0.1</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Image Events</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/Image Events.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.1.6</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>FolderActionsDispatcher</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/FolderActionsDispatcher.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>EscrowSecurityAlert</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/EscrowSecurityAlert.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Dwell Control</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/Dwell Control.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>DiscHelper</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/DiscHelper.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Database Events</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/Database Events.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0.6</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Captive Network Assistant</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/Captive Network Assistant.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>5.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>CalendarFileHandler</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/CalendarFileHandler.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>8.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Automator Installer</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/Automator Installer.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>2.9</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>AppleScript Utility</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/AppleScript Utility.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.1.2</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>AppleGraphicsWarning</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>Version 2.3.0, Copyright Apple Inc., 2008-2014</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/AppleGraphicsWarning.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>2.3.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>AppleFileServer</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/AppleFileServer.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>2.1</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Display Calibrator</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>4.11.0, Copyright 2018 Apple, Inc.</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/ColorSync/Calibrators/Display Calibrator.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>4.11.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Show Info</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/Library/Scripts/ColorSync/Show Info.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Set Info</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/Library/Scripts/ColorSync/Set Info.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Rename</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/Library/Scripts/ColorSync/Rename.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Remove</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/Library/Scripts/ColorSync/Remove.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Proof</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/Library/Scripts/ColorSync/Proof.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Match</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/Library/Scripts/ColorSync/Match.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Extract</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/Library/Scripts/ColorSync/Extract.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Embed</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/Library/Scripts/ColorSync/Embed.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>AirScanLegacyDiscovery</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/Library/Image Capture/Support/LegacyDeviceDiscoveryHelpers/AirScanLegacyDiscovery.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>14.4</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Cocoa-AppleScript Applet</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-05-14T00:21:12Z</date>
+ <key>obtained_from</key>
+ <string>unknown</string>
+ <key>path</key>
+ <string>/Library/Application Support/Script Editor/Templates/Cocoa-AppleScript Applet.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>version</key>
+ <string>1.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Google Hangouts</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2019-03-06T09:42:35Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Users/ohaiuser/Library/Application Support/Google/Chrome/Default/Web Applications/_crx_knipolnnllmklapflnccelgolnpehhpl/Default knipolnnllmklapflnccelgolnpehhpl.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: Google, Inc. (EQHXZ8M8AV)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>2019.301.1416.1</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Android File Transfer Agent</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2018-10-16T06:08:58Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Users/ohaiuser/Library/Application Support/Google/Android File Transfer/Android File Transfer Agent.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: Google, Inc. (EQHXZ8M8AV)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.0.507.1136</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Fax Receive Monitor</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>1.71, Copyright(C) Seiko Epson Corporation 2009-2015. All rights reserved.</string>
+ <key>lastModified</key>
+ <date>2015-08-19T15:00:00Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Library/Printers/EPSON/Fax/Utility/Fax Receive Monitor.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: EPSON (TXAEAV5RN4)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.71</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>FAX Utility</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>1.73, Copyright(C) Seiko Epson Corporation 2009-2015. All rights reserved.</string>
+ <key>lastModified</key>
+ <date>2015-08-19T15:00:00Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Library/Printers/EPSON/Fax/Utility/FAX Utility.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: EPSON (TXAEAV5RN4)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.73</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>rastertoepfax</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>Copyright(C) Seiko Epson Corporation 2009-2015. All rights reserved.</string>
+ <key>lastModified</key>
+ <date>2015-08-19T15:00:00Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Library/Printers/EPSON/Fax/Filter/rastertoepfax.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: EPSON (TXAEAV5RN4)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.71</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>commandFilter</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>Copyright(C) Seiko Epson Corporation 2012-2015. All rights reserved.</string>
+ <key>lastModified</key>
+ <date>2015-08-19T15:00:00Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Library/Printers/EPSON/Fax/Filter/commandFilter.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: EPSON (TXAEAV5RN4)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.71</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>epsonfax</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>Copyright(C) Seiko Epson Corporation 2009-2015. All rights reserved.</string>
+ <key>lastModified</key>
+ <date>2015-08-19T15:00:00Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Library/Printers/EPSON/Fax/FaxIOSupport/epsonfax.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: EPSON (TXAEAV5RN4)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.71</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>EPFaxAutoSetupTool</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>Copyright(C) Seiko Epson Corporation 2009-2015. All rights reserved.</string>
+ <key>lastModified</key>
+ <date>2015-08-19T15:00:00Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Library/Printers/EPSON/Fax/AutoSetupTool/EPFaxAutoSetupTool.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: EPSON (TXAEAV5RN4)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>1.71</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Epson Printer Utility Lite</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>Epson Printer Utility Lite version 9.80</string>
+ <key>lastModified</key>
+ <date>2018-07-24T05:16:40Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Library/Printers/EPSON/InkjetPrinter2/Utility/UTL/Epson Printer Utility Lite.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: EPSON (TXAEAV5RN4)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>9.80</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Epson Printer Utility 4</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>Epson Printer Utility 4 version 9.80</string>
+ <key>lastModified</key>
+ <date>2018-07-24T05:16:40Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Library/Printers/EPSON/InkjetPrinter2/Utility/UT4/Epson Printer Utility 4.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: EPSON (TXAEAV5RN4)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>9.80</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>rastertoescpII</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>rastertoescpII Copyright(C) Seiko Epson Corporation 2001-2016. All rights reserved.</string>
+ <key>lastModified</key>
+ <date>2018-07-24T05:16:40Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Library/Printers/EPSON/InkjetPrinter2/Filter/rastertoescpII.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: EPSON (TXAEAV5RN4)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>9.80</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>pdftopdf2</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>pdftopdf2 version 9.80, Copyright(C) Seiko Epson Corporation 2001-2016. All rights reserved.</string>
+ <key>lastModified</key>
+ <date>2018-07-24T05:16:40Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Library/Printers/EPSON/InkjetPrinter2/Filter/pdftopdf2.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: EPSON (TXAEAV5RN4)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>9.80</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>commandtoescp</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>commandtoescp Copyright(C) Seiko Epson Corporation 2001-2016. All rights reserved.</string>
+ <key>lastModified</key>
+ <date>2018-07-24T05:16:40Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Library/Printers/EPSON/InkjetPrinter2/Filter/commandtoescp.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: EPSON (TXAEAV5RN4)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>9.80</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>EPIJAutoSetupTool2</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>EPIJAutoSetupTool2 Copyright(C) Seiko Epson Corporation 2001-2016. All rights reserved.</string>
+ <key>lastModified</key>
+ <date>2018-07-24T05:16:40Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Library/Printers/EPSON/InkjetPrinter2/AutoSetupTool/EPIJAutoSetupTool2.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: EPSON (TXAEAV5RN4)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>9.80</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Brother Scanner</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>2.9.0, © 2007-2016 Brother Industries, Ltd. All Rights Reserved.</string>
+ <key>lastModified</key>
+ <date>2018-07-22T04:45:03Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Library/Image Capture/Devices/Brother Scanner.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: Brother Industries, LTD.</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>2.9.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Canon IJScanner6</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>Canon IJScanner6 version 4.0.0, Copyright CANON INC. 2009-2014</string>
+ <key>lastModified</key>
+ <date>2014-06-26T03:00:00Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Library/Image Capture/Devices/Canon IJScanner6.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: Canon Inc. (XE2XNRRXZ5)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>4.0.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Canon IJScanner4</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>Canon IJScanner4 version 4.0.0, Copyright CANON INC. 2009-2014</string>
+ <key>lastModified</key>
+ <date>2014-06-26T03:00:00Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Library/Image Capture/Devices/Canon IJScanner4.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: Canon Inc. (XE2XNRRXZ5)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>4.0.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>Canon IJScanner2</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>Canon IJScanner2 version 4.0.0, Copyright CANON INC. 2009-2014</string>
+ <key>lastModified</key>
+ <date>2014-06-26T03:00:00Z</date>
+ <key>obtained_from</key>
+ <string>identified_developer</string>
+ <key>path</key>
+ <string>/Library/Image Capture/Devices/Canon IJScanner2.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Developer ID Application: Canon Inc. (XE2XNRRXZ5)</string>
+ <string>Developer ID Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>4.0.0</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>AirPort Base Station Agent</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>info</key>
+ <string>2.2.1 (221.6), Copyright © 2006-2013 Apple Inc. All Rights Reserved.</string>
+ <key>lastModified</key>
+ <date>2018-08-18T01:52:46Z</date>
+ <key>obtained_from</key>
+ <string>apple</string>
+ <key>path</key>
+ <string>/System/Library/CoreServices/AirPort Base Station Agent.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>signed_by</key>
+ <array>
+ <string>Software Signing</string>
+ <string>Apple Code Signing Certification Authority</string>
+ <string>Apple Root CA</string>
+ </array>
+ <key>version</key>
+ <string>2.2.1</string>
+ </dict>
+ <dict>
+ <key>_name</key>
+ <string>terminal-notifier</string>
+ <key>has64BitIntelCode</key>
+ <string>yes</string>
+ <key>lastModified</key>
+ <date>2017-11-01T16:25:40Z</date>
+ <key>obtained_from</key>
+ <string>unknown</string>
+ <key>path</key>
+ <string>/usr/local/Cellar/terminal-notifier/2.0.0/terminal-notifier.app</string>
+ <key>runtime_environment</key>
+ <string>arch_x86</string>
+ <key>version</key>
+ <string>2.0.0</string>
+ </dict>
+ </array>
+ <key>_parentDataType</key>
+ <string>SPSoftwareDataType</string>
+ <key>_properties</key>
+ <dict>
+ <key>_name</key>
+ <dict>
+ <key>_isColumn</key>
+ <string>YES</string>
+ <key>_order</key>
+ <string>0</string>
+ </dict>
+ <key>has64BitIntelCode</key>
+ <dict>
+ <key>_isColumn</key>
+ <string>YES</string>
+ <key>_order</key>
+ <string>40</string>
+ </dict>
+ <key>lastModified</key>
+ <dict>
+ <key>_isColumn</key>
+ <string>YES</string>
+ <key>_order</key>
+ <string>20</string>
+ </dict>
+ <key>obtained_from</key>
+ <dict>
+ <key>_isColumn</key>
+ <string>YES</string>
+ <key>_order</key>
+ <string>15</string>
+ </dict>
+ <key>path</key>
+ <dict>
+ <key>_order</key>
+ <string>90</string>
+ </dict>
+ <key>runtime_environment</key>
+ <dict>
+ <key>_order</key>
+ <string>30</string>
+ </dict>
+ <key>signed_by</key>
+ <dict>
+ <key>_order</key>
+ <string>60</string>
+ </dict>
+ <key>version</key>
+ <dict>
+ <key>_isColumn</key>
+ <string>YES</string>
+ <key>_order</key>
+ <string>10</string>
+ </dict>
+ <key>volumes</key>
+ <dict>
+ <key>_detailLevel</key>
+ <string>0</string>
+ </dict>
+ </dict>
+ <key>_timeStamp</key>
+ <date>2020-09-04T06:20:47Z</date>
+ <key>_versionInfo</key>
+ <dict>
+ <key>com.apple.SystemProfiler.SPApplicationsReporter</key>
+ <string>915</string>
+ </dict>
+ </dict>
+</array>
+</plist>
diff --git a/spec/functional/application_spec.rb b/spec/functional/application_spec.rb
index 5370c92c..26199a05 100644
--- a/spec/functional/application_spec.rb
+++ b/spec/functional/application_spec.rb
@@ -1,6 +1,6 @@
#
# Author:: Claire McQuin <claire@chef.io>
-# Copyright:: Copyright (c) 2015-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/spec/functional/loader_spec.rb b/spec/functional/loader_spec.rb
index 02ba673f..c6bdcde1 100644
--- a/spec/functional/loader_spec.rb
+++ b/spec/functional/loader_spec.rb
@@ -1,5 +1,5 @@
#
-# Copyright:: Copyright (c) 2015-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/spec/functional/plugins/linux/interrupts_spec.rb b/spec/functional/plugins/linux/interrupts_spec.rb
index 22306cb7..64863586 100644
--- a/spec/functional/plugins/linux/interrupts_spec.rb
+++ b/spec/functional/plugins/linux/interrupts_spec.rb
@@ -26,7 +26,7 @@ describe Ohai::System, "Linux interrupts plugin" do
end
it "parses smp_affinity (partial mask, all)" do
- allow(::File).to receive(:read).with("/affinity").and_return("f")
+ allow(plugin).to receive(:file_read).with("/affinity").and_return("f")
expect(plugin.parse_smp_affinity("/affinity", 2)).to eq({
0 => true,
1 => true,
@@ -34,7 +34,7 @@ describe Ohai::System, "Linux interrupts plugin" do
end
it "parses smp_affinity (partial mask, one)" do
- allow(::File).to receive(:read).with("/affinity").and_return("e")
+ allow(plugin).to receive(:file_read).with("/affinity").and_return("e")
expect(plugin.parse_smp_affinity("/affinity", 2)).to eq({
0 => false,
1 => true,
@@ -42,7 +42,7 @@ describe Ohai::System, "Linux interrupts plugin" do
end
it "parses smp_affinity (full mask, all)" do
- allow(::File).to receive(:read).with("/affinity").and_return("ff")
+ allow(plugin).to receive(:file_read).with("/affinity").and_return("ff")
expect(plugin.parse_smp_affinity("/affinity", 2)).to eq({
0 => true,
1 => true,
@@ -50,7 +50,7 @@ describe Ohai::System, "Linux interrupts plugin" do
end
it "parses smp_affinity (full mask, one)" do
- allow(::File).to receive(:read).with("/affinity").and_return("fe")
+ allow(plugin).to receive(:file_read).with("/affinity").and_return("fe")
expect(plugin.parse_smp_affinity("/affinity", 2)).to eq({
0 => false,
1 => true,
@@ -62,7 +62,7 @@ describe Ohai::System, "Linux interrupts plugin" do
(0..47).each do |i|
cpus[i] = true
end
- allow(::File).to receive(:read).with("/affinity")
+ allow(plugin).to receive(:file_read).with("/affinity")
.and_return("ffff,ffffffff")
expect(plugin.parse_smp_affinity("/affinity", 48)).to eq(cpus)
end
@@ -74,7 +74,7 @@ describe Ohai::System, "Linux interrupts plugin" do
end
cpus[12] = false
cpus[32] = false
- allow(::File).to receive(:read).with("/affinity")
+ allow(plugin).to receive(:file_read).with("/affinity")
.and_return("fffe,ffffefff")
expect(plugin.parse_smp_affinity("/affinity", 48)).to eq(cpus)
end
diff --git a/spec/functional/plugins/powershell_spec.rb b/spec/functional/plugins/powershell_spec.rb
index c9e12a9a..b9e99c5d 100644
--- a/spec/functional/plugins/powershell_spec.rb
+++ b/spec/functional/plugins/powershell_spec.rb
@@ -1,5 +1,5 @@
#
-# Copyright:: Copyright (c) 2014-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
#
# License:: Apache License, Version 2.0
#
@@ -19,7 +19,7 @@
require "spec_helper"
describe Ohai::System, "languages plugin" do
- VERSION_MATCHING_REGEX = /^(?:[\d]+\.)+[\d]+$/.freeze
+ VERSION_MATCHING_REGEX = /^(?:\d+\.)+\d+$/.freeze
describe "powershell plugin", :windows_only do
RSpec.shared_examples "a version looking thing" do
it "is present" do
diff --git a/spec/functional/plugins/root_group_spec.rb b/spec/functional/plugins/root_group_spec.rb
index be0cb9dd..a49eea0d 100644
--- a/spec/functional/plugins/root_group_spec.rb
+++ b/spec/functional/plugins/root_group_spec.rb
@@ -1,7 +1,7 @@
#
# Author:: Adam Edwards (<adamed@chef.io>)
#
-# Copyright:: Copyright (c) 2014-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
#
# License:: Apache License, Version 2.0
#
diff --git a/spec/functional/plugins/windows/uptime_spec.rb b/spec/functional/plugins/windows/uptime_spec.rb
index 6b28caed..09ee8bac 100644
--- a/spec/functional/plugins/windows/uptime_spec.rb
+++ b/spec/functional/plugins/windows/uptime_spec.rb
@@ -1,6 +1,6 @@
#
# Author:: Aliasgar Batterywala (<aliasgar.batterywala@msystechnologies.com>)
-# Copyright:: Copyright (c) 2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/spec/ohai_spec.rb b/spec/ohai_spec.rb
index c2701e76..909f8f6b 100644
--- a/spec/ohai_spec.rb
+++ b/spec/ohai_spec.rb
@@ -1,6 +1,6 @@
#
# Author:: Adam Jacob (<adam@chef.io>)
-# Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 0eaf93fb..e409e031 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -3,8 +3,8 @@ require "rspec/collection_matchers"
# require 'pry-debugger'
# require 'pry-stack_explorer'
-$:.unshift(File.expand_path("../..", __FILE__))
-$:.unshift(File.dirname(__FILE__) + "/../lib")
+$:.unshift(File.expand_path("..", __dir__))
+$:.unshift(__dir__ + "/../lib")
require "spec/support/platform_helpers"
require "spec/support/integration_helper"
@@ -12,8 +12,8 @@ require "wmi-lite"
require "ohai"
Ohai.config[:log_level] = :error
-PLUGIN_PATH = File.expand_path("../../lib/ohai/plugins", __FILE__)
-SPEC_PLUGIN_PATH = File.expand_path("../data/plugins", __FILE__)
+PLUGIN_PATH = File.expand_path("../lib/ohai/plugins", __dir__)
+SPEC_PLUGIN_PATH = File.expand_path("data/plugins", __dir__)
RSpec.configure do |config|
config.before { @object_pristine = Object.clone }
@@ -22,10 +22,6 @@ end
include Ohai::Mixin::ConstantHelper
-if Ohai::Mixin::OS.collect_os == /mswin|mingw32|windows/
- ENV["PATH"] = ""
-end
-
def get_plugin(plugin, ohai = Ohai::System.new, path = PLUGIN_PATH)
loader = Ohai::Loader.new(ohai)
loader.load_plugin(File.join(path, "#{plugin}.rb"))
@@ -50,7 +46,7 @@ def it_should_check_from_mash(plugin, attribute, from, value)
it "sets the #{plugin}[:#{attribute}] to the value from '#{from}'" do
@plugin.run
- expect(@plugin[plugin][attribute]).to eq(value[1].split($/)[0])
+ expect(@plugin[plugin][attribute]).to eq(value[1].strip)
end
end
@@ -71,7 +67,7 @@ def it_should_check_from_deep_mash(plugin, mash, attribute, from, value)
it "sets the #{mash.inspect}[:#{attribute}] to the value from '#{from}'" do
@plugin.run
- value = value[1].split($/)[0]
+ value = value[1].strip
if mash.is_a?(String)
expect(@plugin[mash][attribute]).to eq(value)
elsif mash.is_a?(Array)
diff --git a/spec/support/platform_helpers.rb b/spec/support/platform_helpers.rb
index 2a531883..01df9626 100644
--- a/spec/support/platform_helpers.rb
+++ b/spec/support/platform_helpers.rb
@@ -23,16 +23,4 @@ def unix?
!windows?
end
-def os_x?
- !!(RUBY_PLATFORM =~ /darwin/)
-end
-
-def solaris?
- !!(RUBY_PLATFORM =~ /solaris/)
-end
-
-def freebsd?
- !!(RUBY_PLATFORM =~ /freebsd/)
-end
-
DEV_NULL = windows? ? "NUL" : "/dev/null"
diff --git a/spec/unit/application_spec.rb b/spec/unit/application_spec.rb
index e38ad827..4895b184 100644
--- a/spec/unit/application_spec.rb
+++ b/spec/unit/application_spec.rb
@@ -1,6 +1,6 @@
#
# Author:: Claire McQuin <claire@chef.io>
-# Copyright:: Copyright (c) 2015-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/spec/unit/config_spec.rb b/spec/unit/config_spec.rb
index b78dc5c4..1d0dc0d2 100644
--- a/spec/unit/config_spec.rb
+++ b/spec/unit/config_spec.rb
@@ -1,6 +1,6 @@
#
# Author:: Claire McQuin (<claire@chef.io>)
-# Copyright:: Copyright (c) 2015-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/spec/unit/dsl/plugin_spec.rb b/spec/unit/dsl/plugin_spec.rb
index 31a1cbcc..d6d4956c 100644
--- a/spec/unit/dsl/plugin_spec.rb
+++ b/spec/unit/dsl/plugin_spec.rb
@@ -1,6 +1,6 @@
#
# Author:: Claire McQuin (<claire@chef.io>)
-# Copyright:: Copyright (c) 2013-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License"); you
@@ -521,7 +521,7 @@ describe Ohai::DSL::Plugin::VersionVII do
it "fails a platform has already been defined in the same plugin" do
Ohai.plugin(:Test) { collect_data {} }
- expect(Ohai::Log).to receive(:warn).with(/collect_data already defined on platform/).twice
+ expect(Ohai::Log).to receive(:warn).with(/collect_data already defined on os/).twice
Ohai.plugin(:Test) do
collect_data {}
collect_data {}
@@ -530,7 +530,7 @@ describe Ohai::DSL::Plugin::VersionVII do
it "fails if a platform has already been defined in another plugin file" do
Ohai.plugin(:Test) { collect_data {} }
- expect(Ohai::Log).to receive(:warn).with(/collect_data already defined on platform/)
+ expect(Ohai::Log).to receive(:warn).with(/collect_data already defined on os/)
Ohai.plugin(:Test) do
collect_data {}
end
diff --git a/spec/unit/hints_spec.rb b/spec/unit/hints_spec.rb
index 2296e810..6839673b 100644
--- a/spec/unit/hints_spec.rb
+++ b/spec/unit/hints_spec.rb
@@ -1,6 +1,6 @@
#
# Author:: Serdar Sutay (<serdar@chef.io>)
-# Copyright:: Copyright (c) 2013-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/spec/unit/loader_spec.rb b/spec/unit/loader_spec.rb
index 4315138e..d7915bd3 100644
--- a/spec/unit/loader_spec.rb
+++ b/spec/unit/loader_spec.rb
@@ -1,6 +1,6 @@
#
# Author:: Claire McQuin (<claire@chef.io>)
-# Copyright:: Copyright (c) 2013-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -130,7 +130,7 @@ describe Ohai::Loader do
describe "when the plugin defines collect_data on the same platform more than once" do
it "shoud log an illegal plugin definition warning" do
- expect(Ohai::Log).to receive(:warn).with(/collect_data already defined on platform/)
+ expect(Ohai::Log).to receive(:warn).with(/collect_data already defined on os/)
loader.load_plugin(path_to("illegal_def.rb"))
end
diff --git a/spec/unit/mixin/azure_metadata_spec.rb b/spec/unit/mixin/azure_metadata_spec.rb
index 4165211e..21e6febe 100644
--- a/spec/unit/mixin/azure_metadata_spec.rb
+++ b/spec/unit/mixin/azure_metadata_spec.rb
@@ -1,6 +1,6 @@
#
# Author:: Tim Smith <tsmith@chef.io>
-# Copyright:: 2017-2020 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/spec/unit/mixin/command_spec.rb b/spec/unit/mixin/command_spec.rb
deleted file mode 100644
index b0b9fd26..00000000
--- a/spec/unit/mixin/command_spec.rb
+++ /dev/null
@@ -1,151 +0,0 @@
-# encoding: utf-8
-#
-# Author:: Diego Algorta (diego@oboxodo.com)
-# Copyright:: Copyright (c) 2009 Diego Algorta
-# License:: Apache License, Version 2.0
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-require "spec_helper"
-
-describe Ohai::Mixin::Command, "shell_out" do
- let(:cmd) { "sparkle-dream --version" }
-
- let(:shell_out) { double("Mixlib::ShellOut") }
-
- let(:plugin_name) { :OSSparkleDream }
-
- let(:options) { windows? ? { timeout: 30 } : { timeout: 30, env: { "PATH" => "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" } } }
-
- let(:logger) { instance_double("Mixlib::Log::Child", trace: nil, debug: nil, warn: nil) }
-
- before do
- allow(described_class).to receive(:logger).and_return(logger)
- allow(described_class).to receive(:name).and_return(plugin_name)
- @original_env = ENV.to_hash
- ENV.clear
- end
-
- after do
- ENV.clear
- ENV.update(@original_env)
- end
-
- describe "when the command runs" do
- it "logs the command and exitstatus" do
- expect(Mixlib::ShellOut)
- .to receive(:new)
- .with(cmd, options)
- .and_return(shell_out)
-
- expect(shell_out)
- .to receive(:run_command)
-
- expect(shell_out)
- .to receive(:exitstatus)
- .and_return(256)
-
- expect(logger).to receive(:trace)
- .with("Plugin OSSparkleDream: ran 'sparkle-dream --version' and returned 256")
-
- described_class.shell_out(cmd)
- end
- end
-
- describe "when the command does not exist" do
- it "logs the command and error message" do
- expect(Mixlib::ShellOut)
- .to receive(:new)
- .with(cmd, options)
- .and_return(shell_out)
-
- expect(shell_out)
- .to receive(:run_command)
- .and_raise(Errno::ENOENT, "sparkle-dream")
-
- expect(logger)
- .to receive(:trace)
- .with("Plugin OSSparkleDream: ran 'sparkle-dream --version' and failed " \
- "#<Errno::ENOENT: No such file or directory - sparkle-dream>")
-
- expect { described_class.shell_out(cmd) }
- .to raise_error(Ohai::Exceptions::Exec)
- end
- end
-
- describe "when the command times out" do
- it "logs the command an timeout error message" do
- expect(Mixlib::ShellOut)
- .to receive(:new)
- .with(cmd, options)
- .and_return(shell_out)
-
- expect(shell_out)
- .to receive(:run_command)
- .and_raise(Mixlib::ShellOut::CommandTimeout)
-
- expect(logger)
- .to receive(:trace)
- .with("Plugin OSSparkleDream: ran 'sparkle-dream --version' and timed " \
- "out after 30 seconds")
-
- expect { described_class.shell_out(cmd) }
- .to raise_error(Ohai::Exceptions::Exec)
- end
- end
-
- describe "when a timeout option is provided" do
- let(:options) { windows? ? { timeout: 10 } : { timeout: 10, env: { "PATH" => "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" } } }
-
- it "runs the command with the provided timeout" do
- expect(Mixlib::ShellOut)
- .to receive(:new)
- .with(cmd, options)
- .and_return(shell_out)
-
- expect(shell_out)
- .to receive(:run_command)
-
- expect(shell_out)
- .to receive(:exitstatus)
- .and_return(256)
-
- expect(logger).to receive(:trace)
- .with("Plugin OSSparkleDream: ran 'sparkle-dream --version' and returned 256")
-
- described_class.shell_out(cmd, options)
- end
-
- describe "when the command times out" do
- it "logs the command an timeout error message" do
- expect(Mixlib::ShellOut)
- .to receive(:new)
- .with(cmd, options)
- .and_return(shell_out)
-
- expect(shell_out)
- .to receive(:run_command)
- .and_raise(Mixlib::ShellOut::CommandTimeout)
-
- expect(logger)
- .to receive(:trace)
- .with("Plugin OSSparkleDream: ran 'sparkle-dream --version' and timed " \
- "out after 10 seconds")
-
- expect { described_class.shell_out(cmd, options) }
- .to raise_error(Ohai::Exceptions::Exec)
- end
- end
- end
-end
diff --git a/spec/unit/mixin/dmi_decode_spec.rb b/spec/unit/mixin/dmi_decode_spec.rb
index fc9968d6..656bc721 100644
--- a/spec/unit/mixin/dmi_decode_spec.rb
+++ b/spec/unit/mixin/dmi_decode_spec.rb
@@ -1,6 +1,6 @@
#
# Author:: Tim Smith (tsmith@chef.io)
-# Copyright:: Copyright (c) 2018 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -38,7 +38,7 @@ describe Ohai::Mixin::DmiDecode, "guest_from_dmi_data" do
}.each_pair do |hypervisor, values|
describe "when passed #{hypervisor} dmi data" do
it "returns '#{hypervisor}'" do
- expect(mixin.guest_from_dmi_data(values[0], values[1], values[2])).to eq("#{hypervisor}")
+ expect(mixin.guest_from_dmi_data(values[0], values[1], values[2])).to eq(hypervisor.to_s)
end
end
end
diff --git a/spec/unit/mixin/ec2_metadata_spec.rb b/spec/unit/mixin/ec2_metadata_spec.rb
index 89c3a5c7..fd53208b 100644
--- a/spec/unit/mixin/ec2_metadata_spec.rb
+++ b/spec/unit/mixin/ec2_metadata_spec.rb
@@ -1,6 +1,6 @@
#
# Author:: Bryan McLellan <btm@loftninjas.org>
-# Copyright:: Copyright (c) 2013-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/spec/unit/mixin/shell_out_spec.rb b/spec/unit/mixin/shell_out_spec.rb
new file mode 100644
index 00000000..7d08d9ff
--- /dev/null
+++ b/spec/unit/mixin/shell_out_spec.rb
@@ -0,0 +1,132 @@
+#
+# Author:: Diego Algorta (diego@oboxodo.com)
+# Copyright:: Copyright (c) 2009 Diego Algorta
+# License:: Apache License, Version 2.0
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+require "spec_helper"
+
+describe Ohai::Mixin::ShellOut, "shell_out" do
+ let(:cmd) { "sparkle-dream --version" }
+
+ let(:shell_out) { double("Mixlib::ShellOut", live_stream: nil, :live_stream= => nil) }
+
+ let(:plugin_name) { :OSSparkleDream }
+
+ let(:timeout) { 30 }
+
+ let(:options) do
+ path_var = windows? ? "Path" : "PATH"
+
+ # this just replicates the behavior of default_paths in chef-utils
+ split_path = instance.send(:__env_path).split(File::PATH_SEPARATOR)
+ default_paths = [ RbConfig::CONFIG["bindir"], Gem.bindir, split_path ].flatten.compact.uniq
+
+ if windows?
+ default_paths = default_paths.join(";")
+ else
+ default_paths = ( default_paths + [ "/usr/local/sbin", "/usr/local/bin", "/usr/sbin", "/usr/bin", "/sbin", "/bin" ] ).compact.uniq.join(":")
+ end
+
+ default_locale = ChefConfig::Config.guess_internal_locale
+ {
+ timeout: timeout,
+ environment: {
+ "LANG" => default_locale,
+ "LANGUAGE" => default_locale,
+ "LC_ALL" => default_locale,
+ path_var => default_paths,
+ },
+ }
+ end
+
+ let(:logger) { instance_double("Mixlib::Log::Child", trace: nil, debug: nil, warn: nil, trace?: false, debug?: false) }
+
+ class DummyPlugin
+ include Ohai::Mixin::ShellOut
+ def transport_connection
+ nil
+ end
+ end
+
+ let(:instance) { DummyPlugin.new }
+
+ before do
+ allow(instance).to receive(:logger).and_return(logger)
+ allow(instance).to receive(:name).and_return(plugin_name)
+ @original_env = ENV.to_hash
+ ENV.clear
+ end
+
+ after do
+ ENV.clear
+ ENV.update(@original_env)
+ end
+
+ describe "when the command runs" do
+ it "logs the command and exitstatus" do
+ expect(Mixlib::ShellOut).to receive(:new).with(cmd, options).and_return(shell_out)
+ expect(shell_out).to receive(:run_command)
+ expect(shell_out).to receive(:exitstatus).and_return(256)
+ expect(logger).to receive(:trace)
+ .with("Plugin OSSparkleDream: ran 'sparkle-dream --version' and returned 256")
+ instance.shell_out(cmd)
+ end
+ end
+
+ describe "when the command does not exist" do
+ it "logs the command and error message" do
+ expect(Mixlib::ShellOut).to receive(:new).with(cmd, options).and_return(shell_out)
+ expect(shell_out).to receive(:run_command).and_raise(Errno::ENOENT, "sparkle-dream")
+ expect(logger).to receive(:trace)
+ .with("Plugin OSSparkleDream: ran 'sparkle-dream --version' and failed " \
+ "#<Errno::ENOENT: No such file or directory - sparkle-dream>")
+ expect { instance.shell_out(cmd) }.to raise_error(Ohai::Exceptions::Exec)
+ end
+ end
+
+ describe "when the command times out" do
+ it "logs the command an timeout error message" do
+ expect(Mixlib::ShellOut).to receive(:new).with(cmd, options).and_return(shell_out)
+ expect(shell_out).to receive(:run_command).and_raise(Mixlib::ShellOut::CommandTimeout)
+ expect(logger).to receive(:trace)
+ .with("Plugin OSSparkleDream: ran 'sparkle-dream --version' and timed out after 30 seconds")
+ expect { instance.shell_out(cmd) }.to raise_error(Ohai::Exceptions::Exec)
+ end
+ end
+
+ describe "when a timeout option is provided" do
+ let(:timeout) { 10 }
+
+ it "runs the command with the provided timeout" do
+ expect(Mixlib::ShellOut).to receive(:new).with(cmd, options).and_return(shell_out)
+ expect(shell_out).to receive(:run_command)
+ expect(shell_out).to receive(:exitstatus).and_return(256)
+ expect(logger).to receive(:trace)
+ .with("Plugin OSSparkleDream: ran 'sparkle-dream --version' and returned 256")
+ instance.shell_out(cmd, timeout: 10)
+ end
+
+ describe "when the command times out" do
+ it "logs the command an timeout error message" do
+ expect(Mixlib::ShellOut).to receive(:new).with(cmd, options).and_return(shell_out)
+ expect(shell_out).to receive(:run_command).and_raise(Mixlib::ShellOut::CommandTimeout)
+ expect(logger).to receive(:trace)
+ .with("Plugin OSSparkleDream: ran 'sparkle-dream --version' and timed out after 10 seconds")
+ expect { instance.shell_out(cmd, timeout: 10) }.to raise_error(Ohai::Exceptions::Exec)
+ end
+ end
+ end
+end
diff --git a/spec/unit/util/file_helper_spec.rb b/spec/unit/mixin/which_spec.rb
index 8fc542f0..c1d4c661 100644
--- a/spec/unit/util/file_helper_spec.rb
+++ b/spec/unit/mixin/which_spec.rb
@@ -1,6 +1,6 @@
# Author:: Bryan McLellan <btm@loftninjas.org>
#
-# Copyright:: Copyright (c) 2014-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
#
# License:: Apache License, Version 2.0
#
@@ -17,16 +17,19 @@
# limitations under the License.
require "spec_helper"
-require "ohai/util/file_helper"
class FileHelperMock
- include Ohai::Util::FileHelper
+ include Ohai::Mixin::Which
+ def transport_connection
+ nil
+ end
end
-describe "Ohai::Util::FileHelper" do
+describe "Ohai::Mixin::Which" do
let(:file_helper) { FileHelperMock.new }
before do
+ Ohai::Mixin::ChefUtilsWiring::PathCache.instance.path_cache = "/usr/bin"
allow(file_helper).to receive(:name).and_return("Fakeclass")
logger = instance_double("Mixlib::Log::Child", trace: nil, debug: nil, warn: nil)
allow(file_helper).to receive(:logger).and_return(logger)
@@ -36,7 +39,6 @@ describe "Ohai::Util::FileHelper" do
describe "which" do
it "returns the path to an executable that is in the path" do
allow(File).to receive(:executable?).with("/usr/bin/skyhawk").and_return(true)
-
expect(file_helper.which("skyhawk")).to eql "/usr/bin/skyhawk"
end
diff --git a/spec/unit/plugin_config_spec.rb b/spec/unit/plugin_config_spec.rb
index 96b826a2..d38aa5f6 100644
--- a/spec/unit/plugin_config_spec.rb
+++ b/spec/unit/plugin_config_spec.rb
@@ -1,5 +1,5 @@
#
-# Copyright:: Copyright (c) 2015-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/spec/unit/plugins/abort_spec.rb b/spec/unit/plugins/abort_spec.rb
index 68531eb1..247aa7cb 100644
--- a/spec/unit/plugins/abort_spec.rb
+++ b/spec/unit/plugins/abort_spec.rb
@@ -1,6 +1,6 @@
#
# Author:: Salim Alam (salam@chef.io)
-# Copyright:: Copyright (c) 2015 Chef Software Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -34,7 +34,7 @@ describe "a plug-in that aborts execution" do
Dir.mkdir("#{tmp}/plugins")
rescue Errno::EEXIST
- # ignore
+ # ignore
end
@@ -52,7 +52,7 @@ describe "a plug-in that aborts execution" do
Dir.delete("#{tmp}/plugins")
rescue
- # ignore
+ # ignore
end
diff --git a/spec/unit/plugins/aix/cpu_spec.rb b/spec/unit/plugins/aix/cpu_spec.rb
index 146534e2..9654537f 100644
--- a/spec/unit/plugins/aix/cpu_spec.rb
+++ b/spec/unit/plugins/aix/cpu_spec.rb
@@ -1,7 +1,7 @@
#
# Author:: Prabhu Das (<prabhu.das@clogeny.com>)
# Author:: Isa Farnik (<isa@chef.io>)
-# Copyright:: Copyright (c) 2013-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/spec/unit/plugins/aix/filesystem_spec.rb b/spec/unit/plugins/aix/filesystem_spec.rb
index 87358b3c..02bec7fb 100644
--- a/spec/unit/plugins/aix/filesystem_spec.rb
+++ b/spec/unit/plugins/aix/filesystem_spec.rb
@@ -1,7 +1,7 @@
#
# Author:: Prabhu Das (<prabhu.das@clogeny.com>)
# Author:: Isa Farnik (<isa@chef.io>)
-# Copyright:: Copyright (c) 2013-2020 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -98,7 +98,6 @@ describe Ohai::System, "AIX filesystem plugin" do
end
describe "df -Pk" do
-
it "returns the filesystem block size" do
expect(@plugin[:filesystem]["by_pair"]["/dev/hd4,/"]["kb_size"]).to eq("2097152")
expect(@plugin[:filesystem2]["by_pair"]["/dev/hd4,/"]["kb_size"]).to eq("2097152")
@@ -126,7 +125,6 @@ describe Ohai::System, "AIX filesystem plugin" do
end
describe "mount" do
-
it "returns the filesystem mount location" do
expect(@plugin[:filesystem]["by_pair"]["/dev/hd4,/"]["mount"]).to eq("/")
expect(@plugin[:filesystem2]["by_pair"]["/dev/hd4,/"]["mount"]).to eq("/")
@@ -144,7 +142,6 @@ describe Ohai::System, "AIX filesystem plugin" do
# For entries like 192.168.1.11 /stage/middleware1 /stage/middleware2 nfs3 Jul 17 13:24 ro,bg,hard,intr,sec=sys
context "having node values" do
-
it "returns the filesystem mount location" do
expect(@plugin[:filesystem]["by_pair"]["192.168.1.11:/stage/middleware1,/stage/middleware2"]["mount"]).to eq("/stage/middleware2")
expect(@plugin[:filesystem2]["by_pair"]["192.168.1.11:/stage/middleware1,/stage/middleware2"]["mount"]).to eq("/stage/middleware2")
@@ -171,7 +168,6 @@ describe Ohai::System, "AIX filesystem plugin" do
end
describe "df -Pk" do
-
it "returns the filesystem block size" do
expect(@plugin[:filesystem]["by_pair"]["Global:/,/"]["kb_size"]).to eq("10485760")
expect(@plugin[:filesystem2]["by_pair"]["Global:/,/"]["kb_size"]).to eq("10485760")
@@ -199,7 +195,6 @@ describe Ohai::System, "AIX filesystem plugin" do
end
describe "mount" do
-
it "returns the filesystem mount location" do
expect(@plugin[:filesystem]["by_pair"]["Global:/,/"]["mount"]).to eq("/")
expect(@plugin[:filesystem2]["by_pair"]["Global:/,/"]["mount"]).to eq("/")
@@ -217,7 +212,6 @@ describe Ohai::System, "AIX filesystem plugin" do
# For entries like 192.168.1.11 /stage/middleware3 /stage/middleware4 nfs3 Jul 17 13:24 ro,bg,hard,intr,sec=sys
context "having node values" do
-
it "returns the filesystem mount location" do
expect(@plugin[:filesystem]["by_pair"]["192.168.1.11:/stage/middleware3,/stage/middleware4"]["mount"]).to eq("/stage/middleware4")
expect(@plugin[:filesystem2]["by_pair"]["192.168.1.11:/stage/middleware3,/stage/middleware4"]["mount"]).to eq("/stage/middleware4")
diff --git a/spec/unit/plugins/aix/hostname_spec.rb b/spec/unit/plugins/aix/hostname_spec.rb
index 0fcfcc5e..efa462d4 100644
--- a/spec/unit/plugins/aix/hostname_spec.rb
+++ b/spec/unit/plugins/aix/hostname_spec.rb
@@ -1,7 +1,7 @@
#
# Author:: Prabhu Das (<prabhu.das@clogeny.com>)
# Author:: Isa Farnik (<isa@chef.io>)
-# Copyright:: Copyright (c) 2013-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -22,6 +22,7 @@ describe Ohai::System, "AIX hostname plugin" do
before do
@plugin = get_plugin("hostname")
allow(@plugin).to receive(:collect_os).and_return(:aix)
+ allow(@plugin).to receive(:resolve_fqdn).and_return("katie.bethell")
allow(@plugin).to receive(:from_cmd).with("hostname -s").and_return("aix_admin")
allow(@plugin).to receive(:from_cmd).with("hostname").and_return("aix_admin.ponyville.com")
@plugin.run
diff --git a/spec/unit/plugins/aix/kernel_spec.rb b/spec/unit/plugins/aix/kernel_spec.rb
index c9138bc8..741d986c 100644
--- a/spec/unit/plugins/aix/kernel_spec.rb
+++ b/spec/unit/plugins/aix/kernel_spec.rb
@@ -1,7 +1,7 @@
#
# Author:: Prabhu Das (<prabhu.das@clogeny.com>)
# Author:: Isa Farnik (<isa@chef.io>)
-# Copyright:: Copyright (c) 2013-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -22,10 +22,7 @@ describe Ohai::System, "AIX kernel plugin" do
before do
@plugin = get_plugin("aix/kernel")
allow(@plugin).to receive(:collect_os).and_return(:aix)
- allow(@plugin).to receive(:shell_out).with("uname -s").and_return(mock_shell_out(0, "AIX", nil))
- allow(@plugin).to receive(:shell_out).with("uname -r").and_return(mock_shell_out(0, "1", nil))
- allow(@plugin).to receive(:shell_out).with("uname -v").and_return(mock_shell_out(0, "6", nil))
- allow(@plugin).to receive(:shell_out).with("uname -p").and_return(mock_shell_out(0, "powerpc", nil))
+ allow(@plugin).to receive(:shell_out).with("uname -rvp").and_return(mock_shell_out(0, "2 7 powerpc", nil))
allow(@plugin).to receive(:shell_out).with("genkex -d").and_return(mock_shell_out(0, " Text address Size Data address Size File\nf1000000c0338000 77000 f1000000c0390000 1ec8c /usr/lib/drivers/cluster\n 6390000 20000 63a0000 ba8 /usr/lib/drivers/if_en", nil))
allow(@plugin).to receive(:shell_out).with("getconf KERNEL_BITMODE").and_return(mock_shell_out(0, "64", nil))
@plugin.run
@@ -36,11 +33,11 @@ describe Ohai::System, "AIX kernel plugin" do
end
it "uname -r detects the release" do
- expect(@plugin[:kernel][:release]).to eq("1")
+ expect(@plugin[:kernel][:release]).to eq("2")
end
it "uname -v detects the version" do
- expect(@plugin[:kernel][:version]).to eq("6")
+ expect(@plugin[:kernel][:version]).to eq("7")
end
it "uname -p detects the machine" do
@@ -56,6 +53,5 @@ describe Ohai::System, "AIX kernel plugin" do
expect(@plugin[:kernel][:modules]["/usr/lib/drivers/cluster"]["data"]).to eq({ "address" => "f1000000c0390000", "size" => "1ec8c" })
expect(@plugin[:kernel][:modules]["/usr/lib/drivers/if_en"]["text"]).to eq({ "address" => "6390000", "size" => "20000" })
expect(@plugin[:kernel][:modules]["/usr/lib/drivers/if_en"]["data"]).to eq({ "address" => "63a0000", "size" => "ba8" })
-
end
end
diff --git a/spec/unit/plugins/aix/memory_spec.rb b/spec/unit/plugins/aix/memory_spec.rb
index e5b86b61..c518a621 100644
--- a/spec/unit/plugins/aix/memory_spec.rb
+++ b/spec/unit/plugins/aix/memory_spec.rb
@@ -1,6 +1,6 @@
#
# Author:: Isa Farnik (<isa@chef.io>)
-# Copyright:: Copyright (c) 2013-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -22,28 +22,28 @@ describe Ohai::System, "AIX memory plugin" do
before do
@plugin = get_plugin("aix/memory")
allow(@plugin).to receive(:collect_os).and_return(:aix)
- allow(@plugin).to receive(:shell_out).with("svmon -G -O unit=MB,summary=longreal | grep '[0-9]'").and_return(mock_shell_out(0, " 513280.00 340034.17 173245.83 62535.17 230400.05 276950.14 70176.00\n", nil))
+ allow(@plugin).to receive(:shell_out).with("svmon -G -O unit=KB,summary=longreal | grep '[0-9]'").and_return(mock_shell_out(0, " 25165824 7255120 17910704 4507712 4913152 19409452 1572864\n", nil))
@swap_s = "allocated = 23887872 blocks used = 288912 blocks free = 23598960 blocks\n"
allow(@plugin).to receive(:shell_out).with("swap -s").and_return(mock_shell_out(0, @swap_s, nil))
end
it "gets total memory" do
@plugin.run
- expect(@plugin["memory"]["total"]).to eql("#{513280 * 1024}kB")
+ expect(@plugin["memory"]["total"]).to eql("25165824kB")
end
it "gets free memory" do
@plugin.run
- expect(@plugin["memory"]["free"]).to eql("#{173245.83.to_i * 1024}kB")
+ expect(@plugin["memory"]["free"]).to eql("17910704kB")
end
it "gets total swap" do
@plugin.run
- expect(@plugin["memory"]["swap"]["total"]).to eql( "#{23887872 * 4}kB")
+ expect(@plugin["memory"]["swap"]["total"]).to eql( "95551488kB")
end
it "gets free swap" do
@plugin.run
- expect(@plugin["memory"]["swap"]["free"]).to eql( "#{23598960 * 4}kB")
+ expect(@plugin["memory"]["swap"]["free"]).to eql( "94395840kB")
end
end
diff --git a/spec/unit/plugins/aix/network_spec.rb b/spec/unit/plugins/aix/network_spec.rb
index e96db800..af944160 100644
--- a/spec/unit/plugins/aix/network_spec.rb
+++ b/spec/unit/plugins/aix/network_spec.rb
@@ -1,7 +1,7 @@
#
# Author:: Prabhu Das (<prabhu.das@clogeny.com>)
# Author:: Isa Farnik (<isa@chef.io>)
-# Copyright:: Copyright (c) 2013-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -19,11 +19,22 @@
require "spec_helper"
describe Ohai::System, "AIX network plugin" do
-
before do
- @netstat_rn_grep_default = <<~NETSTAT_RN_GREP_DEFAULT
- default 172.31.8.1 UG 2 121789 en0 - -
- NETSTAT_RN_GREP_DEFAULT
+ @netstat_rn = <<~NETSTAT_RN
+ Destination Gateway Flags Refcnt Use Interface
+ Destination Gateway Flags Refs Use If Exp Groups
+ Only the root user can specify the Z flag
+ (Internet):
+ default 172.31.0.1 UG 2 1652046 en0 - - =>
+ 127/8 127.0.0.1 U 5 2455591 lo0 - - =>
+ 172.31.0.0 172.31.10.23 UHSb 0 0 en0 - - =>
+ 172.31/20 172.31.10.23 U 1 1015674 en0 - - =>
+ 172.31.10.23 127.0.0.1 UGHS 0 1 lo0 - -
+ 172.31.15.255 172.31.10.23 UHSb 0 1 en0 - - =>
+ Only the root user can specify the Z flag
+ (Internet v6):
+ ::1%1 ::1%1 UH 1 677032 lo0 - - =>
+ NETSTAT_RN
@ifconfig = <<~IFCONFIG
en0: flags=1e080863,480<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,CHECKSUM_OFFLOAD(ACTIVE),CHAIN> metric 1
@@ -50,6 +61,120 @@ describe Ohai::System, "AIX network plugin" do
172.29.191.255 172.29.174.58 UHSb 0 1 en0 - -
NETSTAT_NRF_INET
+ @entstat = <<~ENTSTAT
+ -------------------------------------------------------------
+ ETHERNET STATISTICS (en0) :
+ Device Type: Virtual I/O Ethernet Adapter (l-lan)
+ Hardware Address: 62:c5:1c:3a:5d:03
+ Elapsed Time: 141 days 2 hours 15 minutes 31 seconds
+
+ Transmit Statistics: Receive Statistics:
+ -------------------- -------------------
+ Packets: 34322371 Packets: 116444596
+ Bytes: 2746892822 Bytes: 122798204927
+ Interrupts: 0 Interrupts: 72980222
+ Transmit Errors: 0 Receive Errors: 0
+ Packets Dropped: 0 Packets Dropped: 0
+ Bad Packets: 0
+ Max Packets on S/W Transmit Queue: 0
+ S/W Transmit Queue Overflow: 0
+ Current S/W+H/W Transmit Queue Length: 0
+
+ Broadcast Packets: 11 Broadcast Packets: 25084677
+ Multicast Packets: 2 Multicast Packets: 0
+ No Carrier Sense: 0 CRC Errors: 0
+ DMA Underrun: 0 DMA Overrun: 0
+ Lost CTS Errors: 0 Alignment Errors: 0
+ Max Collision Errors: 0 No Resource Errors: 0
+ Late Collision Errors: 0 Receive Collision Errors: 0
+ Deferred: 0 Packet Too Short Errors: 0
+ SQE Test: 0 Packet Too Long Errors: 0
+ Timeout Errors: 0 Packets Discarded by Adapter: 0
+ Single Collision Count: 0 Receiver Start Count: 0
+ Multiple Collision Count: 0
+ Current HW Transmit Queue Length: 0
+
+ General Statistics:
+ -------------------
+ No mbuf Errors: 0
+ Adapter Reset Count: 0
+ Adapter Data Rate: 20000
+ Driver Flags: Up Broadcast Running
+ Simplex 64BitSupport ChecksumOffload
+ DataRateSet VIOENT
+
+ Virtual I/O Ethernet Adapter (l-lan) Specific Statistics:
+ ---------------------------------------------------------
+ RQ Length: 4545
+ Trunk Adapter: False
+ Filter MCast Mode: False
+ Filters: 255
+ Enabled: 1 Queued: 0 Overflow: 0
+ LAN State: Operational
+
+ LPAR Active Memory Sharing: Disabled
+
+ Hypervisor Send Failures: 0
+ Receiver Failures: 0
+ Send Errors: 0
+ Hypervisor Receive Failures: 0
+
+ Invalid VLAN ID Packets: 0
+
+ ILLAN Attributes: 0000000000003002 [0000000000002000]
+
+ Port VLAN ID: 1
+ VLAN Tag IDs: None
+
+
+ Switch ID: ETHERNET0
+
+ Hypervisor Information
+ Virtual Memory
+ Total (KB) 80
+ I/O Memory
+ VRM Minimum (KB) 100
+ VRM Desired (KB) 100
+ DMA Max Min (KB) 128
+
+ Transmit Information
+ Transmit Buffers
+ Buffer Size 65536
+ Buffers 32
+ History
+ No Buffers 0
+ Virtual Memory
+ Total (KB) 2048
+ I/O Memory
+ VRM Minimum (KB) 2176
+ VRM Desired (KB) 16384
+ DMA Max Min (KB) 16384
+
+ Receive Information
+ Receive Buffers
+ Buffer Type Tiny Small Medium Large Huge
+ Min Buffers 2048 2048 256 64 64
+ Max Buffers 2048 2048 256 64 64
+ Allocated 2048 2048 256 64 64
+ Registered 2048 2048 256 64 64
+ History
+ Max Allocated 2048 2048 256 64 64
+ Lowest Registered 2047 1849 256 64 64
+ Virtual Memory
+ Minimum (KB) 1024 4096 4096 2048 4096
+ Maximum (KB) 1024 4096 4096 2048 4096
+ I/O Memory
+ VRM Minimum (KB) 16384 16384 5120 2304 4352
+ VRM Desired (KB) 16384 16384 5120 2304 4352
+ DMA Max Min (KB) 16384 16384 8192 4096 8192
+ Buffer Mode: Max Min
+
+ I/O Memory Information
+ Total VRM Minimum (KB) 46820
+ Total VRM Desired (KB) 61028
+ Total DMA Max Min (KB) 69760
+ ENTSTAT
+
@entstat_err = <<~ENSTAT_ERR
@@ -78,11 +203,11 @@ describe Ohai::System, "AIX network plugin" do
allow(@plugin).to receive(:collect_os).and_return(:aix)
@plugin[:network] = Mash.new
allow(@plugin).to receive(:shell_out).with("uname -W").and_return(mock_shell_out(0, "0", nil))
- allow(@plugin).to receive(:shell_out).with("netstat -rn |grep default").and_return(mock_shell_out(0, @netstat_rn_grep_default, nil))
+ allow(@plugin).to receive(:shell_out).with("netstat -rn").and_return(mock_shell_out(0, @netstat_rn, nil))
allow(@plugin).to receive(:shell_out).with("ifconfig -a").and_return(mock_shell_out(0, @ifconfig, nil))
- allow(@plugin).to receive(:shell_out).with("entstat -d en0 | grep \"Hardware Address\"").and_return(mock_shell_out(0, "Hardware Address: be:42:80:00:b0:05", nil))
- allow(@plugin).to receive(:shell_out).with("entstat -d en1 | grep \"Hardware Address\"").and_return(mock_shell_out(0, @entstat_err, nil))
- allow(@plugin).to receive(:shell_out).with("entstat -d lo0 | grep \"Hardware Address\"").and_return(mock_shell_out(0, @entstat_err, nil))
+ allow(@plugin).to receive(:shell_out).with("entstat -d en0").and_return(mock_shell_out(0, @entstat, nil))
+ allow(@plugin).to receive(:shell_out).with("entstat -d en1").and_return(mock_shell_out(0, @entstat_err, nil))
+ allow(@plugin).to receive(:shell_out).with("entstat -d lo0").and_return(mock_shell_out(0, @entstat_err, nil))
allow(@plugin).to receive(:shell_out).with("netstat -nrf inet").and_return(mock_shell_out(0, @netstat_nrf_inet, nil))
allow(@plugin).to receive(:shell_out).with("netstat -nrf inet6").and_return(mock_shell_out(0, "::1%1 ::1%1 UH 1 109392 en0 - -", nil))
allow(@plugin).to receive(:shell_out).with("arp -an").and_return(mock_shell_out(0, @aix_arp_an, nil))
@@ -107,24 +232,23 @@ describe Ohai::System, "AIX network plugin" do
end
describe "when running on an LPAR" do
-
describe "sets the top-level attribute correctly" do
before do
@plugin.run
end
it "for 'macaddress'" do
- expect(@plugin[:macaddress]).to eq("BE:42:80:00:B0:05")
+ expect(@plugin[:macaddress]).to eq("62:C5:1C:3A:5D:03")
end
end
- describe "netstat -rn |grep default" do
+ describe "netstat -rn" do
before do
@plugin.run
end
it "returns the default gateway of the system's network" do
- expect(@plugin[:network][:default_gateway]).to eq("172.31.8.1")
+ expect(@plugin[:network][:default_gateway]).to eq("172.31.0.1")
end
it "returns the default interface of the system's network" do
@@ -230,7 +354,7 @@ describe Ohai::System, "AIX network plugin" do
context "entstat -d interface" do
before do
@plugin.run
- @inet_interface_addresses = @plugin["network"]["interfaces"]["en0"][:addresses]["BE:42:80:00:B0:05"]
+ @inet_interface_addresses = @plugin["network"]["interfaces"]["en0"][:addresses]["62:C5:1C:3A:5D:03"]
end
it "detects the family" do
@@ -264,7 +388,6 @@ describe Ohai::System, "AIX network plugin" do
end
context "inet6" do
-
it "detects the route destinations" do
expect(@plugin["network"]["interfaces"]["en0"][:routes][4][:destination]).to eq("::1%1")
end
diff --git a/spec/unit/plugins/aix/platform_spec.rb b/spec/unit/plugins/aix/platform_spec.rb
index 32816d84..db9a2389 100644
--- a/spec/unit/plugins/aix/platform_spec.rb
+++ b/spec/unit/plugins/aix/platform_spec.rb
@@ -1,7 +1,7 @@
#
# Author:: Prabhu Das (<prabhu.das@clogeny.com>)
# Author:: Isa Farnik (<isa@chef.io>)
-# Copyright:: Copyright (c) 2013-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -18,12 +18,11 @@
require "spec_helper"
-describe Ohai::System, "Aix plugin platform" do
+describe Ohai::System, "AIX plugin platform" do
before do
@plugin = get_plugin("aix/platform")
allow(@plugin).to receive(:collect_os).and_return(:aix)
kernel = Mash.new
- kernel[:name] = "aix"
kernel[:version] = "7"
kernel[:release] = "1"
allow(@plugin).to receive(:kernel).and_return(kernel)
diff --git a/spec/unit/plugins/aix/uptime_spec.rb b/spec/unit/plugins/aix/uptime_spec.rb
index 3023d41f..aa9243d6 100644
--- a/spec/unit/plugins/aix/uptime_spec.rb
+++ b/spec/unit/plugins/aix/uptime_spec.rb
@@ -1,7 +1,7 @@
#
# Author:: Prabhu Das (<prabhu.das@clogeny.com>)
# Author:: Isa Farnik (<isa@chef.io>)
-# Copyright:: Copyright (c) 2013-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -19,7 +19,6 @@
require "spec_helper"
describe Ohai::System, "Aix plugin uptime" do
-
before do
@plugin = get_plugin("aix/uptime")
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 4c8c3896..a96f5278 100644
--- a/spec/unit/plugins/aix/virtualization_spec.rb
+++ b/spec/unit/plugins/aix/virtualization_spec.rb
@@ -1,7 +1,7 @@
#
# Author:: Julian C. Dunn (<jdunn@chef.iom>)
# Author:: Isa Farnik (<isa@chef.io>)
-# Copyright:: Copyright (c) 2013-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -19,13 +19,11 @@
require "spec_helper"
describe Ohai::System, "AIX virtualization plugin" do
-
context "when inside an LPAR" do
-
let(:plugin) do
p = get_plugin("aix/virtualization")
allow(p).to receive(:collect_os).and_return(:aix)
- allow(p).to receive(:shell_out).with("uname -L").and_return(mock_shell_out(0, "29 l273pp027", nil))
+ allow(p).to receive(:shell_out).with("uname -L").and_return(mock_shell_out(0, "29 virtlpar03 - 7.1 testers", nil))
allow(p).to receive(:shell_out).with("uname -W").and_return(mock_shell_out(0, "0", nil))
allow(p).to receive(:shell_out).with("lswpar -L").and_return(mock_shell_out(0, @lswpar_l, nil))
p
@@ -139,7 +137,7 @@ describe Ohai::System, "AIX virtualization plugin" do
/dev/nvram pseudo EXPORTED
=================================================================
- fluttershy-5c969f - Active
+ fluttershy-5c969f - Defined
=================================================================
GENERAL
Type: S
@@ -245,13 +243,12 @@ describe Ohai::System, "AIX virtualization plugin" do
LSWPAR_L
-
end
it "uname -L detects the LPAR number and name" do
plugin.run
expect(plugin[:virtualization][:lpar_no]).to eq("29")
- expect(plugin[:virtualization][:lpar_name]).to eq("l273pp027")
+ expect(plugin[:virtualization][:lpar_name]).to eq("virtlpar03 - 7.1 testers")
end
context "when WPARs exist on the LPAR" do
@@ -267,6 +264,11 @@ describe Ohai::System, "AIX virtualization plugin" do
plugin[:virtualization][:wpars]["fluttershy-5c969f"]
end
+ it "detects WPAR states" do
+ expect(wpar1[:state]).to eq("active")
+ expect(wpar2[:state]).to eq("defined")
+ end
+
it "detects all WPARs present (2)" do
expect(plugin[:virtualization][:wpars].length).to eq(2)
end
@@ -315,5 +317,4 @@ describe Ohai::System, "AIX virtualization plugin" do
expect(plugin[:virtualization][:wpar_no]).to eq("42")
end
end
-
end
diff --git a/spec/unit/plugins/azure_spec.rb b/spec/unit/plugins/azure_spec.rb
index f11a2b9b..1ddfe3d1 100644
--- a/spec/unit/plugins/azure_spec.rb
+++ b/spec/unit/plugins/azure_spec.rb
@@ -1,6 +1,6 @@
#
# Author:: Kaustubh Deorukhkar (<kaustubh@clogeny.com>)
-# Copyright:: Copyright (c) 2011-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -17,7 +17,6 @@
#
require "spec_helper"
-require "open-uri"
describe Ohai::System, "plugin azure" do
let(:plugin) { get_plugin("azure") }
@@ -73,6 +72,49 @@ describe Ohai::System, "plugin azure" do
end
end
+ context "when on windows", :windows_only do
+ let(:plugin) do
+ get_plugin("azure").tap do |plugin|
+ plugin[:platform_family] = "windows"
+ end
+ end
+
+ let(:tcpip_reg_key) { "SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters" }
+ let(:win_reg_double) { instance_double("Win32::Registry") }
+
+ before do
+ allow(Win32::Registry::HKEY_LOCAL_MACHINE)
+ .to receive(:open)
+ .with(tcpip_reg_key)
+ .and_return(win_reg_double)
+ allow(win_reg_double).to receive(:[]).with("DhcpDomain").and_return("domain.com")
+ end
+
+ context "without azure hint file or agent" do
+ before do
+ allow(plugin).to receive(:hint?).with("azure").and_return(false)
+ allow(plugin).to receive(:has_waagent?).and_return(false)
+ allow(plugin).to receive(:has_dhcp_option_245?).and_return(false)
+ end
+
+ context "DHCP option 15 is set to reddog.microsoft.com" do
+ before do
+ allow(win_reg_double).to receive(:[]).with("DhcpDomain").and_return("reddog.microsoft.com")
+ end
+
+ it_behaves_like "azure"
+ end
+
+ context "DHCP option 15 is not set to reddog.microsoft.com" do
+ before do
+ allow(win_reg_double).to receive(:[]).with("DhcpDomain").and_return("domain.com")
+ end
+
+ it_behaves_like "!azure"
+ end
+ end
+ end
+
describe "with azure hint file" do
before do
allow(plugin).to receive(:hint?).with("azure").and_return(hint)
@@ -92,9 +134,9 @@ describe Ohai::System, "plugin azure" do
describe "without azure hint file or agent or dhcp options" do
before do
allow(plugin).to receive(:hint?).with("azure").and_return(false)
- allow(File).to receive(:exist?).with("/usr/sbin/waagent").and_return(false)
- allow(Dir).to receive(:exist?).with('C:\WindowsAzure').and_return(false)
- allow(File).to receive(:exist?).with("/var/lib/dhcp/dhclient.eth0.leases").and_return(true)
+ allow(plugin).to receive(:file_exist?).with("/usr/sbin/waagent").and_return(false)
+ allow(plugin).to receive(:dir_exist?).with('C:\WindowsAzure').and_return(false)
+ allow(plugin).to receive(:file_exist?).with("/var/lib/dhcp/dhclient.eth0.leases").and_return(true)
@double_file = double("/var/lib/dhcp/dhclient.eth0.leases")
allow(@double_file).to receive(:each)
.and_yield("lease {")
@@ -116,7 +158,7 @@ describe Ohai::System, "plugin azure" do
.and_yield(" rebind 2 2016/03/01 13:22:07;")
.and_yield(" expire 2 2016/03/01 16:40:56;")
.and_yield("}")
- allow(File).to receive(:open).with("/var/lib/dhcp/dhclient.eth0.leases").and_return(@double_file)
+ allow(plugin).to receive(:file_open).with("/var/lib/dhcp/dhclient.eth0.leases").and_return(@double_file)
end
it_behaves_like "!azure"
@@ -126,9 +168,9 @@ describe Ohai::System, "plugin azure" do
before do
allow(plugin).to receive(:hint?).with("rackspace").and_return(true)
allow(plugin).to receive(:hint?).with("azure").and_return(false)
- allow(File).to receive(:exist?).with("/usr/sbin/waagent").and_return(false)
- allow(Dir).to receive(:exist?).with('C:\WindowsAzure').and_return(false)
- allow(File).to receive(:exist?).with("/var/lib/dhcp/dhclient.eth0.leases").and_return(false)
+ allow(plugin).to receive(:file_exist?).with("/usr/sbin/waagent").and_return(false)
+ allow(plugin).to receive(:dir_exist?).with('C:\WindowsAzure').and_return(false)
+ allow(plugin).to receive(:file_exist?).with("/var/lib/dhcp/dhclient.eth0.leases").and_return(false)
end
it_behaves_like "!azure"
@@ -137,8 +179,8 @@ describe Ohai::System, "plugin azure" do
describe "without azure hint file but with agent on linux" do
before do
allow(plugin).to receive(:hint?).with("azure").and_return(false)
- allow(File).to receive(:exist?).with("/usr/sbin/waagent").and_return(true)
- allow(Dir).to receive(:exist?).with('C:\WindowsAzure').and_return(false)
+ allow(plugin).to receive(:file_exist?).with("/usr/sbin/waagent").and_return(true)
+ allow(plugin).to receive(:dir_exist?).with('C:\WindowsAzure').and_return(false)
end
it_behaves_like "azure"
@@ -147,8 +189,8 @@ describe Ohai::System, "plugin azure" do
describe "without azure hint file but with agent on windows" do
before do
allow(plugin).to receive(:hint?).with("azure").and_return(false)
- allow(File).to receive(:exist?).with("/usr/sbin/waagent").and_return(false)
- allow(Dir).to receive(:exist?).with('C:\WindowsAzure').and_return(true)
+ allow(plugin).to receive(:file_exist?).with("/usr/sbin/waagent").and_return(false)
+ allow(plugin).to receive(:dir_exist?).with('C:\WindowsAzure').and_return(true)
end
it_behaves_like "azure"
@@ -157,9 +199,9 @@ describe Ohai::System, "plugin azure" do
describe "without azure hint or agent but with dhcp option" do
before do
allow(plugin).to receive(:hint?).with("azure").and_return(false)
- allow(File).to receive(:exist?).with("/usr/sbin/waagent").and_return(false)
- allow(Dir).to receive(:exist?).with('C:\WindowsAzure').and_return(false)
- allow(File).to receive(:exist?).with("/var/lib/dhcp/dhclient.eth0.leases").and_return(true)
+ allow(plugin).to receive(:file_exist?).with("/usr/sbin/waagent").and_return(false)
+ allow(plugin).to receive(:dir_exist?).with('C:\WindowsAzure').and_return(false)
+ allow(plugin).to receive(:file_exist?).with("/var/lib/dhcp/dhclient.eth0.leases").and_return(true)
@double_file = double("/var/lib/dhcp/dhclient.eth0.leases")
allow(@double_file).to receive(:each)
.and_yield("lease {")
@@ -181,7 +223,7 @@ describe Ohai::System, "plugin azure" do
.and_yield(" rebind 5 2152/03/10 09:03:39;")
.and_yield(" expire 5 2152/03/10 09:03:39;")
.and_yield("}")
- allow(File).to receive(:open).with("/var/lib/dhcp/dhclient.eth0.leases").and_return(@double_file)
+ allow(plugin).to receive(:file_open).with("/var/lib/dhcp/dhclient.eth0.leases").and_return(@double_file)
end
it_behaves_like "azure"
diff --git a/spec/unit/plugins/bsd/filesystem_spec.rb b/spec/unit/plugins/bsd/filesystem_spec.rb
index f6967c0e..7629f815 100644
--- a/spec/unit/plugins/bsd/filesystem_spec.rb
+++ b/spec/unit/plugins/bsd/filesystem_spec.rb
@@ -1,7 +1,7 @@
#
# Author:: Matthew Kent (<mkent@magoazul.com>)
# Author:: Tim Smith (<tsmith@chef.io>)
-# Copyright:: Copyright (c) 2011-2020, Chef Software Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/spec/unit/plugins/bsd/virtualization_spec.rb b/spec/unit/plugins/bsd/virtualization_spec.rb
index 8001695c..db2ed2e1 100644
--- a/spec/unit/plugins/bsd/virtualization_spec.rb
+++ b/spec/unit/plugins/bsd/virtualization_spec.rb
@@ -1,6 +1,6 @@
#
# Author:: Bryan McLellan <btm@chef.io>
-# Copyright:: Copyright (c) 2012-2018 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -24,7 +24,7 @@ describe Ohai::System, "BSD virtualization plugin" do
before do
allow(plugin).to receive(:collect_os).and_return(:freebsd)
allow(plugin).to receive(:shell_out).with("sysctl -n security.jail.jailed").and_return(mock_shell_out(0, "0", ""))
- allow(plugin).to receive(:shell_out).with((Ohai.abs_path( "/sbin/kldstat" )).to_s).and_return(mock_shell_out(0, "", ""))
+ allow(plugin).to receive(:shell_out).with(Ohai.abs_path( "/sbin/kldstat" ).to_s).and_return(mock_shell_out(0, "", ""))
allow(plugin).to receive(:shell_out).with("jls -nd").and_return(mock_shell_out(0, "", ""))
allow(plugin).to receive(:shell_out).with("sysctl -n hw.model").and_return(mock_shell_out(0, "", ""))
allow(plugin).to receive(:shell_out).with("sysctl -n kern.vm_guest").and_return(mock_shell_out(0, "", ""))
@@ -79,7 +79,7 @@ describe Ohai::System, "BSD virtualization plugin" do
1 40 0xffffffff80100000 d20428 kernel
7 3 0xffffffff81055000 41e88 vboxguest.ko
OUT
- allow(plugin).to receive(:shell_out).with((Ohai.abs_path("/sbin/kldstat")).to_s).and_return(mock_shell_out(0, @vbox_guest, ""))
+ allow(plugin).to receive(:shell_out).with(Ohai.abs_path("/sbin/kldstat").to_s).and_return(mock_shell_out(0, @vbox_guest, ""))
end
it "detects we are a guest" do
diff --git a/spec/unit/plugins/chef_spec.rb b/spec/unit/plugins/chef_spec.rb
index 1596e152..9199adc3 100644
--- a/spec/unit/plugins/chef_spec.rb
+++ b/spec/unit/plugins/chef_spec.rb
@@ -1,7 +1,7 @@
#
# Author:: Adam Jacob (<adam@chef.io>)
# Author:: Tollef Fog Heen <tfheen@err.no>
-# Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# Copyright:: Copyright (c) 2010 Tollef Fog Heen <tfheen@err.no>
# License:: Apache License, Version 2.0
#
@@ -20,7 +20,6 @@
begin
require "spec_helper"
- require "chef/version"
describe Ohai::System, "plugin chef" do
before do
diff --git a/spec/unit/plugins/cloud_spec.rb b/spec/unit/plugins/cloud_spec.rb
index d805c93c..f71a7dd3 100644
--- a/spec/unit/plugins/cloud_spec.rb
+++ b/spec/unit/plugins/cloud_spec.rb
@@ -16,7 +16,6 @@
#
require "spec_helper"
-require "ipaddr"
describe "CloudAttrs object" do
before do
diff --git a/spec/unit/plugins/darwin/cpu_spec.rb b/spec/unit/plugins/darwin/cpu_spec.rb
index 1c0313c4..5c340983 100644
--- a/spec/unit/plugins/darwin/cpu_spec.rb
+++ b/spec/unit/plugins/darwin/cpu_spec.rb
@@ -1,6 +1,6 @@
#
# Author:: Nathan L Smith (<nlloyds@gmail.com>)
-# Copyright:: Copyright (c) 2013-2018 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/spec/unit/plugins/darwin/hostname_spec.rb b/spec/unit/plugins/darwin/hostname_spec.rb
index b4ab4ccd..831781a3 100644
--- a/spec/unit/plugins/darwin/hostname_spec.rb
+++ b/spec/unit/plugins/darwin/hostname_spec.rb
@@ -1,6 +1,6 @@
#
# Author:: Adam Jacob (<adam@chef.io>)
-# Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/spec/unit/plugins/darwin/kernel_spec.rb b/spec/unit/plugins/darwin/kernel_spec.rb
index 2cf727be..05c99c2c 100644
--- a/spec/unit/plugins/darwin/kernel_spec.rb
+++ b/spec/unit/plugins/darwin/kernel_spec.rb
@@ -1,6 +1,6 @@
#
# Author:: Adam Jacob (<adam@chef.io>)
-# Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/spec/unit/plugins/darwin/memory_spec.rb b/spec/unit/plugins/darwin/memory_spec.rb
index 1baf96d0..b9161da3 100644
--- a/spec/unit/plugins/darwin/memory_spec.rb
+++ b/spec/unit/plugins/darwin/memory_spec.rb
@@ -1,6 +1,6 @@
#
# Author:: Patrick Collins (<pat@burned.com>)
-# Copyright:: Copyright (c) 2013-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/spec/unit/plugins/darwin/platform_spec.rb b/spec/unit/plugins/darwin/platform_spec.rb
index ecd2c5f0..a78981a0 100644
--- a/spec/unit/plugins/darwin/platform_spec.rb
+++ b/spec/unit/plugins/darwin/platform_spec.rb
@@ -1,6 +1,6 @@
#
# Author:: Adam Jacob (<adam@chef.io>)
-# Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -22,7 +22,7 @@ describe Ohai::System, "Darwin plugin platform" do
before do
@plugin = get_plugin("darwin/platform")
allow(@plugin).to receive(:collect_os).and_return(:darwin)
- @stdout = "ProductName: Mac OS X\nProductVersion: 10.5.5\nBuildVersion: 9F33"
+ @stdout = "ProductName: Mac OS X\nProductVersion: 10.15.6\nBuildVersion: 19G46c"
allow(@plugin).to receive(:shell_out).with("/usr/bin/sw_vers").and_return(mock_shell_out(0, @stdout, ""))
end
@@ -38,34 +38,16 @@ describe Ohai::System, "Darwin plugin platform" do
it "sets platform_version to ProductVersion" do
@plugin.run
- expect(@plugin[:platform_version]).to eq("10.5.5")
+ expect(@plugin[:platform_version]).to eq("10.15.6")
end
it "sets platform_build to BuildVersion" do
@plugin.run
- expect(@plugin[:platform_build]).to eq("9F33")
+ expect(@plugin[:platform_build]).to eq("19G46c")
end
it "sets platform_family to mac_os_x" do
@plugin.run
expect(@plugin[:platform_family]).to eq("mac_os_x")
end
-
- describe "on os x server" do
- before do
- @plugin[:os] = "darwin"
- @stdout = "ProductName: Mac OS X Server\nProductVersion: 10.6.8\nBuildVersion: 10K549"
- allow(@plugin).to receive(:shell_out).with("/usr/bin/sw_vers").and_return(mock_shell_out(0, @stdout, ""))
- end
-
- it "sets platform to mac_os_x_server" do
- @plugin.run
- expect(@plugin[:platform]).to eq("mac_os_x_server")
- end
-
- it "sets platform_family to mac_os_x" do
- @plugin.run
- expect(@plugin[:platform_family]).to eq("mac_os_x")
- end
- end
end
diff --git a/spec/unit/plugins/darwin/virtualization_spec.rb b/spec/unit/plugins/darwin/virtualization_spec.rb
index 55936c93..59d3d448 100644
--- a/spec/unit/plugins/darwin/virtualization_spec.rb
+++ b/spec/unit/plugins/darwin/virtualization_spec.rb
@@ -2,7 +2,7 @@
# Author:: Pavel Yudin (<pyudin@parallels.com>)
# Author:: Tim Smith (<tsmith@chef.io>)
# Copyright:: Copyright (c) 2015 Pavel Yudin
-# Copyright:: Copyright (c) 2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/spec/unit/plugins/docker_spec.rb b/spec/unit/plugins/docker_spec.rb
index bb563dd0..c3105048 100644
--- a/spec/unit/plugins/docker_spec.rb
+++ b/spec/unit/plugins/docker_spec.rb
@@ -1,5 +1,5 @@
#
-# Copyright:: 2018 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/spec/unit/plugins/ec2_spec.rb b/spec/unit/plugins/ec2_spec.rb
index d586d94b..dbb19715 100644
--- a/spec/unit/plugins/ec2_spec.rb
+++ b/spec/unit/plugins/ec2_spec.rb
@@ -1,7 +1,7 @@
#
# Author:: Tim Dysinger (<tim@dysinger.net>)
# Author:: Christopher Brown (cb@chef.io)
-# Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -18,8 +18,6 @@
#
require "spec_helper"
-require "open-uri"
-require "base64"
describe Ohai::System, "plugin ec2" do
@@ -27,9 +25,9 @@ describe Ohai::System, "plugin ec2" do
before do
allow(plugin).to receive(:hint?).with("ec2").and_return(false)
- allow(File).to receive(:exist?).with("/sys/hypervisor/uuid").and_return(false)
- allow(File).to receive(:exist?).with("/sys/class/dmi/id/bios_vendor").and_return(false)
- allow(File).to receive(:exist?).with("/sys/class/dmi/id/bios_version").and_return(false)
+ allow(plugin).to receive(:file_exist?).with("/sys/hypervisor/uuid").and_return(false)
+ allow(plugin).to receive(:file_exist?).with("/sys/class/dmi/id/bios_vendor").and_return(false)
+ allow(plugin).to receive(:file_exist?).with("/sys/class/dmi/id/bios_version").and_return(false)
end
shared_examples_for "!ec2" do
@@ -245,7 +243,7 @@ describe Ohai::System, "plugin ec2" do
allow(plugin).to receive(:hint?).with("iam").and_return(false)
end
- it "parses ec2 iam/ directory and NOT collect iam/security-credentials/" do
+ it "parses ec2 iam/ directory and collect info and role_name and NOT collect iam/security-credentials/" do
expect(@http_client).to receive(:get)
.with("/2012-01-12/meta-data/", @get_req_token_header)
.and_return(double("Net::HTTP::GET Response", body: "iam/", code: "200"))
@@ -253,6 +251,9 @@ describe Ohai::System, "plugin ec2" do
.with("/2012-01-12/meta-data/iam/", @get_req_token_header)
.and_return(double("Net::HTTP::GET Response", body: "security-credentials/", code: "200"))
expect(@http_client).to receive(:get)
+ .with("/2012-01-12/meta-data/iam/info")
+ .and_return(double("Net::HTTP Response", body: "{\n \"Code\" : \"Success\",\n \"LastUpdated\" : \"2020-10-08T20:47:08Z\",\n \"InstanceProfileArn\" : \"arn:aws:iam::111111111111:instance-profile/my_profile\",\n \"InstanceProfileId\" : \"AAAAAAAAAAAAAAAAAAAAA\"\n}", code: "200"))
+ expect(@http_client).to receive(:get)
.with("/2012-01-12/meta-data/iam/security-credentials/", @get_req_token_header)
.and_return(double("Net::HTTP::GET Response", body: "MyRole", code: "200"))
expect(@http_client).to receive(:get)
@@ -268,7 +269,9 @@ describe Ohai::System, "plugin ec2" do
plugin.run
expect(plugin[:ec2]).not_to be_nil
- expect(plugin[:ec2]["iam"]).to be_nil
+ expect(plugin[:ec2]["iam"]["info"]["InstanceProfileId"]).to eql "AAAAAAAAAAAAAAAAAAAAA"
+ expect(plugin[:ec2]["iam"]["security-credentials"]).to be_nil
+ expect(plugin[:ec2]["iam"]["role_name"]).to eql "MyRole"
end
end
@@ -338,8 +341,8 @@ describe Ohai::System, "plugin ec2" do
describe "with amazon dmi bios version data" do
before do
- allow(File).to receive(:exist?).with("/sys/class/dmi/id/bios_version").and_return(true)
- allow(File).to receive(:read).with("/sys/class/dmi/id/bios_version").and_return("4.2.amazon\n")
+ allow(plugin).to receive(:file_exist?).with("/sys/class/dmi/id/bios_version").and_return(true)
+ allow(plugin).to receive(:file_read).with("/sys/class/dmi/id/bios_version").and_return("4.2.amazon\n")
end
it_behaves_like "ec2"
@@ -348,8 +351,8 @@ describe Ohai::System, "plugin ec2" do
describe "with non-amazon dmi bios version data" do
before do
- allow(File).to receive(:exist?).with("/sys/class/dmi/id/bios_version").and_return(true)
- allow(File).to receive(:read).with("/sys/class/dmi/id/bios_version").and_return("1.0\n")
+ allow(plugin).to receive(:file_exist?).with("/sys/class/dmi/id/bios_version").and_return(true)
+ allow(plugin).to receive(:file_read).with("/sys/class/dmi/id/bios_version").and_return("1.0\n")
end
it_behaves_like "!ec2"
@@ -358,8 +361,8 @@ describe Ohai::System, "plugin ec2" do
describe "with amazon dmi bios vendor data" do
before do
- allow(File).to receive(:exist?).with("/sys/class/dmi/id/bios_vendor").and_return(true)
- allow(File).to receive(:read).with("/sys/class/dmi/id/bios_vendor").and_return("Amazon EC2\n")
+ allow(plugin).to receive(:file_exist?).with("/sys/class/dmi/id/bios_vendor").and_return(true)
+ allow(plugin).to receive(:file_read).with("/sys/class/dmi/id/bios_vendor").and_return("Amazon EC2\n")
end
it_behaves_like "ec2"
@@ -368,8 +371,8 @@ describe Ohai::System, "plugin ec2" do
describe "with non-amazon dmi bios vendor data" do
before do
- allow(File).to receive(:exist?).with("/sys/class/dmi/id/bios_vendor").and_return(true)
- allow(File).to receive(:read).with("/sys/class/dmi/id/bios_vendor").and_return("Xen\n")
+ allow(plugin).to receive(:file_exist?).with("/sys/class/dmi/id/bios_vendor").and_return(true)
+ allow(plugin).to receive(:file_read).with("/sys/class/dmi/id/bios_vendor").and_return("Xen\n")
end
it_behaves_like "!ec2"
@@ -378,8 +381,8 @@ describe Ohai::System, "plugin ec2" do
describe "with EC2 Xen UUID" do
before do
- allow(File).to receive(:exist?).with("/sys/hypervisor/uuid").and_return(true)
- allow(File).to receive(:read).with("/sys/hypervisor/uuid").and_return("ec2a0561-e4d6-8e15-d9c8-2e0e03adcde8\n")
+ allow(plugin).to receive(:file_exist?).with("/sys/hypervisor/uuid").and_return(true)
+ allow(plugin).to receive(:file_read).with("/sys/hypervisor/uuid").and_return("ec2a0561-e4d6-8e15-d9c8-2e0e03adcde8\n")
end
it_behaves_like "ec2"
@@ -388,8 +391,8 @@ describe Ohai::System, "plugin ec2" do
describe "with non-EC2 Xen UUID" do
before do
- allow(File).to receive(:exist?).with("/sys/hypervisor/uuid").and_return(true)
- allow(File).to receive(:read).with("/sys/hypervisor/uuid").and_return("123a0561-e4d6-8e15-d9c8-2e0e03adcde8\n")
+ allow(plugin).to receive(:file_exist?).with("/sys/hypervisor/uuid").and_return(true)
+ allow(plugin).to receive(:file_read).with("/sys/hypervisor/uuid").and_return("123a0561-e4d6-8e15-d9c8-2e0e03adcde8\n")
end
it_behaves_like "!ec2"
diff --git a/spec/unit/plugins/erlang_spec.rb b/spec/unit/plugins/erlang_spec.rb
index 76309225..027b6808 100644
--- a/spec/unit/plugins/erlang_spec.rb
+++ b/spec/unit/plugins/erlang_spec.rb
@@ -1,7 +1,7 @@
#
# Author:: Adam Jacob (<adam@chef.io>)
# Author:: Theodore Nordsieck (<theo@chef.io>)
-# Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/spec/unit/plugins/eucalyptus_spec.rb b/spec/unit/plugins/eucalyptus_spec.rb
index 2f27d3b3..ad1d22ca 100644
--- a/spec/unit/plugins/eucalyptus_spec.rb
+++ b/spec/unit/plugins/eucalyptus_spec.rb
@@ -1,7 +1,7 @@
#
# Author:: Tim Dysinger (<tim@dysinger.net>)
# Author:: Christopher Brown (cb@chef.io)
-# Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/spec/unit/plugins/fail_spec.rb b/spec/unit/plugins/fail_spec.rb
index 35a0643a..2db83a30 100644
--- a/spec/unit/plugins/fail_spec.rb
+++ b/spec/unit/plugins/fail_spec.rb
@@ -1,7 +1,7 @@
#
# Author:: Toomas Pelberg (toomas.pelberg@playtech.com>)
# Author:: Claire McQuin (claire@chef.io)
-# Copyright:: Copyright (c) 2011, 2013-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -26,7 +26,7 @@ shared_examples "a v7 loading failure" do
Dir.mkdir("#{tmp}/plugins")
rescue Errno::EEXIST
- # ignore
+ # ignore
end
@@ -44,7 +44,7 @@ shared_examples "a v7 loading failure" do
Dir.delete("#{tmp}/plugins")
rescue
- # ignore
+ # ignore
end
@@ -70,7 +70,7 @@ shared_examples "a v7 loading success" do
Dir.mkdir("#{tmp}/plugins")
rescue Errno::EEXIST
- # ignore
+ # ignore
end
@@ -88,7 +88,7 @@ shared_examples "a v7 loading success" do
Dir.delete("#{tmp}/plugins")
rescue
- # ignore
+ # ignore
end
@@ -113,7 +113,7 @@ shared_examples "a v7 run failure" do
Dir.mkdir("#{tmp}/plugins")
rescue Errno::EEXIST
- # ignore
+ # ignore
end
@@ -131,7 +131,7 @@ shared_examples "a v7 run failure" do
Dir.delete("#{tmp}/plugins")
rescue
- # ignore
+ # ignore
end
diff --git a/spec/unit/plugins/fips_spec.rb b/spec/unit/plugins/fips_spec.rb
index c91ef5b2..0925eb16 100644
--- a/spec/unit/plugins/fips_spec.rb
+++ b/spec/unit/plugins/fips_spec.rb
@@ -1,6 +1,6 @@
#
# Author:: Matt Wrock (<matt@mattwrock.com>)
-# Copyright:: Copyright (c) 2016-2020 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -25,36 +25,23 @@ describe Ohai::System, "plugin fips" do
plugin["fips"]["kernel"]["enabled"]
end
- let(:enabled) { 0 }
let(:plugin) { get_plugin("fips") }
- let(:openssl_test_mode) { false }
before do
allow(plugin).to receive(:collect_os).and_return(:linux)
end
- around do |ex|
-
- $FIPS_TEST_MODE = openssl_test_mode
- ex.run
- ensure
- $FIPS_TEST_MODE = false
-
- end
-
- context "with OpenSSL.fips_mode == false" do
- before { allow(OpenSSL).to receive(:fips_mode).and_return(false) }
-
- it "does not set fips plugin" do
- expect(subject).to be(false)
+ context "when OpenSSL reports FIPS mode true" do
+ it "sets fips enabled true" do
+ stub_const("OpenSSL::OPENSSL_FIPS", true)
+ expect(subject).to be(true)
end
end
- context "with OpenSSL.fips_mode == true" do
- before { allow(OpenSSL).to receive(:fips_mode).and_return(true) }
-
- it "sets fips plugin" do
- expect(subject).to be(true)
+ context "when OpenSSL reports FIPS mode false" do
+ it "sets fips enabled false" do
+ stub_const("OpenSSL::OPENSSL_FIPS", false)
+ expect(subject).to be(false)
end
end
end
diff --git a/spec/unit/plugins/freebsd/hostname_spec.rb b/spec/unit/plugins/freebsd/hostname_spec.rb
index 3f8a8db4..025ccbf9 100644
--- a/spec/unit/plugins/freebsd/hostname_spec.rb
+++ b/spec/unit/plugins/freebsd/hostname_spec.rb
@@ -1,6 +1,6 @@
#
# Author:: Adam Jacob (<adam@chef.io>)
-# Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/spec/unit/plugins/freebsd/kernel_spec.rb b/spec/unit/plugins/freebsd/kernel_spec.rb
index 91291b39..5b5d8251 100644
--- a/spec/unit/plugins/freebsd/kernel_spec.rb
+++ b/spec/unit/plugins/freebsd/kernel_spec.rb
@@ -1,6 +1,6 @@
#
# Author:: Adam Jacob (<adam@chef.io>)
-# Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/spec/unit/plugins/freebsd/platform_spec.rb b/spec/unit/plugins/freebsd/platform_spec.rb
index 58a0fdfa..5947b3ba 100644
--- a/spec/unit/plugins/freebsd/platform_spec.rb
+++ b/spec/unit/plugins/freebsd/platform_spec.rb
@@ -1,6 +1,6 @@
#
# Author:: Adam Jacob (<adam@chef.io>)
-# Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/spec/unit/plugins/hostname_spec.rb b/spec/unit/plugins/hostname_spec.rb
index c7e00f8b..6da5a9d5 100644
--- a/spec/unit/plugins/hostname_spec.rb
+++ b/spec/unit/plugins/hostname_spec.rb
@@ -1,6 +1,6 @@
#
# Author:: Adam Jacob (<adam@chef.io>)
-# Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -17,8 +17,6 @@
#
require "spec_helper"
-require "wmi-lite/wmi"
-require "socket"
describe Ohai::System, "hostname plugin" do
before do
diff --git a/spec/unit/plugins/init_package_spec.rb b/spec/unit/plugins/init_package_spec.rb
index a89aefdf..b17d9808 100644
--- a/spec/unit/plugins/init_package_spec.rb
+++ b/spec/unit/plugins/init_package_spec.rb
@@ -1,6 +1,6 @@
#
# Author:: Caleb Tennis (<caleb.tennis@gmail.com>)
-# Copyright:: Copyright (c) 2012-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/spec/unit/plugins/java_spec.rb b/spec/unit/plugins/java_spec.rb
index 1352bd1e..5ef9c848 100644
--- a/spec/unit/plugins/java_spec.rb
+++ b/spec/unit/plugins/java_spec.rb
@@ -1,7 +1,7 @@
#
# Author:: Benjamin Black (<bb@chef.io>)
# Author:: Theodore Nordsieck (<theo@chef.io>)
-# Copyright:: Copyright (c) 2009-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/spec/unit/plugins/joyent_spec.rb b/spec/unit/plugins/joyent_spec.rb
deleted file mode 100644
index 516cd90e..00000000
--- a/spec/unit/plugins/joyent_spec.rb
+++ /dev/null
@@ -1,100 +0,0 @@
-#
-# License:: Apache License, Version 2.0
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-require "spec_helper"
-
-describe Ohai::System, "plugin joyent" do
- let(:plugin) { get_plugin("joyent") }
-
- describe "without joyent" do
- before do
- allow(plugin).to receive(:is_smartos?).and_return(false)
- end
-
- it "DOES NOT create joyent mash" do
- plugin.run
- expect(plugin[:joyent]).to be_nil
- end
- end
-
- describe "with joyent" do
- before do
- allow(plugin).to receive(:is_smartos?).and_return(true)
- plugin[:virtualization] = Mash.new
- plugin[:virtualization][:guest_uuid] = "global"
- end
-
- it "creates joyent mash" do
- plugin.run
- expect(plugin[:joyent]).not_to be_nil
- end
-
- describe "under global zone" do
- before do
- plugin.run
- end
-
- it "detects global zone" do
- expect(plugin[:joyent][:sm_uuid]).to eql "global"
- end
-
- it "DOES NOT create sm_id" do
- expect(plugin[:joyent][:sm_id]).to be_nil
- end
- end
-
- describe "under smartmachine" do
- before do
- plugin[:virtualization][:guest_uuid] = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx"
- plugin[:virtualization][:guest_id] = "30"
-
- etc_product = <<~EOS
- Name: Joyent Instance
- Image: pkgbuild 16.3.1
- Documentation: https://docs.joyent.com/images/smartos/pkgbuild
- 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
-
- 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)
- plugin.run
- end
-
- it "retrieves zone uuid" do
- expect(plugin[:joyent][:sm_uuid]).to eql "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx"
- end
-
- it "collects sm_id" do
- expect(plugin[:joyent][:sm_id]).to eql "30"
- end
-
- it "collects images" do
- expect(plugin[:joyent][:sm_image_id]).to eql "pkgbuild"
- expect(plugin[:joyent][:sm_image_ver]).to eql "16.3.1"
- end
-
- it "collects pkgsrc" do
- expect(plugin[:joyent][:sm_pkgsrc]).to eql "https://pkgsrc.joyent.com/packages/SmartOS/2016Q3/x86_64/All"
- end
- end
- end
-end
diff --git a/spec/unit/plugins/kernel_spec.rb b/spec/unit/plugins/kernel_spec.rb
index 1ca765d1..5bc63c75 100644
--- a/spec/unit/plugins/kernel_spec.rb
+++ b/spec/unit/plugins/kernel_spec.rb
@@ -1,6 +1,6 @@
#
# Author:: Adam Jacob (<adam@chef.io>)
-# Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/spec/unit/plugins/linux/block_device_spec.rb b/spec/unit/plugins/linux/block_device_spec.rb
index 9a75c12f..ce273b92 100644
--- a/spec/unit/plugins/linux/block_device_spec.rb
+++ b/spec/unit/plugins/linux/block_device_spec.rb
@@ -46,7 +46,7 @@ describe Ohai::System, "Linux Block Device Plugin" do
allow(@plugin).to receive(:collect_os).and_return(:linux)
allow(File).to receive(:exist?).with("/sys/block").and_return(true)
- allow(Dir).to receive(:[]).with("/sys/block/*") do
+ allow(@plugin).to receive(:dir_glob).with("/sys/block/*") do
DISKS.collect { |disk, _files| "/sys/block/#{disk}" }
end
diff --git a/spec/unit/plugins/linux/cpu_spec.rb b/spec/unit/plugins/linux/cpu_spec.rb
index 38de38a3..78977d39 100644
--- a/spec/unit/plugins/linux/cpu_spec.rb
+++ b/spec/unit/plugins/linux/cpu_spec.rb
@@ -1,6 +1,6 @@
#
# Author:: Adam Jacob (<adam@chef.io>)
-# Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -96,7 +96,7 @@ describe Ohai::System, "General Linux cpu plugin" do
tempfile.close
tempfile.unlink
rescue
- # really do not care
+ # really do not care
end
diff --git a/spec/unit/plugins/linux/filesystem_spec.rb b/spec/unit/plugins/linux/filesystem_spec.rb
index 1e0ee544..d4e47505 100644
--- a/spec/unit/plugins/linux/filesystem_spec.rb
+++ b/spec/unit/plugins/linux/filesystem_spec.rb
@@ -1,6 +1,6 @@
#
# Author:: Matthew Kent (<mkent@magoazul.com>)
-# Copyright:: Copyright (c) 2011-2018, Chef Software Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/spec/unit/plugins/linux/hostname_spec.rb b/spec/unit/plugins/linux/hostname_spec.rb
index 0fe198ca..9bc6e86d 100644
--- a/spec/unit/plugins/linux/hostname_spec.rb
+++ b/spec/unit/plugins/linux/hostname_spec.rb
@@ -1,6 +1,6 @@
#
# Author:: Adam Jacob (<adam@chef.io>)
-# Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/spec/unit/plugins/linux/hostnamectl_spec.rb b/spec/unit/plugins/linux/hostnamectl_spec.rb
index 5dd7e052..3994f4ab 100644
--- a/spec/unit/plugins/linux/hostnamectl_spec.rb
+++ b/spec/unit/plugins/linux/hostnamectl_spec.rb
@@ -34,6 +34,7 @@ describe Ohai::System, "Linux hostnamectl plugin" do
Boot ID: e085ae9e65e245a8a7b62912adeebe97
Operating System: Debian GNU/Linux 8 (jessie)
Kernel: Linux 4.3.0-0.bpo.1-amd64
+ CPE OS Name: cpe:/o:foo:bar:8
Architecture: x86-64
HOSTNAMECTL_OUT
@@ -44,6 +45,7 @@ describe Ohai::System, "Linux hostnamectl plugin" do
"static_hostname" => "foo",
"icon_name" => "computer-laptop",
"chassis" => "laptop",
+ "cpe_os_name" => "cpe:/o:foo:bar:8",
"machine_id" => "6f702523e2fc7499eb1dc68e5314dacf",
"boot_id" => "e085ae9e65e245a8a7b62912adeebe97",
"operating_system" => "Debian GNU/Linux 8 (jessie)",
diff --git a/spec/unit/plugins/linux/interrupts_spec.rb b/spec/unit/plugins/linux/interrupts_spec.rb
index abed19e0..4ff1dec3 100644
--- a/spec/unit/plugins/linux/interrupts_spec.rb
+++ b/spec/unit/plugins/linux/interrupts_spec.rb
@@ -549,12 +549,12 @@ describe Ohai::System, "Linux interrupts plugin" do
plugin[:cpu] = {
"total" => 4,
}
- allow(File).to receive(:exist?).and_return(false)
- allow(File).to receive(:open).with("/proc/interrupts").and_return(@proc_interrupts)
- allow(File).to receive(:exist?).with("/proc/irq/default_smp_affinity").and_return(true)
- allow(File).to receive(:read).with("/proc/irq/default_smp_affinity").and_return("ff")
- allow(File).to receive(:exist?).with("/proc/irq/1/smp_affinity").and_return(true)
- allow(File).to receive(:read).with("/proc/irq/1/smp_affinity").and_return("ff")
+ allow(plugin).to receive(:file_exist?).and_return(false)
+ allow(plugin).to receive(:file_open).with("/proc/interrupts").and_return(@proc_interrupts)
+ allow(plugin).to receive(:file_exist?).with("/proc/irq/default_smp_affinity").and_return(true)
+ allow(plugin).to receive(:file_read).with("/proc/irq/default_smp_affinity").and_return("ff")
+ allow(plugin).to receive(:file_exist?).with("/proc/irq/1/smp_affinity").and_return(true)
+ allow(plugin).to receive(:file_read).with("/proc/irq/1/smp_affinity").and_return("ff")
plugin.run
expect(plugin[:interrupts]).to eq(interrupts)
end
diff --git a/spec/unit/plugins/linux/kernel_spec.rb b/spec/unit/plugins/linux/kernel_spec.rb
index 8ddcb1f1..74ba6f43 100644
--- a/spec/unit/plugins/linux/kernel_spec.rb
+++ b/spec/unit/plugins/linux/kernel_spec.rb
@@ -1,7 +1,7 @@
#
# Author:: Adam Jacob (<adam@chef.io>)
# Author:: Theodore Nordsieck (<theo@chef.io>)
-# Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -56,8 +56,8 @@ describe Ohai::System, "Linux kernel plugin" do
allow(@plugin).to receive(:shell_out).with("uname -o").and_return(mock_shell_out(0, "Linux", ""))
allow(@plugin).to receive(:shell_out).with("env lsmod").and_return(mock_shell_out(0, @env_lsmod, ""))
@version_module.each do |mod, vers|
- allow(File).to receive(:exist?).with("/sys/module/#{mod}/version").and_return(true)
- allow(File).to receive(:read).with("/sys/module/#{mod}/version").and_return(vers)
+ allow(@plugin).to receive(:file_exist?).with("/sys/module/#{mod}/version").and_return(true)
+ allow(@plugin).to receive(:file_read).with("/sys/module/#{mod}/version").and_return(vers)
end
expect(@plugin).to receive(:shell_out).with("env lsmod").at_least(:once)
@plugin.run
diff --git a/spec/unit/plugins/linux/lsb_spec.rb b/spec/unit/plugins/linux/lsb_spec.rb
index 4ce9a113..9f8cadf9 100644
--- a/spec/unit/plugins/linux/lsb_spec.rb
+++ b/spec/unit/plugins/linux/lsb_spec.rb
@@ -1,6 +1,6 @@
#
# Author:: Adam Jacob (<adam@chef.io>)
-# Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -26,40 +26,6 @@ describe Ohai::System, "Linux lsb plugin" do
allow(@plugin).to receive(:collect_os).and_return(:linux)
end
- describe "on systems with /etc/lsb-release" do
- before do
- @double_file = double("/etc/lsb-release")
- allow(@double_file).to receive(:each)
- .and_yield("DISTRIB_ID=Ubuntu")
- .and_yield("DISTRIB_RELEASE=8.04")
- .and_yield("DISTRIB_CODENAME=hardy")
- .and_yield('DISTRIB_DESCRIPTION="Ubuntu 8.04"')
- allow(File).to receive(:open).with("/etc/lsb-release").and_return(@double_file)
- allow(File).to receive(:exist?).with("/usr/bin/lsb_release").and_return(false)
- allow(File).to receive(:exist?).with("/etc/lsb-release").and_return(true)
- end
-
- it "sets lsb[:id]" do
- @plugin.run
- expect(@plugin[:lsb][:id]).to eq("Ubuntu")
- end
-
- it "sets lsb[:release]" do
- @plugin.run
- expect(@plugin[:lsb][:release]).to eq("8.04")
- end
-
- it "sets lsb[:codename]" do
- @plugin.run
- expect(@plugin[:lsb][:codename]).to eq("hardy")
- end
-
- it "sets lsb[:description]" do
- @plugin.run
- expect(@plugin[:lsb][:description]).to eq("Ubuntu 8.04")
- end
- end
-
describe "on systems with /usr/bin/lsb_release" do
before do
allow(File).to receive(:exist?).with("/usr/bin/lsb_release").and_return(true)
diff --git a/spec/unit/plugins/linux/machineid_spec.rb b/spec/unit/plugins/linux/machineid_spec.rb
index e751def0..cb668ebf 100644
--- a/spec/unit/plugins/linux/machineid_spec.rb
+++ b/spec/unit/plugins/linux/machineid_spec.rb
@@ -28,8 +28,8 @@ describe Ohai::System, "Machine id plugin" do
it "reads /etc/machine-id if available" do
machine_id = "6f702523e2fc7499eb1dc68e5314dacf"
- allow(::File).to receive(:exist?).with("/etc/machine-id").and_return(true)
- allow(::File).to receive(:read).with("/etc/machine-id").and_return(machine_id)
+ allow(plugin).to receive(:file_exist?).with("/etc/machine-id").and_return(true)
+ allow(plugin).to receive(:file_read).with("/etc/machine-id").and_return(machine_id)
plugin.run
expect(plugin[:machine_id]).to eq(machine_id)
end
@@ -37,9 +37,9 @@ describe Ohai::System, "Machine id plugin" do
it "reads /var/lib/dbus/machine-id if available" do
machine_id = "6f702523e2fc7499eb1dc68e5314dacf"
- allow(::File).to receive(:exist?).with("/etc/machine-id").and_return(false)
- allow(::File).to receive(:exist?).with("/var/lib/dbus/machine-id").and_return(true)
- allow(::File).to receive(:read).with("/var/lib/dbus/machine-id").and_return(machine_id)
+ allow(plugin).to receive(:file_exist?).with("/etc/machine-id").and_return(false)
+ allow(plugin).to receive(:file_exist?).with("/var/lib/dbus/machine-id").and_return(true)
+ allow(plugin).to receive(:file_read).with("/var/lib/dbus/machine-id").and_return(machine_id)
plugin.run
expect(plugin[:machine_id]).to eq(machine_id)
end
diff --git a/spec/unit/plugins/linux/network_spec.rb b/spec/unit/plugins/linux/network_spec.rb
index 4e6974e4..978160bb 100644
--- a/spec/unit/plugins/linux/network_spec.rb
+++ b/spec/unit/plugins/linux/network_spec.rb
@@ -18,7 +18,6 @@
#
require "spec_helper"
-require "ipaddress"
describe Ohai::System, "Linux Network Plugin" do
let(:plugin) { get_plugin("linux/network") }
@@ -142,8 +141,8 @@ describe Ohai::System, "Linux Network Plugin" do
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:140 (140.0 B)
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.
+ # 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
let(:linux_ip_route) do
@@ -608,6 +607,15 @@ describe Ohai::System, "Linux Network Plugin" do
expect(plugin.route_is_valid_default_route?(route, default_route)).to eq(false)
end
end
+
+ context "when route and default_route via have different address family" do
+ let(:route) { { destination: "10.0.0.0/24" } }
+ let(:default_route) { { via: "fe80::69" } }
+
+ it "returns false" do
+ expect(plugin.route_is_valid_default_route?(route, default_route)).to eq(false)
+ end
+ end
end
end
@@ -1500,6 +1508,24 @@ describe Ohai::System, "Linux Network Plugin" do
expect(plugin["network"]["interfaces"]["eth0.11"]["vlan"]["flags"]).to eq([ "REORDER_HDR" ])
end
end
+
+ # Test we can handle IPv4 with inet6 IPv6 next hops
+ describe "using IPv6 next hops for IPv4 routes" do
+ let(:linux_ip_route) do
+ <<~EOM
+ default via inet6 fe80::69 dev eth0 metric 69
+ EOM
+ end
+
+ it "expect an IPv6 next hop and not keyword inet6" do
+ expect(plugin["network"]["interfaces"]["eth0"]["routes"]).to eq(
+ [
+ { "destination" => "default", "family" => "inet", "metric" => "69", "via" => "fe80::69" },
+ { "destination" => "fe80::/64", "family" => "inet6", "metric" => "256", "proto" => "kernel" },
+ ]
+ )
+ end
+ end
end
end
end
diff --git a/spec/unit/plugins/linux/platform_spec.rb b/spec/unit/plugins/linux/platform_spec.rb
index ccb29e79..520a5a26 100644
--- a/spec/unit/plugins/linux/platform_spec.rb
+++ b/spec/unit/plugins/linux/platform_spec.rb
@@ -1,6 +1,6 @@
#
# Author:: Adam Jacob (<adam@chef.io>)
-# Copyright:: Copyright (c) 2008-2018, Chef Software Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -25,13 +25,13 @@ describe Ohai::System, "Linux plugin platform" do
let(:file_contents) { "COW=MOO\nDOG=\"BARK\"" }
it "returns nil if the file does not exist" do
- allow(File).to receive(:exist?).with("/etc/test-release").and_return(false)
+ allow(plugin).to receive(:file_exist?).with("/etc/test-release").and_return(false)
expect(plugin.read_os_release_info("/etc/test-release")).to be nil
end
it "returns a hash of expected contents" do
- allow(File).to receive(:exist?).with("/etc/test-release").and_return(true)
- allow(File).to receive(:read).with("/etc/test-release").and_return(file_contents)
+ allow(plugin).to receive(:file_exist?).with("/etc/test-release").and_return(true)
+ allow(plugin).to receive(:file_read).with("/etc/test-release").and_return(file_contents)
release_info = plugin.read_os_release_info("/etc/test-release")
expect(release_info["COW"]).to eq("MOO")
@@ -44,7 +44,7 @@ describe Ohai::System, "Linux plugin platform" do
let(:release_info) { { "ID" => "os_id" } }
before do
- allow(File).to receive(:exist?).with("/etc/os-release").and_return(true)
+ allow(plugin).to receive(:file_exist?).with("/etc/os-release").and_return(true)
allow(plugin).to receive(:read_os_release_info).with("/etc/os-release").and_return(release_info)
end
@@ -63,8 +63,8 @@ describe Ohai::System, "Linux plugin platform" do
let(:cisco_release_info) { { "ID" => "cisco_id" } }
before do
- allow(File).to receive(:exist?).with("/etc/os-release").and_return(true)
- allow(File).to receive(:exist?).with("/etc/cisco-release").and_return(true)
+ allow(plugin).to receive(:file_exist?).with("/etc/os-release").and_return(true)
+ allow(plugin).to receive(:file_exist?).with("/etc/cisco-release").and_return(true)
allow(plugin).to receive(:read_os_release_info).with("/etc/os-release").and_return(release_info)
allow(plugin).to receive(:read_os_release_info).with("/etc/cisco-release").and_return(cisco_release_info)
end
@@ -160,10 +160,10 @@ describe Ohai::System, "Linux plugin platform" do
end
it "returns nexus_centos for centos os-release id" do
- expect(File).to receive(:exist?).at_least(:once).with("/etc/shared/os-release").and_return(true)
- expect(File).to receive(:exist?).at_least(:once).with("/etc/os-release").and_return(true)
- expect(File).to receive(:read).with("/etc/os-release").and_return(os_release_content)
- expect(File).to receive(:read).with("/etc/shared/os-release").and_return(cisco_release_content)
+ expect(plugin).to receive(:file_exist?).at_least(:once).with("/etc/shared/os-release").and_return(true)
+ expect(plugin).to receive(:file_exist?).at_least(:once).with("/etc/os-release").and_return(true)
+ expect(plugin).to receive(:file_read).with("/etc/os-release").and_return(os_release_content)
+ expect(plugin).to receive(:file_read).with("/etc/shared/os-release").and_return(cisco_release_content)
expect(plugin.platform_id_remap("centos")).to eq("nexus_centos")
end
end
@@ -214,7 +214,7 @@ describe Ohai::System, "Linux plugin platform" do
describe "on system with /etc/os-release" do
before do
allow(plugin).to receive(:collect_os).and_return(:linux)
- allow(::File).to receive(:exist?).with("/etc/os-release").and_return(true)
+ allow(plugin).to receive(:file_exist?).with("/etc/os-release").and_return(true)
end
context "when os-release data is correct" do
@@ -230,7 +230,7 @@ describe Ohai::System, "Linux plugin platform" do
end
before do
- expect(File).to receive(:read).with("/etc/os-release").and_return(os_data)
+ expect(plugin).to receive(:file_read).with("/etc/os-release").and_return(os_data)
end
it "sets platform, platform_family, and platform_version from os-release" do
@@ -252,7 +252,7 @@ describe Ohai::System, "Linux plugin platform" do
end
before do
- expect(File).to receive(:read).with("/etc/os-release").and_return(os_data)
+ expect(plugin).to receive(:file_read).with("/etc/os-release").and_return(os_data)
end
it "sets platform_version using kernel version from uname" do
@@ -277,7 +277,7 @@ describe Ohai::System, "Linux plugin platform" do
end
before do
- expect(File).to receive(:read).with("/etc/os-release").and_return(os_data)
+ expect(plugin).to receive(:file_read).with("/etc/os-release").and_return(os_data)
end
it "sets platform, platform_family, and platform_version from os-release" do
@@ -301,8 +301,8 @@ describe Ohai::System, "Linux plugin platform" do
end
before do
- expect(File).to receive(:read).with("/etc/os-release").and_return(os_data)
- expect(File).to receive(:read).with("/etc/redhat-release").and_return("CentOS Linux release 7.5.1804 (Core)")
+ expect(plugin).to receive(:file_read).with("/etc/os-release").and_return(os_data)
+ expect(plugin).to receive(:file_read).with("/etc/redhat-release").and_return("CentOS Linux release 7.5.1804 (Core)")
end
it "sets platform, platform_family, and platform_version from os-release" do
@@ -334,22 +334,22 @@ describe Ohai::System, "Linux plugin platform" do
before do
allow(plugin).to receive(:collect_os).and_return(:linux)
plugin[:lsb] = Mash.new
- allow(File).to receive(:exist?).with("/etc/debian_version").and_return(have_debian_version)
- allow(File).to receive(:exist?).with("/etc/redhat-release").and_return(have_redhat_release)
- allow(File).to receive(:exist?).with("/etc/exherbo-release").and_return(have_exherbo_release)
- allow(File).to receive(:exist?).with("/etc/Eos-release").and_return(have_eos_release)
- allow(File).to receive(:exist?).with("/etc/SuSE-release").and_return(have_suse_release)
- allow(File).to receive(:exist?).with("/etc/system-release").and_return(have_system_release)
- allow(File).to receive(:exist?).with("/etc/slackware-version").and_return(have_slackware_version)
- allow(File).to receive(:exist?).with("/etc/enterprise-release").and_return(have_enterprise_release)
- allow(File).to receive(:exist?).with("/etc/oracle-release").and_return(have_oracle_release)
- allow(File).to receive(:exist?).with("/etc/parallels-release").and_return(have_parallels_release)
- allow(File).to receive(:exist?).with("/etc/os-release").and_return(have_os_release)
- allow(File).to receive(:exist?).with("/etc/f5-release").and_return(have_f5_release)
- allow(File).to receive(:exist?).with("/usr/lib/os-release").and_return(have_usr_lib_os_release)
- allow(File).to receive(:exist?).with("/etc/shared/os-release").and_return(have_cisco_release)
-
- allow(File).to receive(:read).with("PLEASE STUB ALL File.read CALLS")
+ allow(plugin).to receive(:file_exist?).with("/etc/debian_version").and_return(have_debian_version)
+ allow(plugin).to receive(:file_exist?).with("/etc/redhat-release").and_return(have_redhat_release)
+ allow(plugin).to receive(:file_exist?).with("/etc/exherbo-release").and_return(have_exherbo_release)
+ allow(plugin).to receive(:file_exist?).with("/etc/Eos-release").and_return(have_eos_release)
+ allow(plugin).to receive(:file_exist?).with("/etc/SuSE-release").and_return(have_suse_release)
+ allow(plugin).to receive(:file_exist?).with("/etc/system-release").and_return(have_system_release)
+ allow(plugin).to receive(:file_exist?).with("/etc/slackware-version").and_return(have_slackware_version)
+ allow(plugin).to receive(:file_exist?).with("/etc/enterprise-release").and_return(have_enterprise_release)
+ allow(plugin).to receive(:file_exist?).with("/etc/oracle-release").and_return(have_oracle_release)
+ allow(plugin).to receive(:file_exist?).with("/etc/parallels-release").and_return(have_parallels_release)
+ allow(plugin).to receive(:file_exist?).with("/etc/os-release").and_return(have_os_release)
+ allow(plugin).to receive(:file_exist?).with("/etc/f5-release").and_return(have_f5_release)
+ allow(plugin).to receive(:file_exist?).with("/usr/lib/os-release").and_return(have_usr_lib_os_release)
+ allow(plugin).to receive(:file_exist?).with("/etc/shared/os-release").and_return(have_cisco_release)
+
+ allow(plugin).to receive(:file_read).with("PLEASE STUB ALL plugin.read CALLS")
end
describe "on lsb compliant distributions" do
@@ -423,13 +423,13 @@ describe Ohai::System, "Linux plugin platform" do
end
it "reads the version from /etc/debian_version" do
- expect(File).to receive(:read).with("/etc/debian_version").and_return("9.5")
+ expect(plugin).to receive(:file_read).with("/etc/debian_version").and_return("9.5")
plugin.run
expect(plugin[:platform_version]).to eq("9.5")
end
it "correctlies strip any newlines" do
- expect(File).to receive(:read).with("/etc/debian_version").and_return("9.5\n")
+ expect(plugin).to receive(:file_read).with("/etc/debian_version").and_return("9.5\n")
plugin.run
expect(plugin[:platform_version]).to eq("9.5")
end
@@ -452,14 +452,14 @@ describe Ohai::System, "Linux plugin platform" do
end
it "sets platform and platform_family to slackware" do
- expect(File).to receive(:read).with("/etc/slackware-version").and_return("Slackware 12.0.0")
+ expect(plugin).to receive(:file_read).with("/etc/slackware-version").and_return("Slackware 12.0.0")
plugin.run
expect(plugin[:platform]).to eq("slackware")
expect(plugin[:platform_family]).to eq("slackware")
end
it "sets platform_version on slackware" do
- expect(File).to receive(:read).with("/etc/slackware-version").and_return("Slackware 12.0.0")
+ expect(plugin).to receive(:file_read).with("/etc/slackware-version").and_return("Slackware 12.0.0")
plugin.run
expect(plugin[:platform_version]).to eq("12.0.0")
end
@@ -476,7 +476,7 @@ describe Ohai::System, "Linux plugin platform" do
end
it "sets platform to arista_eos" do
- expect(File).to receive(:read).with("/etc/Eos-release").and_return("Arista Networks EOS 4.21.1.1F")
+ expect(plugin).to receive(:file_read).with("/etc/Eos-release").and_return("Arista Networks EOS 4.21.1.1F")
plugin.run
expect(plugin[:platform]).to eq("arista_eos")
expect(plugin[:platform_family]).to eq("fedora")
@@ -493,7 +493,7 @@ describe Ohai::System, "Linux plugin platform" do
end
it "sets platform to bigip" do
- expect(File).to receive(:read).with("/etc/f5-release").and_return("BIG-IP release 13.0.0 (Final)")
+ expect(plugin).to receive(:file_read).with("/etc/f5-release").and_return("BIG-IP release 13.0.0 (Final)")
plugin.run
expect(plugin[:platform]).to eq("bigip")
expect(plugin[:platform_family]).to eq("rhel")
@@ -553,20 +553,20 @@ describe Ohai::System, "Linux plugin platform" do
end
it "reads the platform as centos and version as 7.5" do
- expect(File).to receive(:read).with("/etc/redhat-release").and_return("CentOS Linux release 7.5.1804 (Core)")
+ expect(plugin).to receive(:file_read).with("/etc/redhat-release").and_return("CentOS Linux release 7.5.1804 (Core)")
plugin.run
expect(plugin[:platform]).to eq("centos")
expect(plugin[:platform_version]).to eq("7.5.1804")
end
it "reads platform of Red Hat with a space" do
- expect(File).to receive(:read).with("/etc/redhat-release").and_return("Red Hat Enterprise Linux Server release 6.5 (Santiago)")
+ expect(plugin).to receive(:file_read).with("/etc/redhat-release").and_return("Red Hat Enterprise Linux Server release 6.5 (Santiago)")
plugin.run
expect(plugin[:platform]).to eq("redhat")
end
it "reads the platform as redhat without a space" do
- expect(File).to receive(:read).with("/etc/redhat-release").and_return("RedHat release 5.3")
+ expect(plugin).to receive(:file_read).with("/etc/redhat-release").and_return("RedHat release 5.3")
plugin.run
expect(plugin[:platform]).to eq("redhat")
expect(plugin[:platform_version]).to eq("5.3")
@@ -585,8 +585,8 @@ describe Ohai::System, "Linux plugin platform" do
it "reads the platform as parallels and version as 6.0.5" do
plugin[:lsb][:id] = "CloudLinuxServer"
plugin[:lsb][:release] = "6.5"
- allow(File).to receive(:read).with("/etc/redhat-release").and_return("CloudLinux Server release 6.5 (Pavel Popovich)")
- expect(File).to receive(:read).with("/etc/parallels-release").and_return("Parallels Cloud Server 6.0.5 (20007)")
+ allow(plugin).to receive(:file_read).with("/etc/redhat-release").and_return("CloudLinux Server release 6.5 (Pavel Popovich)")
+ expect(plugin).to receive(:file_read).with("/etc/parallels-release").and_return("Parallels Cloud Server 6.0.5 (20007)")
plugin.run
expect(plugin[:platform]).to eq("parallels")
expect(plugin[:platform_version]).to eq("6.0.5")
@@ -601,8 +601,8 @@ describe Ohai::System, "Linux plugin platform" do
end
it "reads the platform as parallels and version as 6.0.5" do
- allow(File).to receive(:read).with("/etc/redhat-release").and_return("CloudLinux Server release 6.5 (Pavel Popovich)")
- expect(File).to receive(:read).with("/etc/parallels-release").and_return("Parallels Cloud Server 6.0.5 (20007)")
+ allow(plugin).to receive(:file_read).with("/etc/redhat-release").and_return("CloudLinux Server release 6.5 (Pavel Popovich)")
+ expect(plugin).to receive(:file_read).with("/etc/parallels-release").and_return("Parallels Cloud Server 6.0.5 (20007)")
plugin.run
expect(plugin[:platform]).to eq("parallels")
expect(plugin[:platform_version]).to eq("6.0.5")
@@ -624,8 +624,8 @@ describe Ohai::System, "Linux plugin platform" do
it "reads the platform as oracle and version as 5.7" do
plugin[:lsb][:id] = "EnterpriseEnterpriseServer"
plugin[:lsb][:release] = "5.7"
- allow(File).to receive(:read).with("/etc/redhat-release").and_return("Red Hat Enterprise Linux Server release 5.7 (Tikanga)")
- expect(File).to receive(:read).with("/etc/enterprise-release").and_return("Enterprise Linux Enterprise Linux Server release 5.7 (Carthage)")
+ allow(plugin).to receive(:file_read).with("/etc/redhat-release").and_return("Red Hat Enterprise Linux Server release 5.7 (Tikanga)")
+ expect(plugin).to receive(:file_read).with("/etc/enterprise-release").and_return("Enterprise Linux Enterprise Linux Server release 5.7 (Carthage)")
plugin.run
expect(plugin[:platform]).to eq("oracle")
expect(plugin[:platform_version]).to eq("5.7")
@@ -639,8 +639,8 @@ describe Ohai::System, "Linux plugin platform" do
it "reads the platform as oracle and version as 6.1" do
plugin[:lsb][:id] = "OracleServer"
plugin[:lsb][:release] = "6.1"
- allow(File).to receive(:read).with("/etc/redhat-release").and_return("Red Hat Enterprise Linux Server release 6.1 (Santiago)")
- expect(File).to receive(:read).with("/etc/oracle-release").and_return("Oracle Linux Server release 6.1")
+ allow(plugin).to receive(:file_read).with("/etc/redhat-release").and_return("Red Hat Enterprise Linux Server release 6.1 (Santiago)")
+ expect(plugin).to receive(:file_read).with("/etc/oracle-release").and_return("Oracle Linux Server release 6.1")
plugin.run
expect(plugin[:platform]).to eq("oracle")
expect(plugin[:platform_version]).to eq("6.1")
@@ -659,24 +659,24 @@ describe Ohai::System, "Linux plugin platform" do
let(:have_enterprise_release) { true }
it "reads the platform as oracle and version as 5" do
- allow(File).to receive(:read).with("/etc/redhat-release").and_return("Enterprise Linux Enterprise Linux Server release 5 (Carthage)")
- expect(File).to receive(:read).with("/etc/enterprise-release").and_return("Enterprise Linux Enterprise Linux Server release 5 (Carthage)")
+ allow(plugin).to receive(:file_read).with("/etc/redhat-release").and_return("Enterprise Linux Enterprise Linux Server release 5 (Carthage)")
+ expect(plugin).to receive(:file_read).with("/etc/enterprise-release").and_return("Enterprise Linux Enterprise Linux Server release 5 (Carthage)")
plugin.run
expect(plugin[:platform]).to eq("oracle")
expect(plugin[:platform_version]).to eq("5")
end
it "reads the platform as oracle and version as 5.1" do
- allow(File).to receive(:read).with("/etc/redhat-release").and_return("Enterprise Linux Enterprise Linux Server release 5.1 (Carthage)")
- expect(File).to receive(:read).with("/etc/enterprise-release").and_return("Enterprise Linux Enterprise Linux Server release 5.1 (Carthage)")
+ allow(plugin).to receive(:file_read).with("/etc/redhat-release").and_return("Enterprise Linux Enterprise Linux Server release 5.1 (Carthage)")
+ expect(plugin).to receive(:file_read).with("/etc/enterprise-release").and_return("Enterprise Linux Enterprise Linux Server release 5.1 (Carthage)")
plugin.run
expect(plugin[:platform]).to eq("oracle")
expect(plugin[:platform_version]).to eq("5.1")
end
it "reads the platform as oracle and version as 5.7" do
- allow(File).to receive(:read).with("/etc/redhat-release").and_return("Red Hat Enterprise Linux Server release 5.7 (Tikanga)")
- expect(File).to receive(:read).with("/etc/enterprise-release").and_return("Enterprise Linux Enterprise Linux Server release 5.7 (Carthage)")
+ allow(plugin).to receive(:file_read).with("/etc/redhat-release").and_return("Red Hat Enterprise Linux Server release 5.7 (Tikanga)")
+ expect(plugin).to receive(:file_read).with("/etc/enterprise-release").and_return("Enterprise Linux Enterprise Linux Server release 5.7 (Carthage)")
plugin.run
expect(plugin[:platform]).to eq("oracle")
expect(plugin[:platform_version]).to eq("5.7")
@@ -689,16 +689,16 @@ describe Ohai::System, "Linux plugin platform" do
let(:have_oracle_release) { true }
it "reads the platform as oracle and version as 6.0" do
- allow(File).to receive(:read).with("/etc/redhat-release").and_return("Red Hat Enterprise Linux Server release 6.0 (Santiago)")
- expect(File).to receive(:read).with("/etc/oracle-release").and_return("Oracle Linux Server release 6.0")
+ allow(plugin).to receive(:file_read).with("/etc/redhat-release").and_return("Red Hat Enterprise Linux Server release 6.0 (Santiago)")
+ expect(plugin).to receive(:file_read).with("/etc/oracle-release").and_return("Oracle Linux Server release 6.0")
plugin.run
expect(plugin[:platform]).to eq("oracle")
expect(plugin[:platform_version]).to eq("6.0")
end
it "reads the platform as oracle and version as 6.1" do
- allow(File).to receive(:read).with("/etc/redhat-release").and_return("Red Hat Enterprise Linux Server release 6.1 (Santiago)")
- expect(File).to receive(:read).with("/etc/oracle-release").and_return("Oracle Linux Server release 6.1")
+ allow(plugin).to receive(:file_read).with("/etc/redhat-release").and_return("Red Hat Enterprise Linux Server release 6.1 (Santiago)")
+ expect(plugin).to receive(:file_read).with("/etc/oracle-release").and_return("Oracle Linux Server release 6.1")
plugin.run
expect(plugin[:platform]).to eq("oracle")
expect(plugin[:platform_version]).to eq("6.1")
@@ -719,7 +719,7 @@ describe Ohai::System, "Linux plugin platform" do
it "reads the platform as opensuse on openSUSE" do
plugin[:lsb][:release] = "12.1"
- expect(File).to receive(:read).with("/etc/SuSE-release").and_return("openSUSE 12.1 (x86_64)\nVERSION = 12.1\nCODENAME = Asparagus\n")
+ expect(plugin).to receive(:file_read).with("/etc/SuSE-release").and_return("openSUSE 12.1 (x86_64)\nVERSION = 12.1\nCODENAME = Asparagus\n")
plugin.run
expect(plugin[:platform]).to eq("opensuse")
expect(plugin[:platform_family]).to eq("suse")
@@ -736,14 +736,14 @@ describe Ohai::System, "Linux plugin platform" do
end
it "sets platform and platform_family to suse and bogus verion to 10.0" do
- expect(File).to receive(:read).with("/etc/SuSE-release").at_least(:once).and_return("VERSION = 10.0")
+ expect(plugin).to receive(:file_read).with("/etc/SuSE-release").at_least(:once).and_return("VERSION = 10.0")
plugin.run
expect(plugin[:platform]).to eq("suse")
expect(plugin[:platform_family]).to eq("suse")
end
it "reads the version as 11.2" do
- expect(File).to receive(:read).with("/etc/SuSE-release").and_return("SUSE Linux Enterprise Server 11.2 (i586)\nVERSION = 11\nPATCHLEVEL = 2\n")
+ expect(plugin).to receive(:file_read).with("/etc/SuSE-release").and_return("SUSE Linux Enterprise Server 11.2 (i586)\nVERSION = 11\nPATCHLEVEL = 2\n")
plugin.run
expect(plugin[:platform]).to eq("suse")
expect(plugin[:platform_version]).to eq("11.2")
@@ -751,7 +751,7 @@ describe Ohai::System, "Linux plugin platform" do
end
it "[OHAI-272] should read the version as 11.3" do
- expect(File).to receive(:read).with("/etc/SuSE-release").once.and_return("openSUSE 11.3 (x86_64)\nVERSION = 11.3")
+ expect(plugin).to receive(:file_read).with("/etc/SuSE-release").once.and_return("openSUSE 11.3 (x86_64)\nVERSION = 11.3")
plugin.run
expect(plugin[:platform]).to eq("opensuse")
expect(plugin[:platform_version]).to eq("11.3")
@@ -759,7 +759,7 @@ describe Ohai::System, "Linux plugin platform" do
end
it "[OHAI-272] should read the version as 11.4" do
- expect(File).to receive(:read).with("/etc/SuSE-release").once.and_return("openSUSE 11.4 (i586)\nVERSION = 11.4\nCODENAME = Celadon")
+ expect(plugin).to receive(:file_read).with("/etc/SuSE-release").once.and_return("openSUSE 11.4 (i586)\nVERSION = 11.4\nCODENAME = Celadon")
plugin.run
expect(plugin[:platform]).to eq("opensuse")
expect(plugin[:platform_version]).to eq("11.4")
@@ -767,14 +767,14 @@ describe Ohai::System, "Linux plugin platform" do
end
it "reads the platform as opensuse on openSUSE" do
- expect(File).to receive(:read).with("/etc/SuSE-release").and_return("openSUSE 12.2 (x86_64)\nVERSION = 12.2\nCODENAME = Mantis\n")
+ expect(plugin).to receive(:file_read).with("/etc/SuSE-release").and_return("openSUSE 12.2 (x86_64)\nVERSION = 12.2\nCODENAME = Mantis\n")
plugin.run
expect(plugin[:platform]).to eq("opensuse")
expect(plugin[:platform_family]).to eq("suse")
end
it "reads the platform as opensuseleap on openSUSE Leap" do
- expect(File).to receive(:read).with("/etc/SuSE-release").and_return("openSUSE 42.1 (x86_64)\nVERSION = 42.1\nCODENAME = Malachite\n")
+ expect(plugin).to receive(:file_read).with("/etc/SuSE-release").and_return("openSUSE 42.1 (x86_64)\nVERSION = 42.1\nCODENAME = Malachite\n")
plugin.run
expect(plugin[:platform]).to eq("opensuseleap")
expect(plugin[:platform_family]).to eq("suse")
@@ -797,7 +797,7 @@ describe Ohai::System, "Linux plugin platform" do
end
before do
- expect(File).to receive(:read).with("/usr/lib/os-release").and_return(usr_lib_os_release_content)
+ expect(plugin).to receive(:file_read).with("/usr/lib/os-release").and_return(usr_lib_os_release_content)
end
it "sets platform to clearlinux and platform_family to clearlinux" do
diff --git a/spec/unit/plugins/linux/selinux_spec.rb b/spec/unit/plugins/linux/selinux_spec.rb
new file mode 100644
index 00000000..6f8ceef4
--- /dev/null
+++ b/spec/unit/plugins/linux/selinux_spec.rb
@@ -0,0 +1,101 @@
+#
+# Author:: Davide Cavalca <dcavalca@fb.com>
+# Copyright:: Copyright (c) 2020 Facebook
+# License:: Apache License, Version 2.0
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+require "spec_helper"
+
+describe Ohai::System, "Linux selinux plugin" do
+ let(:plugin) { get_plugin("linux/selinux") }
+
+ before do
+ allow(plugin).to receive(:collect_os).and_return(:linux)
+ end
+
+ it "populates selinux if sestatus is found" do
+ sestatus_out = <<-SESTATUS_OUT
+SELinux status: enabled
+SELinuxfs mount: /sys/fs/selinux
+SELinux root directory: /etc/selinux
+Loaded policy name: test
+Current mode: permissive
+Mode from config file: permissive
+Policy MLS status: disabled
+Policy deny_unknown status: allowed
+Max kernel policy version: 31
+
+Policy booleans:
+secure_mode_policyload off
+
+Process contexts:
+Current context: user_u:base_r:admin_t
+Init context: system_u:system_r:init_t
+/usr/sbin/sshd system_u:base_r:base_t
+
+File contexts:
+Controlling terminal: system_u:object_r:file_t
+/etc/passwd user_u:object_r:file_t
+/etc/shadow user_u:object_r:file_t
+/bin/bash user_u:object_r:file_t
+/bin/login user_u:object_r:file_t
+/bin/sh user_u:object_r:file_t -> user_u:object_r:file_t
+/sbin/agetty user_u:object_r:file_t
+/sbin/init user_u:object_r:file_t -> user_u:object_r:init_exec_t
+/usr/sbin/sshd user_u:object_r:file_t
+ SESTATUS_OUT
+ allow(plugin).to receive(:which).with("sestatus").and_return("/usr/sbin/sestatus")
+ allow(plugin).to receive(:shell_out).with("/usr/sbin/sestatus -v -b").and_return(mock_shell_out(0, sestatus_out, ""))
+ plugin.run
+ expect(plugin[:selinux].to_hash).to eq({
+ "file_contexts" => {
+ "/bin/bash" => "user_u:object_r:file_t",
+ "/bin/login" => "user_u:object_r:file_t",
+ "/bin/sh" => "user_u:object_r:file_t -> user_u:object_r:file_t",
+ "/etc/passwd" => "user_u:object_r:file_t",
+ "/etc/shadow" => "user_u:object_r:file_t",
+ "/sbin/agetty" => "user_u:object_r:file_t",
+ "/sbin/init" => "user_u:object_r:file_t -> user_u:object_r:init_exec_t",
+ "/usr/sbin/sshd" => "user_u:object_r:file_t",
+ "controlling_terminal" => "system_u:object_r:file_t",
+ },
+ "policy_booleans" => {
+ "secure_mode_policyload" => "off",
+ },
+ "process_contexts" => {
+ "/usr/sbin/sshd" => "system_u:base_r:base_t",
+ "current_context" => "user_u:base_r:admin_t",
+ "init_context" => "system_u:system_r:init_t",
+ },
+ "status" => {
+ "current_mode" => "permissive",
+ "loaded_policy_name" => "test",
+ "max_kernel_policy_version" => "31",
+ "mode_from_config_file" => "permissive",
+ "policy_deny_unknown_status" => "allowed",
+ "policy_mls_status" => "disabled",
+ "selinux_root_directory" => "/etc/selinux",
+ "selinux_status" => "enabled",
+ "selinuxfs_mount" => "/sys/fs/selinux",
+ },
+ })
+ end
+
+ it "does not populate selinux if sestatus is not found" do
+ allow(plugin).to receive(:which).with("sestatus").and_return(false)
+ plugin.run
+ expect(plugin[:selinux]).to be(nil)
+ end
+end
diff --git a/spec/unit/plugins/linux/sysctl_spec.rb b/spec/unit/plugins/linux/sysctl_spec.rb
index b424fde1..a14eb76b 100644
--- a/spec/unit/plugins/linux/sysctl_spec.rb
+++ b/spec/unit/plugins/linux/sysctl_spec.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require_relative "../../../spec_helper.rb"
+require "spec_helper"
describe Ohai::System, "sysctl plugin", :unix_only do
let(:plugin) { get_plugin("linux/sysctl") }
diff --git a/spec/unit/plugins/linux/systemd_paths_spec.rb b/spec/unit/plugins/linux/systemd_paths_spec.rb
index 04bf4ade..5463f765 100644
--- a/spec/unit/plugins/linux/systemd_paths_spec.rb
+++ b/spec/unit/plugins/linux/systemd_paths_spec.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
+require "spec_helper"
describe Ohai::System, "Linux systemd paths plugin" do
let(:plugin) { get_plugin("linux/systemd_paths") }
diff --git a/spec/unit/plugins/linux/uptime_spec.rb b/spec/unit/plugins/linux/uptime_spec.rb
index 91132ae5..673fc67f 100644
--- a/spec/unit/plugins/linux/uptime_spec.rb
+++ b/spec/unit/plugins/linux/uptime_spec.rb
@@ -1,6 +1,6 @@
#
# Author:: Adam Jacob (<adam@chef.io>)
-# Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/spec/unit/plugins/linux/virtualization_spec.rb b/spec/unit/plugins/linux/virtualization_spec.rb
index ccd868a4..eeb12176 100644
--- a/spec/unit/plugins/linux/virtualization_spec.rb
+++ b/spec/unit/plugins/linux/virtualization_spec.rb
@@ -1,6 +1,6 @@
#
# Author:: Thom May (<thom@clearairturbulence.org>)
-# Copyright:: Copyright (c) 2009-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -24,23 +24,23 @@ describe Ohai::System, "Linux virtualization platform" do
before do
allow(plugin).to receive(:collect_os).and_return(:linux)
- # default to all requested Files not existing
- allow(File).to receive(:exist?).with("/proc/xen").and_return(false)
- allow(File).to receive(:exist?).with("/proc/xen/capabilities").and_return(false)
- allow(File).to receive(:exist?).with("/proc/modules").and_return(false)
- allow(File).to receive(:exist?).with("/proc/cpuinfo").and_return(false)
- allow(File).to receive(:exist?).with("/var/lib/hyperv/.kvp_pool_3").and_return(false)
- allow(File).to receive(:exist?).with("/proc/self/status").and_return(false)
- allow(File).to receive(:exist?).with("/proc/bc/0").and_return(false)
- allow(File).to receive(:exist?).with("/proc/vz").and_return(false)
- allow(File).to receive(:exist?).with("/proc/self/cgroup").and_return(false)
- allow(File).to receive(:exist?).with("/.dockerenv").and_return(false)
- allow(File).to receive(:exist?).with("/.dockerinit").and_return(false)
- allow(File).to receive(:exist?).with("/sys/devices/virtual/misc/kvm").and_return(false)
- allow(File).to receive(:exist?).with("/dev/lxd/sock").and_return(false)
- allow(File).to receive(:exist?).with("/var/lib/lxd/devlxd").and_return(false)
- allow(File).to receive(:exist?).with("/var/snap/lxd/common/lxd/devlxd").and_return(false)
- allow(File).to receive(:exist?).with("/proc/1/environ").and_return(false)
+ # default to all requested plugins not existing
+ allow(plugin).to receive(:file_exist?).with("/proc/xen").and_return(false)
+ allow(plugin).to receive(:file_exist?).with("/proc/xen/capabilities").and_return(false)
+ allow(plugin).to receive(:file_exist?).with("/proc/modules").and_return(false)
+ allow(plugin).to receive(:file_exist?).with("/proc/cpuinfo").and_return(false)
+ allow(plugin).to receive(:file_exist?).with("/var/lib/hyperv/.kvp_pool_3").and_return(false)
+ allow(plugin).to receive(:file_exist?).with("/proc/self/status").and_return(false)
+ allow(plugin).to receive(:file_exist?).with("/proc/bc/0").and_return(false)
+ allow(plugin).to receive(:file_exist?).with("/proc/vz").and_return(false)
+ allow(plugin).to receive(:file_exist?).with("/proc/self/cgroup").and_return(false)
+ allow(plugin).to receive(:file_exist?).with("/.dockerenv").and_return(false)
+ allow(plugin).to receive(:file_exist?).with("/.dockerinit").and_return(false)
+ allow(plugin).to receive(:file_exist?).with("/sys/devices/virtual/misc/kvm").and_return(false)
+ allow(plugin).to receive(:file_exist?).with("/dev/lxd/sock").and_return(false)
+ allow(plugin).to receive(:file_exist?).with("/var/lib/lxd/devlxd").and_return(false)
+ allow(plugin).to receive(:file_exist?).with("/var/snap/lxd/common/lxd/devlxd").and_return(false)
+ allow(plugin).to receive(:file_exist?).with("/proc/1/environ").and_return(false)
# default the which wrappers to nil
allow(plugin).to receive(:which).with("lxc-version").and_return(nil)
@@ -51,8 +51,8 @@ describe Ohai::System, "Linux virtualization platform" do
describe "when we are checking for xen" do
it "sets xen guest if /proc/xen exists but /proc/xen/capabilities does not" do
- expect(File).to receive(:exist?).with("/proc/xen").and_return(true)
- expect(File).to receive(:exist?).with("/proc/xen/capabilities").and_return(false)
+ expect(plugin).to receive(:file_exist?).with("/proc/xen").and_return(true)
+ expect(plugin).to receive(:file_exist?).with("/proc/xen/capabilities").and_return(false)
plugin.run
expect(plugin[:virtualization][:system]).to eq("xen")
expect(plugin[:virtualization][:role]).to eq("guest")
@@ -60,9 +60,9 @@ describe Ohai::System, "Linux virtualization platform" do
end
it "sets xen host if /proc/xen/capabilities contains control_d " do
- expect(File).to receive(:exist?).with("/proc/xen").and_return(true)
- expect(File).to receive(:exist?).with("/proc/xen/capabilities").and_return(true)
- allow(File).to receive(:read).with("/proc/xen/capabilities").and_return("control_d")
+ expect(plugin).to receive(:file_exist?).with("/proc/xen").and_return(true)
+ expect(plugin).to receive(:file_exist?).with("/proc/xen/capabilities").and_return(true)
+ allow(plugin).to receive(:file_read).with("/proc/xen/capabilities").and_return("control_d")
plugin.run
expect(plugin[:virtualization][:system]).to eq("xen")
expect(plugin[:virtualization][:role]).to eq("host")
@@ -70,9 +70,9 @@ describe Ohai::System, "Linux virtualization platform" do
end
it "sets xen guest if /proc/xen/capabilities exists but is empty" do
- expect(File).to receive(:exist?).with("/proc/xen").and_return(true)
- expect(File).to receive(:exist?).with("/proc/xen/capabilities").and_return(true)
- allow(File).to receive(:read).with("/proc/xen/capabilities").and_return("")
+ expect(plugin).to receive(:file_exist?).with("/proc/xen").and_return(true)
+ expect(plugin).to receive(:file_exist?).with("/proc/xen/capabilities").and_return(true)
+ allow(plugin).to receive(:file_read).with("/proc/xen/capabilities").and_return("")
plugin.run
expect(plugin[:virtualization][:system]).to eq("xen")
expect(plugin[:virtualization][:role]).to eq("guest")
@@ -80,7 +80,7 @@ describe Ohai::System, "Linux virtualization platform" do
end
it "does not set virtualization if xen isn't there" do
- expect(File).to receive(:exist?).at_least(:once).and_return(false)
+ expect(plugin).to receive(:file_exist?).at_least(:once).and_return(false)
plugin.run
expect(plugin[:virtualization]).to eq({ "systems" => {} })
end
@@ -108,8 +108,8 @@ describe Ohai::System, "Linux virtualization platform" do
describe "when we are checking for kvm" do
it "sets kvm guest if /sys/devices/virtual/misc/kvm exists & hypervisor cpu feature is present" do
- allow(File).to receive(:exist?).with("/sys/devices/virtual/misc/kvm").and_return(true)
- allow(File).to receive(:read).with("/proc/cpuinfo").and_return("fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss syscall nx rdtscp lm constant_tsc arch_perfmon rep_good nopl pni vmx ssse3 cx16 sse4_1 sse4_2 x2apic popcnt hypervisor lahf_lm vnmi ept tsc_adjust")
+ allow(plugin).to receive(:file_exist?).with("/sys/devices/virtual/misc/kvm").and_return(true)
+ allow(plugin).to receive(:file_read).with("/proc/cpuinfo").and_return("fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss syscall nx rdtscp lm constant_tsc arch_perfmon rep_good nopl pni vmx ssse3 cx16 sse4_1 sse4_2 x2apic popcnt hypervisor lahf_lm vnmi ept tsc_adjust")
plugin.run
expect(plugin[:virtualization][:system]).to eq("kvm")
expect(plugin[:virtualization][:role]).to eq("guest")
@@ -117,8 +117,8 @@ describe Ohai::System, "Linux virtualization platform" do
end
it "sets kvm host if /sys/devices/virtual/misc/kvm exists & hypervisor cpu feature is not present" do
- allow(File).to receive(:exist?).with("/sys/devices/virtual/misc/kvm").and_return(true)
- allow(File).to receive(:read).with("/proc/cpuinfo").and_return("fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm dca sse4_1 sse4_2 popcnt lahf_lm ida dtherm tpr_shadow vnmi flexpriority ept vpid")
+ allow(plugin).to receive(:file_exist?).with("/sys/devices/virtual/misc/kvm").and_return(true)
+ allow(plugin).to receive(:file_read).with("/proc/cpuinfo").and_return("fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm dca sse4_1 sse4_2 popcnt lahf_lm ida dtherm tpr_shadow vnmi flexpriority ept vpid")
plugin.run
expect(plugin[:virtualization][:system]).to eq("kvm")
expect(plugin[:virtualization][:role]).to eq("host")
@@ -126,8 +126,8 @@ describe Ohai::System, "Linux virtualization platform" do
end
it "sets kvm guest if /proc/cpuinfo contains QEMU Virtual CPU" do
- expect(File).to receive(:exist?).with("/proc/cpuinfo").and_return(true)
- allow(File).to receive(:read).with("/proc/cpuinfo").and_return("QEMU Virtual CPU")
+ expect(plugin).to receive(:file_exist?).with("/proc/cpuinfo").and_return(true)
+ allow(plugin).to receive(:file_read).with("/proc/cpuinfo").and_return("QEMU Virtual CPU")
plugin.run
expect(plugin[:virtualization][:system]).to eq("kvm")
expect(plugin[:virtualization][:role]).to eq("guest")
@@ -135,8 +135,8 @@ describe Ohai::System, "Linux virtualization platform" do
end
it "sets kvm guest if /proc/cpuinfo contains Common KVM processor" do
- expect(File).to receive(:exist?).with("/proc/cpuinfo").and_return(true)
- allow(File).to receive(:read).with("/proc/cpuinfo").and_return("Common KVM processor")
+ expect(plugin).to receive(:file_exist?).with("/proc/cpuinfo").and_return(true)
+ allow(plugin).to receive(:file_read).with("/proc/cpuinfo").and_return("Common KVM processor")
plugin.run
expect(plugin[:virtualization][:system]).to eq("kvm")
expect(plugin[:virtualization][:role]).to eq("guest")
@@ -144,8 +144,8 @@ describe Ohai::System, "Linux virtualization platform" do
end
it "sets kvm guest if /proc/cpuinfo contains Common 32-bit KVM processor" do
- expect(File).to receive(:exist?).with("/proc/cpuinfo").and_return(true)
- allow(File).to receive(:read).with("/proc/cpuinfo").and_return("Common 32-bit KVM processor")
+ expect(plugin).to receive(:file_exist?).with("/proc/cpuinfo").and_return(true)
+ allow(plugin).to receive(:file_read).with("/proc/cpuinfo").and_return("Common 32-bit KVM processor")
plugin.run
expect(plugin[:virtualization][:system]).to eq("kvm")
expect(plugin[:virtualization][:role]).to eq("guest")
@@ -153,7 +153,7 @@ describe Ohai::System, "Linux virtualization platform" do
end
it "does not set virtualization if kvm isn't there" do
- expect(File).to receive(:exist?).at_least(:once).and_return(false)
+ expect(plugin).to receive(:file_exist?).at_least(:once).and_return(false)
plugin.run
expect(plugin[:virtualization]).to eq({ "systems" => {} })
end
@@ -161,8 +161,8 @@ describe Ohai::System, "Linux virtualization platform" do
describe "when we are checking for VirtualBox" do
it "sets vbox host if /proc/modules contains vboxdrv" do
- expect(File).to receive(:exist?).with("/proc/modules").and_return(true)
- allow(File).to receive(:read).with("/proc/modules").and_return("vboxdrv 268268 3 vboxnetadp,vboxnetflt")
+ expect(plugin).to receive(:file_exist?).with("/proc/modules").and_return(true)
+ allow(plugin).to receive(:file_read).with("/proc/modules").and_return("vboxdrv 268268 3 vboxnetadp,vboxnetflt")
plugin.run
expect(plugin[:virtualization][:system]).to eq("vbox")
expect(plugin[:virtualization][:role]).to eq("host")
@@ -170,8 +170,8 @@ describe Ohai::System, "Linux virtualization platform" do
end
it "sets vbox gues if /proc/modules contains vboxguest" do
- expect(File).to receive(:exist?).with("/proc/modules").and_return(true)
- allow(File).to receive(:read).with("/proc/modules").and_return("vboxguest 214901 2 vboxsf, Live 0xffffffffa00db000 (OF)")
+ expect(plugin).to receive(:file_exist?).with("/proc/modules").and_return(true)
+ allow(plugin).to receive(:file_read).with("/proc/modules").and_return("vboxguest 214901 2 vboxsf, Live 0xffffffffa00db000 (OF)")
plugin.run
expect(plugin[:virtualization][:system]).to eq("vbox")
expect(plugin[:virtualization][:role]).to eq("guest")
@@ -179,7 +179,7 @@ describe Ohai::System, "Linux virtualization platform" do
end
it "does not set virtualization if vbox isn't there" do
- expect(File).to receive(:exist?).at_least(:once).and_return(false)
+ expect(plugin).to receive(:file_exist?).at_least(:once).and_return(false)
plugin.run
expect(plugin[:virtualization]).to eq({ "systems" => {} })
end
@@ -214,8 +214,8 @@ describe Ohai::System, "Linux virtualization platform" do
describe "when we are checking for Hyper-V guest and the hostname of the host" do
it "sets Hyper-V guest if /var/lib/hyperv/.kvp_pool_3 contains hyper_v.example.com" do
- expect(File).to receive(:exist?).with("/var/lib/hyperv/.kvp_pool_3").and_return(true)
- allow(File).to receive(:read).with("/var/lib/hyperv/.kvp_pool_3").and_return("HostNamehyper_v.example.comHostingSystemEditionId")
+ expect(plugin).to receive(:file_exist?).with("/var/lib/hyperv/.kvp_pool_3").and_return(true)
+ allow(plugin).to receive(:file_read).with("/var/lib/hyperv/.kvp_pool_3").and_return("HostNamehyper_v.example.comHostingSystemEditionId")
plugin.run
expect(plugin[:virtualization][:system]).to eq("hyperv")
expect(plugin[:virtualization][:role]).to eq("guest")
@@ -226,8 +226,8 @@ describe Ohai::System, "Linux virtualization platform" do
describe "when we are checking for Linux-VServer" do
it "sets Linux-VServer host if /proc/self/status contains s_context: 0" do
- expect(File).to receive(:exist?).with("/proc/self/status").and_return(true)
- allow(File).to receive(:read).with("/proc/self/status").and_return("s_context: 0")
+ expect(plugin).to receive(:file_exist?).with("/proc/self/status").and_return(true)
+ allow(plugin).to receive(:file_read).with("/proc/self/status").and_return("s_context: 0")
plugin.run
expect(plugin[:virtualization][:system]).to eq("linux-vserver")
expect(plugin[:virtualization][:role]).to eq("host")
@@ -235,8 +235,8 @@ describe Ohai::System, "Linux virtualization platform" do
end
it "sets Linux-VServer host if /proc/self/status contains VxID: 0" do
- expect(File).to receive(:exist?).with("/proc/self/status").and_return(true)
- allow(File).to receive(:read).with("/proc/self/status").and_return("VxID: 0")
+ expect(plugin).to receive(:file_exist?).with("/proc/self/status").and_return(true)
+ allow(plugin).to receive(:file_read).with("/proc/self/status").and_return("VxID: 0")
plugin.run
expect(plugin[:virtualization][:system]).to eq("linux-vserver")
expect(plugin[:virtualization][:role]).to eq("host")
@@ -244,8 +244,8 @@ describe Ohai::System, "Linux virtualization platform" do
end
it "sets Linux-VServer host if /proc/self/status contains multiple space VxID: 0" do
- expect(File).to receive(:exist?).with("/proc/self/status").and_return(true)
- allow(File).to receive(:read).with("/proc/self/status").and_return("VxID: 0")
+ expect(plugin).to receive(:file_exist?).with("/proc/self/status").and_return(true)
+ allow(plugin).to receive(:file_read).with("/proc/self/status").and_return("VxID: 0")
plugin.run
expect(plugin[:virtualization][:system]).to eq("linux-vserver")
expect(plugin[:virtualization][:role]).to eq("host")
@@ -253,8 +253,8 @@ describe Ohai::System, "Linux virtualization platform" do
end
it "sets Linux-VServer host if /proc/self/status contains tabbed VxID:\t0" do
- expect(File).to receive(:exist?).with("/proc/self/status").and_return(true)
- allow(File).to receive(:read).with("/proc/self/status").and_return("VxID:\t0")
+ expect(plugin).to receive(:file_exist?).with("/proc/self/status").and_return(true)
+ allow(plugin).to receive(:file_read).with("/proc/self/status").and_return("VxID:\t0")
plugin.run
expect(plugin[:virtualization][:system]).to eq("linux-vserver")
expect(plugin[:virtualization][:role]).to eq("host")
@@ -262,8 +262,8 @@ describe Ohai::System, "Linux virtualization platform" do
end
it "sets Linux-VServer guest if /proc/self/status contains s_context > 0" do
- expect(File).to receive(:exist?).with("/proc/self/status").and_return(true)
- allow(File).to receive(:read).with("/proc/self/status").and_return("s_context: 2")
+ expect(plugin).to receive(:file_exist?).with("/proc/self/status").and_return(true)
+ allow(plugin).to receive(:file_read).with("/proc/self/status").and_return("s_context: 2")
plugin.run
expect(plugin[:virtualization][:system]).to eq("linux-vserver")
expect(plugin[:virtualization][:role]).to eq("guest")
@@ -271,8 +271,8 @@ describe Ohai::System, "Linux virtualization platform" do
end
it "sets Linux-VServer guest if /proc/self/status contains VxID > 0" do
- expect(File).to receive(:exist?).with("/proc/self/status").and_return(true)
- allow(File).to receive(:read).with("/proc/self/status").and_return("VxID: 2")
+ expect(plugin).to receive(:file_exist?).with("/proc/self/status").and_return(true)
+ allow(plugin).to receive(:file_read).with("/proc/self/status").and_return("VxID: 2")
plugin.run
expect(plugin[:virtualization][:system]).to eq("linux-vserver")
expect(plugin[:virtualization][:role]).to eq("guest")
@@ -280,7 +280,7 @@ describe Ohai::System, "Linux virtualization platform" do
end
it "does not set virtualization if Linux-VServer isn't there" do
- expect(File).to receive(:exist?).at_least(:once).and_return(false)
+ expect(plugin).to receive(:file_exist?).at_least(:once).and_return(false)
plugin.run
expect(plugin[:virtualization]).to eq({ "systems" => {} })
end
@@ -288,7 +288,7 @@ describe Ohai::System, "Linux virtualization platform" do
describe "when we are checking for openvz" do
it "sets openvz host if /proc/bc/0 exists" do
- expect(File).to receive(:exist?).with("/proc/bc/0").and_return(true)
+ expect(plugin).to receive(:file_exist?).with("/proc/bc/0").and_return(true)
plugin.run
expect(plugin[:virtualization][:system]).to eq("openvz")
expect(plugin[:virtualization][:role]).to eq("host")
@@ -296,8 +296,8 @@ describe Ohai::System, "Linux virtualization platform" do
end
it "sets openvz guest if /proc/bc/0 does not exist and /proc/vz exists" do
- expect(File).to receive(:exist?).with("/proc/bc/0").and_return(false)
- expect(File).to receive(:exist?).with("/proc/vz").and_return(true)
+ expect(plugin).to receive(:file_exist?).with("/proc/bc/0").and_return(false)
+ expect(plugin).to receive(:file_exist?).with("/proc/vz").and_return(true)
plugin.run
expect(plugin[:virtualization][:system]).to eq("openvz")
expect(plugin[:virtualization][:role]).to eq("guest")
@@ -305,8 +305,8 @@ describe Ohai::System, "Linux virtualization platform" do
end
it "does not set virtualization if openvz isn't there" do
- expect(File).to receive(:exist?).with("/proc/bc/0").and_return(false)
- expect(File).to receive(:exist?).with("/proc/vz").and_return(false)
+ expect(plugin).to receive(:file_exist?).with("/proc/bc/0").and_return(false)
+ expect(plugin).to receive(:file_exist?).with("/proc/vz").and_return(false)
plugin.run
expect(plugin[:virtualization]).to eq({ "systems" => {} })
end
@@ -314,7 +314,7 @@ describe Ohai::System, "Linux virtualization platform" do
describe "when we are checking for lxd" do
it "sets lxc guest if /dev/lxd/sock exists" do
- expect(File).to receive(:exist?).with("/dev/lxd/sock").and_return(true)
+ expect(plugin).to receive(:file_exist?).with("/dev/lxd/sock").and_return(true)
plugin.run
expect(plugin[:virtualization][:system]).to eq("lxd")
@@ -322,7 +322,7 @@ describe Ohai::System, "Linux virtualization platform" do
end
it "sets lxd host if /var/lib/lxd/devlxd exists" do
- expect(File).to receive(:exist?).with("/var/lib/lxd/devlxd").and_return(true)
+ expect(plugin).to receive(:file_exist?).with("/var/lib/lxd/devlxd").and_return(true)
plugin.run
expect(plugin[:virtualization][:system]).to eq("lxd")
@@ -330,7 +330,7 @@ describe Ohai::System, "Linux virtualization platform" do
end
it "sets lxd host if /var/snap/lxd/common/lxd/devlxd exists" do
- expect(File).to receive(:exist?).with("/var/snap/lxd/common/lxd/devlxd").and_return(true)
+ expect(plugin).to receive(:file_exist?).with("/var/snap/lxd/common/lxd/devlxd").and_return(true)
plugin.run
expect(plugin[:virtualization][:system]).to eq("lxd")
@@ -350,8 +350,8 @@ describe Ohai::System, "Linux virtualization platform" do
2:cpu:/lxc/baa660ed81bc81d262ac6e19486142aeec5fce2043e2a173eb2505c6fbed89bc
1:cpuset:/
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)
+ expect(plugin).to receive(:file_exist?).with("/proc/self/cgroup").and_return(true)
+ allow(plugin).to receive(:file_read).with("/proc/self/cgroup").and_return(self_cgroup)
plugin.run
expect(plugin[:virtualization][:system]).to eq("lxc")
expect(plugin[:virtualization][:role]).to eq("guest")
@@ -369,8 +369,8 @@ describe Ohai::System, "Linux virtualization platform" do
2:cpu:/lxc/vanilla
1:cpuset:/lxc/vanilla
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)
+ expect(plugin).to receive(:file_exist?).with("/proc/self/cgroup").and_return(true)
+ allow(plugin).to receive(:file_read).with("/proc/self/cgroup").and_return(self_cgroup)
plugin.run
expect(plugin[:virtualization][:system]).to eq("lxc")
expect(plugin[:virtualization][:role]).to eq("guest")
@@ -388,9 +388,9 @@ describe Ohai::System, "Linux virtualization platform" do
2:cpu:/Charlie
1:cpuset:/Charlie
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)
+ allow(plugin).to receive(:file_read).with("/proc/1/environ").and_return("")
+ expect(plugin).to receive(:file_exist?).with("/proc/self/cgroup").and_return(true)
+ allow(plugin).to receive(:file_read).with("/proc/self/cgroup").and_return(self_cgroup)
plugin.run
expect(plugin[:virtualization]).to eq({ "systems" => {} })
end
@@ -407,9 +407,9 @@ describe Ohai::System, "Linux virtualization platform" do
2:cpu:/
1:cpuset:/
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("")
+ expect(plugin).to receive(:file_exist?).with("/proc/self/cgroup").and_return(true)
+ allow(plugin).to receive(:file_read).with("/proc/self/cgroup").and_return(self_cgroup)
+ allow(plugin).to receive(:file_read).with("/proc/1/environ").and_return("")
end
it "sets lxc host if lxc-version exists" do
@@ -447,7 +447,7 @@ describe Ohai::System, "Linux virtualization platform" do
it "sets lxc guest if /proc/1/environ has lxccontainer string in it" do
one_environ = "container=lxccontainer_ttys=/dev/pts/0 /dev/pts/1 /dev/pts/2 /dev/pts/3".chomp
- allow(File).to receive(:read).with("/proc/1/environ").and_return(one_environ)
+ allow(plugin).to receive(:file_read).with("/proc/1/environ").and_return(one_environ)
plugin.run
expect(plugin[:virtualization][:system]).to eq("lxc")
expect(plugin[:virtualization][:role]).to eq("guest")
@@ -456,7 +456,7 @@ describe Ohai::System, "Linux virtualization platform" do
end
it "does not set virtualization if /proc/self/cgroup isn't there" do
- expect(File).to receive(:exist?).with("/proc/self/cgroup").and_return(false)
+ expect(plugin).to receive(:file_exist?).with("/proc/self/cgroup").and_return(false)
plugin.run
expect(plugin[:virtualization]).to eq({ "systems" => {} })
end
@@ -464,10 +464,10 @@ describe Ohai::System, "Linux virtualization platform" do
describe "when we are checking for systemd-nspawn" do
it "sets nspawn guest if /proc/1/environ has nspawn string in it" do
- allow(File).to receive(:exist?).with("/proc/self/cgroup").and_return(true)
+ allow(plugin).to receive(:file_exist?).with("/proc/self/cgroup").and_return(true)
one_environ = "container=systemd-nspawn_ttys=/dev/pts/0 /dev/pts/1 /dev/pts/2 /dev/pts/3".chomp
- allow(File).to receive(:read).with("/proc/1/environ").and_return(one_environ)
- allow(File).to receive(:read).with("/proc/self/cgroup").and_return("")
+ allow(plugin).to receive(:file_read).with("/proc/1/environ").and_return(one_environ)
+ allow(plugin).to receive(:file_read).with("/proc/self/cgroup").and_return("")
plugin.run
expect(plugin[:virtualization][:system]).to eq("nspawn")
expect(plugin[:virtualization][:role]).to eq("guest")
@@ -486,8 +486,8 @@ describe Ohai::System, "Linux virtualization platform" do
2:cpu:/docker/baa660ed81bc81d262ac6e19486142aeec5fce2043e2a173eb2505c6fbed89bc
1:cpuset:/
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(plugin).to receive(:file_exist?).with("/proc/self/cgroup").and_return(true)
+ allow(plugin).to receive(:file_read).with("/proc/self/cgroup").and_return(self_cgroup)
plugin.run
expect(plugin[:virtualization][:system]).to eq("docker")
expect(plugin[:virtualization][:role]).to eq("guest")
@@ -505,8 +505,8 @@ describe Ohai::System, "Linux virtualization platform" do
2:cpu:/docker/vanilla
1:cpuset:/docker/vanilla
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(plugin).to receive(:file_exist?).with("/proc/self/cgroup").and_return(true)
+ allow(plugin).to receive(:file_read).with("/proc/self/cgroup").and_return(self_cgroup)
plugin.run
expect(plugin[:virtualization][:system]).to eq("docker")
expect(plugin[:virtualization][:role]).to eq("guest")
@@ -529,8 +529,8 @@ describe Ohai::System, "Linux virtualization platform" do
2:cpu:/docker-ce/docker/b15b85d19304436488a78d06afeb108d94b20bb6898d852b65cad51bd7dc9468
1:cpuset:/docker-ce/docker/b15b85d19304436488a78d06afeb108d94b20bb6898d852b65cad51bd7dc9468
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(plugin).to receive(:file_exist?).with("/proc/self/cgroup").and_return(true)
+ allow(plugin).to receive(:file_read).with("/proc/self/cgroup").and_return(self_cgroup)
plugin.run
expect(plugin[:virtualization][:system]).to eq("docker")
expect(plugin[:virtualization][:role]).to eq("guest")
@@ -550,8 +550,8 @@ describe Ohai::System, "Linux virtualization platform" do
2:cpu,cpuacct:/system.slice/docker-47341c91be8d491cb3b8a475ad5b4aef6e79bf728cbb351c384e4a6c410f172f.scope
1:name=systemd:/system.slice/docker-47341c91be8d491cb3b8a475ad5b4aef6e79bf728cbb351c384e4a6c410f172f.scope
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(plugin).to receive(:file_exist?).with("/proc/self/cgroup").and_return(true)
+ allow(plugin).to receive(:file_read).with("/proc/self/cgroup").and_return(self_cgroup)
plugin.run
expect(plugin[:virtualization][:system]).to eq("docker")
expect(plugin[:virtualization][:role]).to eq("guest")
@@ -569,9 +569,9 @@ describe Ohai::System, "Linux virtualization platform" do
2:cpu:/Charlie
1:cpuset:/Charlie
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("")
+ allow(plugin).to receive(:file_exist?).with("/proc/self/cgroup").and_return(true)
+ allow(plugin).to receive(:file_read).with("/proc/self/cgroup").and_return(self_cgroup)
+ allow(plugin).to receive(:file_read).with("/proc/1/environ").and_return("")
plugin.run
expect(plugin[:virtualization]).to eq({ "systems" => {} })
end
@@ -588,8 +588,8 @@ describe Ohai::System, "Linux virtualization platform" do
2:cpu:/
1:cpuset:/
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(plugin).to receive(:file_exist?).with("/proc/self/cgroup").and_return(true)
+ allow(plugin).to receive(:file_read).with("/proc/self/cgroup").and_return(self_cgroup)
plugin.run
expect(plugin[:virtualization]).to eq({ "systems" => {} })
end
@@ -613,13 +613,13 @@ describe Ohai::System, "Linux virtualization platform" do
end
it "does not set virtualization if /proc/self/cgroup isn't there" do
- allow(File).to receive(:exist?).with("/proc/self/cgroup").and_return(false)
+ allow(plugin).to receive(:file_exist?).with("/proc/self/cgroup").and_return(false)
plugin.run
expect(plugin[:virtualization]).to eq({ "systems" => {} })
end
it "sets virtualization if /.dockerenv exists" do
- allow(File).to receive(:exist?).with("/.dockerenv").and_return(true)
+ allow(plugin).to receive(:file_exist?).with("/.dockerenv").and_return(true)
plugin.run
expect(plugin[:virtualization][:system]).to eq("docker")
expect(plugin[:virtualization][:role]).to eq("guest")
@@ -627,7 +627,7 @@ describe Ohai::System, "Linux virtualization platform" do
end
it "sets virtualization if /.dockerinit exists" do
- allow(File).to receive(:exist?).with("/.dockerinit").and_return(true)
+ allow(plugin).to receive(:file_exist?).with("/.dockerinit").and_return(true)
plugin.run
expect(plugin[:virtualization][:system]).to eq("docker")
expect(plugin[:virtualization][:role]).to eq("guest")
@@ -635,8 +635,8 @@ describe Ohai::System, "Linux virtualization platform" do
end
it "does not set virtualization if /.dockerenv or /.dockerinit does not exists" do
- allow(File).to receive(:exist?).with("/.dockerenv").and_return(false)
- allow(File).to receive(:exist?).with("/.dockerinit").and_return(false)
+ allow(plugin).to receive(:file_exist?).with("/.dockerenv").and_return(false)
+ allow(plugin).to receive(:file_exist?).with("/.dockerinit").and_return(false)
plugin.run
expect(plugin[:virtualization]).to eq({ "systems" => {} })
end
diff --git a/spec/unit/plugins/lua_spec.rb b/spec/unit/plugins/lua_spec.rb
index 9d98109b..5510b102 100644
--- a/spec/unit/plugins/lua_spec.rb
+++ b/spec/unit/plugins/lua_spec.rb
@@ -2,7 +2,7 @@
# Author:: Doug MacEachern <dougm@vmware.com>
# Author:: Theodore Nordsieck (<theo@chef.io>)
# Copyright:: Copyright (c) 2009 VMware, Inc.
-# Copyright:: Copyright (c) 2013-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/spec/unit/plugins/netbsd/hostname_spec.rb b/spec/unit/plugins/netbsd/hostname_spec.rb
index 713fddbe..0a960d1a 100644
--- a/spec/unit/plugins/netbsd/hostname_spec.rb
+++ b/spec/unit/plugins/netbsd/hostname_spec.rb
@@ -1,6 +1,6 @@
#
# Author:: Adam Jacob (<adam@chef.io>)
-# Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/spec/unit/plugins/netbsd/kernel_spec.rb b/spec/unit/plugins/netbsd/kernel_spec.rb
index d6029d6d..4946ffd0 100644
--- a/spec/unit/plugins/netbsd/kernel_spec.rb
+++ b/spec/unit/plugins/netbsd/kernel_spec.rb
@@ -1,6 +1,6 @@
#
# Author:: Adam Jacob (<adam@chef.io>)
-# Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -25,7 +25,7 @@ describe Ohai::System, "NetBSD kernel plugin" do
allow(@plugin).to receive(:init_kernel).and_return({})
allow(@plugin).to receive(:shell_out).with("uname -i").and_return(mock_shell_out(0, "foo", ""))
allow(@plugin).to receive(:shell_out).with("sysctl kern.securelevel").and_return(mock_shell_out(0, "kern.securelevel: 1\n", ""))
- allow(@plugin).to receive(:shell_out).with((Ohai.abs_path( "/usr/bin/modstat" )).to_s).and_return(mock_shell_out(0, " 1 7 0xc0400000 97f830 kernel", ""))
+ allow(@plugin).to receive(:shell_out).with(Ohai.abs_path( "/usr/bin/modstat" ).to_s).and_return(mock_shell_out(0, " 1 7 0xc0400000 97f830 kernel", ""))
end
it "sets the kernel_os to the kernel_name value" do
diff --git a/spec/unit/plugins/netbsd/platform_spec.rb b/spec/unit/plugins/netbsd/platform_spec.rb
index 77524287..bc32d461 100644
--- a/spec/unit/plugins/netbsd/platform_spec.rb
+++ b/spec/unit/plugins/netbsd/platform_spec.rb
@@ -1,6 +1,6 @@
#
# Author:: Adam Jacob (<adam@chef.io>)
-# Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/spec/unit/plugins/nodejs_spec.rb b/spec/unit/plugins/nodejs_spec.rb
index 34768c74..ca4ac4b7 100644
--- a/spec/unit/plugins/nodejs_spec.rb
+++ b/spec/unit/plugins/nodejs_spec.rb
@@ -2,7 +2,7 @@
# Author:: Jacques Marneweck (<jacques@powertrip.co.za>)
# Author:: Theodore Nordsieck (<theo@chef.io>)
# Copyright:: Copyright (c) Jacques Marneweck
-# Copyright:: Copyright (c) 2013-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/spec/unit/plugins/ohai_spec.rb b/spec/unit/plugins/ohai_spec.rb
index e95d1ac1..b769b8ac 100644
--- a/spec/unit/plugins/ohai_spec.rb
+++ b/spec/unit/plugins/ohai_spec.rb
@@ -1,7 +1,7 @@
#
# Author:: Adam Jacob (<adam@chef.io>)
# Author:: Tollef Fog Heen <tfheen@err.no>
-# Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# Copyright:: Copyright (c) 2010 Tollef Fog Heen <tfheen@err.no>
# License:: Apache License, Version 2.0
#
diff --git a/spec/unit/plugins/ohai_time_spec.rb b/spec/unit/plugins/ohai_time_spec.rb
index ea5f2d66..af00224c 100644
--- a/spec/unit/plugins/ohai_time_spec.rb
+++ b/spec/unit/plugins/ohai_time_spec.rb
@@ -1,6 +1,6 @@
#
# Author:: Adam Jacob (<adam@chef.io>)
-# Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/spec/unit/plugins/openbsd/hostname_spec.rb b/spec/unit/plugins/openbsd/hostname_spec.rb
index 495e116a..0ed89787 100644
--- a/spec/unit/plugins/openbsd/hostname_spec.rb
+++ b/spec/unit/plugins/openbsd/hostname_spec.rb
@@ -1,6 +1,6 @@
#
# Author:: Adam Jacob (<adam@chef.io>)
-# Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/spec/unit/plugins/openbsd/kernel_spec.rb b/spec/unit/plugins/openbsd/kernel_spec.rb
index 89252563..77ca212e 100644
--- a/spec/unit/plugins/openbsd/kernel_spec.rb
+++ b/spec/unit/plugins/openbsd/kernel_spec.rb
@@ -1,6 +1,6 @@
#
# Author:: Adam Jacob (<adam@chef.io>)
-# Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/spec/unit/plugins/openbsd/platform_spec.rb b/spec/unit/plugins/openbsd/platform_spec.rb
index 9a626f1f..1d184c7e 100644
--- a/spec/unit/plugins/openbsd/platform_spec.rb
+++ b/spec/unit/plugins/openbsd/platform_spec.rb
@@ -1,6 +1,6 @@
#
# Author:: Adam Jacob (<adam@chef.io>)
-# Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/spec/unit/plugins/openstack_spec.rb b/spec/unit/plugins/openstack_spec.rb
index 7964aee1..9f0e843e 100644
--- a/spec/unit/plugins/openstack_spec.rb
+++ b/spec/unit/plugins/openstack_spec.rb
@@ -1,6 +1,6 @@
#
# Author:: Daniel DeLeo (dan@chef.io)
-# Copyright:: Copyright (c) 2014-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/spec/unit/plugins/os_spec.rb b/spec/unit/plugins/os_spec.rb
index 69882b64..0f7e6f88 100644
--- a/spec/unit/plugins/os_spec.rb
+++ b/spec/unit/plugins/os_spec.rb
@@ -2,7 +2,7 @@
# Author:: Adam Jacob (<adam@chef.io>)
# Author:: Richard Manyanza (<liseki@nyikacraftsmen.com>)
# Author:: Isa Farnik (<isa@chef.io>)
-# Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# Copyright:: Copyright (c) 2014 Richard Manyanza.
# License:: Apache License, Version 2.0
#
diff --git a/spec/unit/plugins/packages_spec.rb b/spec/unit/plugins/packages_spec.rb
index e4ad9015..0406aaac 100644
--- a/spec/unit/plugins/packages_spec.rb
+++ b/spec/unit/plugins/packages_spec.rb
@@ -350,4 +350,53 @@ describe Ohai::System, "plugin packages" do
expect(plugin[:packages]["mqm"][:version]).to eq("7.0.1.4")
end
end
+
+ context "when on darwin" do
+ let(:plugin) { get_plugin("packages") }
+
+ let(:stdout) do
+ File.read(File.join(SPEC_PLUGIN_PATH, "system_profiler_spapplicationsdatatype.output"))
+ end
+
+ before do
+ allow(plugin).to receive(:collect_os).and_return(:darwin)
+ allow(plugin).to receive(:shell_out).with("system_profiler SPApplicationsDataType -xml").and_return(mock_shell_out(0, stdout, ""))
+ plugin.run
+ end
+
+ it "calls system_profiler SPApplicationsDataType -xml" do
+ expect(plugin).to receive(:shell_out)
+ .with("system_profiler SPApplicationsDataType -xml")
+ .and_return(mock_shell_out(0, stdout, ""))
+ plugin.run
+ end
+
+ # apple
+ it "gets 'Install macOS Catalina' details" do
+ expect(plugin[:packages]["Install macOS Catalina"][:version]).to eq("15.6.00")
+ expect(plugin[:packages]["Install macOS Catalina"][:source]).to eq("apple")
+ expect(plugin[:packages]["Install macOS Catalina"][:lastmodified].to_s).to eq("2020-09-04T04:54:33+00:00")
+ end
+
+ # app store
+ it "gets 'Slack' details" do
+ expect(plugin[:packages]["Slack"][:version]).to eq("4.8.0")
+ expect(plugin[:packages]["Slack"][:source]).to eq("mac_app_store")
+ expect(plugin[:packages]["Slack"][:lastmodified].to_s).to eq("2020-08-12T22:24:32+00:00")
+ end
+
+ # chef
+ it "gets 'Chef Workstation' details" do
+ expect(plugin[:packages]["Chef Workstation App"][:version]).to eq("0.1.82")
+ expect(plugin[:packages]["Chef Workstation App"][:source]).to eq("identified_developer")
+ expect(plugin[:packages]["Chef Workstation App"][:lastmodified].to_s).to eq("2020-09-03T03:16:22+00:00")
+ end
+
+ # homebrew
+ it "gets 'Emacs' details" do
+ expect(plugin[:packages]["Emacs"][:version]).to eq("27.1")
+ expect(plugin[:packages]["Emacs"][:source]).to eq("unknown")
+ expect(plugin[:packages]["Emacs"][:lastmodified].to_s).to eq("2020-08-19T07:08:51+00:00")
+ end
+ end
end
diff --git a/spec/unit/plugins/passwd_spec.rb b/spec/unit/plugins/passwd_spec.rb
index c84e27cb..c5cfcf69 100644
--- a/spec/unit/plugins/passwd_spec.rb
+++ b/spec/unit/plugins/passwd_spec.rb
@@ -1,6 +1,6 @@
#
# License:: Apache License, Version 2.0
-# Copyright:: 2019 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -16,50 +16,243 @@
#
require "spec_helper"
+require "json"
-describe Ohai::System, "plugin etc", :unix_only do
- let(:plugin) { get_plugin("passwd") }
+describe Ohai::System, "plugin etc" do
+ context "when on posix", :unix_only do
+ let(:plugin) { get_plugin("passwd") }
- PasswdEntry = Struct.new(:name, :uid, :gid, :dir, :shell, :gecos)
- GroupEntry = Struct.new(:name, :gid, :mem)
+ PasswdEntry = Struct.new(:name, :uid, :gid, :dir, :shell, :gecos)
+ GroupEntry = Struct.new(:name, :gid, :mem)
- it "includes a list of all users" do
- expect(Etc).to receive(:passwd).and_yield(PasswdEntry.new("root", 1, 1, "/root", "/bin/zsh", "BOFH"))
- .and_yield(PasswdEntry.new("www", 800, 800, "/var/www", "/bin/false", "Serving the web since 1970"))
- plugin.run
- expect(plugin[:etc][:passwd]["root"]).to eq(Mash.new(shell: "/bin/zsh", gecos: "BOFH", gid: 1, uid: 1, dir: "/root"))
- expect(plugin[:etc][:passwd]["www"]).to eq(Mash.new(shell: "/bin/false", gecos: "Serving the web since 1970", gid: 800, uid: 800, dir: "/var/www"))
- end
+ it "includes a list of all users" do
+ expect(Etc).to receive(:passwd).and_yield(PasswdEntry.new("root", 1, 1, "/root", "/bin/zsh", "BOFH"))
+ .and_yield(PasswdEntry.new("www", 800, 800, "/var/www", "/bin/false", "Serving the web since 1970"))
+ plugin.run
+ expect(plugin[:etc][:passwd]["root"]).to eq(Mash.new(shell: "/bin/zsh", gecos: "BOFH", gid: 1, uid: 1, dir: "/root"))
+ expect(plugin[:etc][:passwd]["www"]).to eq(Mash.new(shell: "/bin/false", gecos: "Serving the web since 1970", gid: 800, uid: 800, dir: "/var/www"))
+ end
- it "ignores duplicate users" do
- expect(Etc).to receive(:passwd).and_yield(PasswdEntry.new("root", 1, 1, "/root", "/bin/zsh", "BOFH"))
- .and_yield(PasswdEntry.new("root", 1, 1, "/", "/bin/false", "I do not belong"))
- plugin.run
- expect(plugin[:etc][:passwd]["root"]).to eq(Mash.new(shell: "/bin/zsh", gecos: "BOFH", gid: 1, uid: 1, dir: "/root"))
- end
+ it "ignores duplicate users" do
+ expect(Etc).to receive(:passwd).and_yield(PasswdEntry.new("root", 1, 1, "/root", "/bin/zsh", "BOFH"))
+ .and_yield(PasswdEntry.new("root", 1, 1, "/", "/bin/false", "I do not belong"))
+ plugin.run
+ expect(plugin[:etc][:passwd]["root"]).to eq(Mash.new(shell: "/bin/zsh", gecos: "BOFH", gid: 1, uid: 1, dir: "/root"))
+ end
- it "sets the current user" do
- expect(Process).to receive(:euid).and_return("31337")
- expect(Etc).to receive(:getpwuid).and_return(PasswdEntry.new("chef", 31337, 31337, "/home/chef", "/bin/ksh", "Julia Child"))
- plugin.run
- expect(plugin[:current_user]).to eq("chef")
- end
+ it "sets the current user" do
+ expect(Process).to receive(:euid).and_return("31337")
+ expect(Etc).to receive(:getpwuid).and_return(PasswdEntry.new("chef", 31337, 31337, "/home/chef", "/bin/ksh", "Julia Child"))
+ plugin.run
+ expect(plugin[:current_user]).to eq("chef")
+ end
+
+ it "sets the available groups" do
+ expect(Etc).to receive(:group).and_yield(GroupEntry.new("admin", 100, %w{root chef})).and_yield(GroupEntry.new("www", 800, %w{www deploy}))
+ plugin.run
+ expect(plugin[:etc][:group]["admin"]).to eq(Mash.new(gid: 100, members: %w{root chef}))
+ expect(plugin[:etc][:group]["www"]).to eq(Mash.new(gid: 800, members: %w{www deploy}))
+ end
- it "sets the available groups" do
- expect(Etc).to receive(:group).and_yield(GroupEntry.new("admin", 100, %w{root chef})).and_yield(GroupEntry.new("www", 800, %w{www deploy}))
- plugin.run
- expect(plugin[:etc][:group]["admin"]).to eq(Mash.new(gid: 100, members: %w{root chef}))
- expect(plugin[:etc][:group]["www"]).to eq(Mash.new(gid: 800, members: %w{www deploy}))
+ if "".respond_to?(:force_encoding)
+ it "sets the encoding of strings to the default external encoding" do
+ fields = ["root", 1, 1, "/root", "/bin/zsh", "BOFH"]
+ fields.each { |f| f.force_encoding(Encoding::ASCII_8BIT) if f.respond_to?(:force_encoding) }
+ allow(Etc).to receive(:passwd).and_yield(PasswdEntry.new(*fields))
+ plugin.run
+ root = plugin[:etc][:passwd]["root"]
+ expect(root["gecos"].encoding).to eq(Encoding.default_external)
+ end
+ end
end
- if "".respond_to?(:force_encoding)
- it "sets the encoding of strings to the default external encoding" do
- fields = ["root", 1, 1, "/root", "/bin/zsh", "BOFH"]
- fields.each { |f| f.force_encoding(Encoding::ASCII_8BIT) if f.respond_to?(:force_encoding) }
- allow(Etc).to receive(:passwd).and_yield(PasswdEntry.new(*fields))
+ context "when on windows", :windows_only do
+ let(:plugin) do
+ get_plugin("passwd").tap do |plugin|
+ plugin[:platform_family] = "windows"
+ end
+ end
+
+ USERS = [
+ {
+ "AccountType" => 512,
+ "Disabled" => false,
+ "Name" => "userone",
+ "FullName" => "User One",
+ "SID" => "bla bla bla",
+ "SIDType" => 1,
+ "Status" => "OK",
+ },
+ {
+ "AccountType" => 512,
+ "Disabled" => false,
+ "FullName" => "User Two",
+ "Name" => "usertwo",
+ "SID" => "bla bla bla2",
+ "SIDType" => 1,
+ "Status" => "OK",
+ },
+ ].freeze
+
+ GROUPS = [
+ {
+ "Description" => "Group One",
+ "Domain" => "THIS-MACHINE",
+ "Name" => "GroupOne",
+ "SID" => "foo foo foo",
+ "SidType" => 4,
+ "Status" => "OK",
+ },
+ {
+ "Description" => "Group Two",
+ "Domain" => "THIS-MACHINE",
+ "Name" => "GroupTwo",
+ "SID" => "foo foo foo2",
+ "SidType" => 4,
+ "Status" => "OK",
+ },
+ ].freeze
+
+ GROUP_ONE_MEMBERS = [
+ {
+ "groupcomponent" => "Win32_Group.Domain=\"THIS-MACHINE\",Name=\"GroupOne\"",
+ "partcomponent" => "\\\\VCRS-PRODWIN05\\root\\cimv2:Win32_UserAccount.Domain=\"THIS-MACHINE\",Name=\"UserOne\"",
+ },
+ {
+ "groupcomponent" => "Win32_Group.Domain=\"THIS-MACHINE\",Name=\"GroupOne\"",
+ "partcomponent" => "\\\\VCRS-PRODWIN05\\root\\cimv2:Win32_UserAccount.Domain=\"THIS-MACHINE\",Name=\"UserTwo\"",
+ },
+ ].freeze
+
+ GROUP_TWO_MEMBERS = [
+ {
+ "groupcomponent" => "Win32_Group.Domain=\"THIS-MACHINE\",Name=\"GroupOne\"",
+ "partcomponent" => "\\\\VCRS-PRODWIN05\\root\\cimv2:Win32_SystemAccount.Domain=\"THIS-MACHINE\",Name=\"GroupOne\"",
+ },
+ ].freeze
+
+ before do
+ require "wmi-lite/wmi" unless defined?(WmiLite::Wmi)
+ properties = USERS[0].map { |k, v| double(name: k) }
+ wmi_user_list = USERS.map do |user|
+ wmi_ole_object = double properties_: properties
+ user.each do |key, val|
+ allow(wmi_ole_object).to receive(:invoke).with(key).and_return(val)
+ end
+ WmiLite::Wmi::Instance.new(wmi_ole_object)
+ end
+ allow_any_instance_of(WmiLite::Wmi).to receive(:query)
+ .with("SELECT * FROM Win32_UserAccount WHERE LocalAccount = True")
+ .and_return(wmi_user_list)
+
+ properties = GROUPS[0].map { |k, v| double(name: k) }
+ wmi_group_list = GROUPS.map do |group|
+ wmi_ole_object = double properties_: properties
+ group.each do |key, val|
+ allow(wmi_ole_object).to receive(:invoke).with(key).and_return(val)
+ end
+ WmiLite::Wmi::Instance.new(wmi_ole_object)
+ end
+ allow_any_instance_of(WmiLite::Wmi).to receive(:query)
+ .with("SELECT * FROM Win32_Group WHERE LocalAccount = True")
+ .and_return(wmi_group_list)
+
+ end
+
+ def transform(user_data)
+ Hash[
+ user_data.map do |key, val|
+ [key.downcase, val]
+ end
+ ]
+ end
+
+ it "returns lower-cased passwd keys for each local user" do
+ allow_any_instance_of(WmiLite::Wmi).to receive(:query)
+ .with("SELECT * FROM Win32_GroupUser WHERE GroupComponent=\"Win32_Group.Domain='THIS-MACHINE',Name='GroupOne'\"")
+ .and_return([])
+
+ allow_any_instance_of(WmiLite::Wmi).to receive(:query)
+ .with("SELECT * FROM Win32_GroupUser WHERE GroupComponent=\"Win32_Group.Domain='THIS-MACHINE',Name='GroupTwo'\"")
+ .and_return([])
+
+ plugin.run
+ expect(plugin[:etc][:passwd].keys.sort).to eq(%w{userone usertwo}.sort)
+ end
+
+ it "returns preserved-case passwd entries for local users" do
+ allow_any_instance_of(WmiLite::Wmi).to receive(:query)
+ .with("SELECT * FROM Win32_GroupUser WHERE GroupComponent=\"Win32_Group.Domain='THIS-MACHINE',Name='GroupOne'\"")
+ .and_return([])
+
+ allow_any_instance_of(WmiLite::Wmi).to receive(:query)
+ .with("SELECT * FROM Win32_GroupUser WHERE GroupComponent=\"Win32_Group.Domain='THIS-MACHINE',Name='GroupTwo'\"")
+ .and_return([])
+
+ plugin.run
+ expect(plugin[:etc][:passwd]["userone"]).to eq(transform(USERS[0]))
+ end
+
+ it "returns lower-cased group entries for each local group" do
+ allow_any_instance_of(WmiLite::Wmi).to receive(:query)
+ .with("SELECT * FROM Win32_GroupUser WHERE GroupComponent=\"Win32_Group.Domain='THIS-MACHINE',Name='GroupOne'\"")
+ .and_return([])
+
+ allow_any_instance_of(WmiLite::Wmi).to receive(:query)
+ .with("SELECT * FROM Win32_GroupUser WHERE GroupComponent=\"Win32_Group.Domain='THIS-MACHINE',Name='GroupTwo'\"")
+ .and_return([])
+
+ plugin.run
+ expect(plugin[:etc][:group].keys.sort).to eq(%w{groupone grouptwo}.sort)
+ end
+
+ it "returns preserved-cased group entries for local groups" do
+ allow_any_instance_of(WmiLite::Wmi).to receive(:query)
+ .with("SELECT * FROM Win32_GroupUser WHERE GroupComponent=\"Win32_Group.Domain='THIS-MACHINE',Name='GroupOne'\"")
+ .and_return([])
+
+ allow_any_instance_of(WmiLite::Wmi).to receive(:query)
+ .with("SELECT * FROM Win32_GroupUser WHERE GroupComponent=\"Win32_Group.Domain='THIS-MACHINE',Name='GroupTwo'\"")
+ .and_return([])
+
+ plugin.run
+ expect(plugin[:etc][:group]["grouptwo"]).to eq(
+ transform(GROUPS[1]).merge({ "members" => [] })
+ )
+ end
+
+ it "returns members for groups" do
+ properties = GROUP_ONE_MEMBERS[0].map { |k, v| double(name: k) }
+ g1_members = GROUP_ONE_MEMBERS.map do |member|
+ wmi_ole_object = double properties_: properties
+ member.each do |key, val|
+ allow(wmi_ole_object).to receive(:invoke).with(key).and_return(val)
+ end
+ WmiLite::Wmi::Instance.new(wmi_ole_object)
+ end
+ allow_any_instance_of(WmiLite::Wmi).to receive(:query)
+ .with("SELECT * FROM Win32_GroupUser WHERE GroupComponent=\"Win32_Group.Domain='THIS-MACHINE',Name='GroupOne'\"")
+ .and_return(g1_members)
+
+ g2_members = GROUP_TWO_MEMBERS.map do |member|
+ wmi_ole_object = double properties_: properties
+ member.each do |key, val|
+ allow(wmi_ole_object).to receive(:invoke).with(key).and_return(val)
+ end
+ WmiLite::Wmi::Instance.new(wmi_ole_object)
+ end
+ allow_any_instance_of(WmiLite::Wmi).to receive(:query)
+ .with("SELECT * FROM Win32_GroupUser WHERE GroupComponent=\"Win32_Group.Domain='THIS-MACHINE',Name='GroupTwo'\"")
+ .and_return(g2_members)
+
plugin.run
- root = plugin[:etc][:passwd]["root"]
- expect(root["gecos"].encoding).to eq(Encoding.default_external)
+ expect(plugin[:etc][:group]["groupone"]["members"]).to eq([
+ { "name" => "UserOne", "type" => :user },
+ { "name" => "UserTwo", "type" => :user },
+ ])
+ expect(plugin[:etc][:group]["grouptwo"]["members"]).to eq([
+ { "name" => "GroupOne", "type" => :group },
+ ])
end
end
end
diff --git a/spec/unit/plugins/perl_spec.rb b/spec/unit/plugins/perl_spec.rb
index 5c55906e..1b909f81 100644
--- a/spec/unit/plugins/perl_spec.rb
+++ b/spec/unit/plugins/perl_spec.rb
@@ -1,7 +1,7 @@
#
# Author:: Joshua Timberman(<joshua@chef.io>)
# Author:: Theodore Nordsieck (<theo@chef.io>)
-# Copyright:: Copyright (c) 2009-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/spec/unit/plugins/php_spec.rb b/spec/unit/plugins/php_spec.rb
index 7ec373da..89a32eef 100644
--- a/spec/unit/plugins/php_spec.rb
+++ b/spec/unit/plugins/php_spec.rb
@@ -2,7 +2,7 @@
# Author:: Doug MacEachern <dougm@vmware.com>
# Author:: Theodore Nordsieck (<theo@chef.io>)
# Copyright:: Copyright (c) 2009 VMware, Inc.
-# Copyright:: Copyright (c) 2013-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/spec/unit/plugins/platform_spec.rb b/spec/unit/plugins/platform_spec.rb
index 6c30a1bf..d662b1e1 100644
--- a/spec/unit/plugins/platform_spec.rb
+++ b/spec/unit/plugins/platform_spec.rb
@@ -1,6 +1,6 @@
#
# Author:: Adam Jacob (<adam@chef.io>)
-# Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/spec/unit/plugins/powershell_spec.rb b/spec/unit/plugins/powershell_spec.rb
index e391efba..fece85de 100644
--- a/spec/unit/plugins/powershell_spec.rb
+++ b/spec/unit/plugins/powershell_spec.rb
@@ -1,5 +1,5 @@
#
-# Copyright:: Copyright (c) 2014 Chef Software, Inc
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/spec/unit/plugins/python_spec.rb b/spec/unit/plugins/python_spec.rb
index 353beadc..ef59d15c 100644
--- a/spec/unit/plugins/python_spec.rb
+++ b/spec/unit/plugins/python_spec.rb
@@ -1,7 +1,7 @@
#
# Author:: Adam Jacob (<adam@chef.io>)
# Author:: Theodore Nordsieck (<theo@chef.io>)
-# Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/spec/unit/plugins/ruby_spec.rb b/spec/unit/plugins/ruby_spec.rb
index b634f124..0af2226c 100644
--- a/spec/unit/plugins/ruby_spec.rb
+++ b/spec/unit/plugins/ruby_spec.rb
@@ -1,6 +1,6 @@
#
# Author:: Adam Jacob (<adam@chef.io>)
-# Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/spec/unit/plugins/scaleway_spec.rb b/spec/unit/plugins/scaleway_spec.rb
index 713a8312..1869322a 100644
--- a/spec/unit/plugins/scaleway_spec.rb
+++ b/spec/unit/plugins/scaleway_spec.rb
@@ -22,7 +22,7 @@ describe Ohai::System, "plugin scaleway" do
before do
allow(plugin).to receive(:hint?).with("scaleway").and_return(false)
- allow(File).to receive(:read).with("/proc/cmdline").and_return(false)
+ allow(plugin).to receive(:file_exist?).with("/proc/cmdline").and_return(false)
end
shared_examples_for "!scaleway" do
@@ -84,7 +84,8 @@ describe Ohai::System, "plugin scaleway" do
describe "with scaleway cmdline" do
before do
- allow(File).to receive(:read).with("/proc/cmdline").and_return("initrd=initrd showopts console=ttyS0,115200 nousb vga=0 root=/dev/vda scaleway boot=local")
+ allow(plugin).to receive(:file_exist?).with("/proc/cmdline").and_return(true)
+ allow(plugin).to receive(:file_read).with("/proc/cmdline").and_return("initrd=initrd showopts console=ttyS0,115200 nousb vga=0 root=/dev/vda scaleway boot=local")
end
it_behaves_like "scaleway"
diff --git a/spec/unit/plugins/shells_spec.rb b/spec/unit/plugins/shells_spec.rb
index f70218e6..4116f325 100644
--- a/spec/unit/plugins/shells_spec.rb
+++ b/spec/unit/plugins/shells_spec.rb
@@ -32,17 +32,18 @@ describe Ohai::System, "plugin shells" do
"/bin/tcsh\n",
"/bin/zsh\n"]
- let(:shell_file_content) { shell_file }
+ let(:shell_file_content) { shell_file.join }
it "does not set shells attribute if /etc/shells does not exist" do
- allow(::File).to receive(:exist?).with("/etc/shells").and_return(false)
+ allow(plugin).to receive(:file_exist?).with("/etc/shells").and_return(false)
plugin.run
expect(plugin).not_to have_key(:shells)
end
it "sets shells to an array of shells if /etc/shells exists" do
- allow(::File).to receive(:readlines).with("/etc/shells").and_return(shell_file_content)
- allow(::File).to receive(:exist?).with("/etc/shells").and_return(true)
+ allow(plugin).to receive(:file_open).with("/etc/shells").and_return(StringIO.new(shell_file_content))
+ allow(plugin).to receive(:file_exist?).and_call_original
+ allow(plugin).to receive(:file_exist?).with("/etc/shells").and_return(true)
plugin.run
expect(plugin.shells).to match_array([
"/bin/bash",
diff --git a/spec/unit/plugins/solaris2/dmi_spec.rb b/spec/unit/plugins/solaris2/dmi_spec.rb
index fcc2225e..418f1fd1 100644
--- a/spec/unit/plugins/solaris2/dmi_spec.rb
+++ b/spec/unit/plugins/solaris2/dmi_spec.rb
@@ -1,6 +1,6 @@
#
# Author:: Thom May (<thom@chef.io>)
-# Copyright:: Copyright (c) 2015 Chef Software
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/spec/unit/plugins/solaris2/filesystem.rb b/spec/unit/plugins/solaris2/filesystem.rb
index b1cce7fa..50f4ac0e 100644
--- a/spec/unit/plugins/solaris2/filesystem.rb
+++ b/spec/unit/plugins/solaris2/filesystem.rb
@@ -1,5 +1,5 @@
#
-# Copyright:: Copyright (c) 2015-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,7 +15,7 @@
# limitations under the License.
#
-require_relative "spec_helper"
+require "spec_helper"
describe Ohai::System, "Solaris2.X filesystem plugin" do
let(:plugin) { get_plugin("filesystem") }
diff --git a/spec/unit/plugins/solaris2/hostname_spec.rb b/spec/unit/plugins/solaris2/hostname_spec.rb
index a8db9478..390b5e45 100644
--- a/spec/unit/plugins/solaris2/hostname_spec.rb
+++ b/spec/unit/plugins/solaris2/hostname_spec.rb
@@ -24,7 +24,7 @@ describe Ohai::System, "Solaris2.X hostname plugin" do
allow(@plugin).to receive(:collect_os).and_return(:solaris2)
allow(@plugin).to receive(:resolve_fqdn).and_return("kitteh.inurfridge.eatinurfoodz")
allow(@plugin).to receive(:shell_out).with("hostname").and_return(mock_shell_out(0, "kitteh\n", ""))
-# Socket.stub(:getaddrinfo).and_return( [["AF_INET", 0, "kitteh.inurfridge.eatinurfoodz", "10.1.2.3", 2, 0, 0]] );
+ # Socket.stub(:getaddrinfo).and_return( [["AF_INET", 0, "kitteh.inurfridge.eatinurfoodz", "10.1.2.3", 2, 0, 0]] );
end
it_should_check_from("solaris2::hostname", "hostname", "hostname", "kitteh")
diff --git a/spec/unit/plugins/solaris2/platform_spec.rb b/spec/unit/plugins/solaris2/platform_spec.rb
index 3a1560a3..d52c0986 100644
--- a/spec/unit/plugins/solaris2/platform_spec.rb
+++ b/spec/unit/plugins/solaris2/platform_spec.rb
@@ -1,6 +1,6 @@
#
# Author:: Trevor O (<trevoro@joyent.com>)
-# Copyright:: Copyright (c) 2009-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -19,10 +19,11 @@
require "spec_helper"
describe Ohai::System, "Solaris plugin platform" do
+ let(:plugin) { get_plugin("solaris2/platform") }
+
before do
- @plugin = get_plugin("solaris2/platform")
- allow(@plugin).to receive(:collect_os).and_return(:solaris2)
- allow(@plugin).to receive(:shell_out).with("/sbin/uname -X")
+ allow(plugin).to receive(:collect_os).and_return(:solaris2)
+ allow(plugin).to receive(:shell_out).with("/sbin/uname -X")
end
describe "on SmartOS" do
@@ -42,25 +43,23 @@ describe Ohai::System, "Solaris plugin platform" do
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, ""))
+ allow(plugin).to receive(:shell_out).with("/sbin/uname -X").and_return(mock_shell_out(0, @uname_x, ""))
@release = StringIO.new(" SmartOS 20120130T201844Z x86_64\n")
allow(File).to receive(:open).with("/etc/release").and_yield(@release)
+ plugin.run
end
it "runs uname and set platform and build" do
- @plugin.run
- expect(@plugin[:platform_build]).to eq("joyent_20120130T201844Z")
+ expect(plugin[:platform_build]).to eq("joyent_20120130T201844Z")
end
it "sets the platform" do
- @plugin.run
- expect(@plugin[:platform]).to eq("smartos")
+ expect(plugin[:platform]).to eq("smartos")
end
it "sets the platform_version" do
- @plugin.run
- expect(@plugin[:platform_version]).to eq("5.11")
+ expect(plugin[:platform_version]).to eq("5.11")
end
end
@@ -82,25 +81,132 @@ describe Ohai::System, "Solaris plugin platform" do
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, ""))
+ allow(plugin).to receive(:shell_out).with("/sbin/uname -X").and_return(mock_shell_out(0, @uname_x, ""))
@release = StringIO.new(" Oracle Solaris 11.1 X86\n")
allow(File).to receive(:open).with("/etc/release").and_yield(@release)
+ plugin.run
+ end
+
+ it "runs uname and set platform and build" do
+ expect(plugin[:platform_build]).to eq("11.1")
+ end
+
+ it "sets the platform" do
+ expect(plugin[:platform]).to eq("solaris2")
+ end
+
+ it "sets the platform_version" do
+ expect(plugin[:platform_version]).to eq("5.11")
+ end
+
+ end
+
+ describe "on OmniOS" do
+ before do
+ @uname_x = <<~UNAME_X
+ System = SunOS
+ Node = omniosce-vagrant
+ Release = 5.11
+ KernelID = omnios-r151026-673c59f55d
+ Machine = i86pc
+ BusType = <unknown>
+ Serial = <unknown>
+ Users = <unknown>
+ OEM# = 0
+ Origin# = 1
+ NumCPU = 1
+ 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, ""))
+
+ @release = StringIO.new(" OmniOS v11 r151026\n Copyright 2017 OmniTI Computer Consulting, Inc. All rights reserved.\n Copyright 2018 OmniOS Community Edition (OmniOSce) Association.\n All rights reserved. Use is subject to licence terms.")
+ allow(File).to receive(:open).with("/etc/release").and_yield(@release)
+ plugin.run
end
it "runs uname and set platform and build" do
- @plugin.run
- expect(@plugin[:platform_build]).to eq("11.1")
+ expect(plugin[:platform_build]).to eq("omnios-r151026-673c59f55d")
+ end
+
+ it "sets the platform" do
+ expect(plugin[:platform]).to eq("omnios")
+ end
+
+ it "sets the platform_version" do
+ expect(plugin[:platform_version]).to eq("151026")
+ end
+
+ end
+
+ describe "on OpenIndiana Hipster" do
+ before do
+ @uname_x = <<~UNAME_X
+ System = SunOS
+ Node = openindiana
+ Release = 5.11
+ KernelID = illumos-c3e16711de
+ Machine = i86pc
+ BusType = <unknown>
+ Serial = <unknown>
+ Users = <unknown>
+ OEM# = 0
+ Origin# = 1
+ NumCPU = 1
+ 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, ""))
+
+ @release = StringIO.new(" OpenIndiana Hipster 2020.04 (powered by illumos)\n OpenIndiana Project, part of The Illumos Foundation (C) 2010-2020\n Use is subject to license terms.\n Assembled 03 May 2020")
+ allow(File).to receive(:open).with("/etc/release").and_yield(@release)
+ plugin.run
+ end
+
+ it "runs uname and set platform and build" do
+ expect(plugin[:platform_build]).to eq("illumos-c3e16711de")
+ end
+
+ it "sets the platform" do
+ expect(plugin[:platform]).to eq("openindiana")
+ end
+
+ it "sets the platform_version" do
+ expect(plugin[:platform_version]).to eq("2020.04")
+ end
+
+ end
+
+ describe "on OpenIndiana pre-Hipster" do
+ before do
+ @uname_x = <<~UNAME_X
+ System = SunOS
+ Node = openindiana
+ Release = 5.11
+ KernelID = illumos-cf2fa55
+ Machine = i86pc
+ BusType = <unknown>
+ Serial = <unknown>
+ Users = <unknown>
+ OEM# = 0
+ Origin# = 1
+ NumCPU = 2
+ 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, ""))
+ @release = StringIO.new(" OpenIndiana Development oi_151.1.8 (powered by illumos)\n Copyright 2011 Oracle and/or its affiliates. All rights reserved\n Use is subject to license terms.\n Assembled 20 July 2013")
+ allow(File).to receive(:open).with("/etc/release").and_yield(@release)
+ plugin.run
end
it "sets the platform" do
- @plugin.run
- expect(@plugin[:platform]).to eq("solaris2")
+ expect(plugin[:platform]).to eq("openindiana")
end
it "sets the platform_version" do
- @plugin.run
- expect(@plugin[:platform_version]).to eq("5.11")
+ expect(plugin[:platform_version]).to eq("151.1.8")
end
end
diff --git a/spec/unit/plugins/solaris2/virtualization_spec.rb b/spec/unit/plugins/solaris2/virtualization_spec.rb
index fb3ce8cb..ac1bd178 100644
--- a/spec/unit/plugins/solaris2/virtualization_spec.rb
+++ b/spec/unit/plugins/solaris2/virtualization_spec.rb
@@ -1,6 +1,6 @@
#
# Author:: Sean Walbran (<seanwalbran@gmail.com>)
-# Copyright:: Copyright (c) 2009-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -31,16 +31,16 @@ describe Ohai::System, "Solaris virtualization platform" do
allow(plugin).to receive(:collect_os).and_return(:solaris2)
# default to all requested Files not existing
- allow(File).to receive(:exist?).with("/usr/sbin/psrinfo").and_return(false)
- allow(File).to receive(:exist?).with("/usr/sbin/smbios").and_return(false)
- allow(File).to receive(:exist?).with("/usr/sbin/zoneadm").and_return(false)
+ allow(plugin).to receive(:file_exist?).with("/usr/sbin/psrinfo").and_return(false)
+ allow(plugin).to receive(:file_exist?).with("/usr/sbin/smbios").and_return(false)
+ allow(plugin).to receive(:file_exist?).with("/usr/sbin/zoneadm").and_return(false)
allow(plugin).to receive(:shell_out).with("/usr/sbin/smbios").and_return(mock_shell_out(0, "", ""))
allow(plugin).to receive(:shell_out).with("#{Ohai.abs_path( "/usr/sbin/psrinfo" )} -pv").and_return(mock_shell_out(0, "", ""))
end
describe "when we are checking for kvm" do
before do
- expect(File).to receive(:exist?).with("/usr/sbin/psrinfo").and_return(true)
+ expect(plugin).to receive(:file_exist?).with("/usr/sbin/psrinfo").and_return(true)
end
it "runs psrinfo -pv" do
diff --git a/spec/unit/plugins/ssh_host_keys_spec.rb b/spec/unit/plugins/ssh_host_keys_spec.rb
index 8eea800e..28ddae48 100644
--- a/spec/unit/plugins/ssh_host_keys_spec.rb
+++ b/spec/unit/plugins/ssh_host_keys_spec.rb
@@ -1,6 +1,6 @@
#
# Author:: Bryan McLellan <btm@chef.io>
-# Copyright:: Copyright (c) 2012-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -24,27 +24,23 @@ describe Ohai::System, "ssh_host_key plugin" do
@plugin = get_plugin("ssh_host_key")
@plugin[:keys] = Mash.new
- allow(File).to receive(:exist?).with("/etc/ssh/sshd_config").and_return(true)
- allow(File).to receive(:open).with("/etc/ssh/sshd_config").and_yield(sshd_config_file)
- allow(File).to receive(:exist?).and_return(true)
- allow(File).to receive(:exist?).with("/etc/ssh/ssh_host_dsa_key.pub").and_return(true)
- allow(File).to receive(:exist?).with("/etc/ssh/ssh_host_rsa_key.pub").and_return(true)
- allow(File).to receive(:exist?).with("/etc/ssh/ssh_host_ecdsa_key.pub").and_return(true)
- allow(File).to receive(:exist?).with("/etc/ssh/ssh_host_ed25519_key.pub").and_return(true)
-
- # Ensure we can still use IO.read
- io_read = IO.method(:read)
- allow(IO).to receive(:read) { |file| io_read.call(file) }
+ allow(@plugin).to receive(:file_exist?).with("/etc/ssh/sshd_config").and_return(true)
+ allow(@plugin).to receive(:file_open).with("/etc/ssh/sshd_config").and_yield(sshd_config_file)
+ allow(@plugin).to receive(:file_exist?).and_return(true)
+ allow(@plugin).to receive(:file_exist?).with("/etc/ssh/ssh_host_dsa_key.pub").and_return(true)
+ allow(@plugin).to receive(:file_exist?).with("/etc/ssh/ssh_host_rsa_key.pub").and_return(true)
+ allow(@plugin).to receive(:file_exist?).with("/etc/ssh/ssh_host_ecdsa_key.pub").and_return(true)
+ allow(@plugin).to receive(:file_exist?).with("/etc/ssh/ssh_host_ed25519_key.pub").and_return(true)
# Return fake public key files so we don't have to go digging for them in unit tests
@dsa_key = "ssh-dss AAAAB3NzaC1kc3MAAACBAMHlT02xN8kietxPfhcb98xHueTzKCOTz6dZlP/dmKILHrQOAExuSEeNiA2uvmhHNVQvs/cBsRiDxgSKux3ie2q8+MB6vHCiSpSkoPjrL75iT57YDilCB4/sytt6IJpj+H42wRDWTX0/QRybMHUvmnmEL0cwZXykSvrIum0BKB6hAAAAFQDsi6WUCClhtZIiTY9uh8eAre+SbQAAAIEAgNnuw0uEuqtcVif+AYd/bCZvL9FPqg7DrmTkamNEcVinhUGwsPGJTLJf+o5ens1X4RzQoi1R6Y6zCTL2FN/hZgINJNO0z9BN402wWrZmQd+Vb1U5DyDtveuvipqyQS+fm9neRwdLuv36Fc9f9nkZ7YHpkGPJp+yJpG4OoeREhwgAAACBAIf9kKLf2XiXnlByzlJ2Naa55d/hp2E059VKCRsBS++xFKYKvSqjnDQBFiMtAUhb8EdTyBGyalqOgqogDQVtwHfTZWZwqHAhry9aM06y92Eu/xSey4tWjKeknOsnRe640KC4zmKDBRTrjjkuAdrKPN9k3jl+OCc669JHlIfo6kqf oppa"
@rsa_key = "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAuhcVXV+nNapkyUC5p4TH1ymRxUjtMBKqYWmwyI29gVFnUNeHkKFHWon0KFeGJP2Rm8BfTiZa9ER9e8pRr4Nd+z1C1o0kVoxEEfB9tpSdTlpk1GG83D94l57fij8THRVIwuCEosViUlg1gDgC4SpxbqfdBkUN2qyf6JDOh7t2QpYh7berpDEWeBpb7BKdLEDT57uw7ijKzSNyaXqq8KkB9I+UFrRwpuos4W7ilX+PQ+mWLi2ZZJfTYZMxxVS+qJwiDtNxGCRwTOQZG03kI7eLBZG+igupr0uD4o6qeftPOr0kxgjoPU4nEKvYiGq8Rqd2vYrhiaJHLk9QB6xStQvS3Q== oppa"
@ecdsa_key = "ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBBx8VgvxmHxs/sIn/ATh0iUcuz1I2Xc0e1ejXCGHBMZ98IE3FBt1ezlqCpNMcHVV2skQQ8vyLbKxzweyZuNSDU8= oppa"
@ed25519_key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFYGnIM5K5JaRxbMCqz8cPMmLp57ZoJQvA5Tlj18EO6H djb"
- allow(IO).to receive(:read).with("/etc/ssh/ssh_host_dsa_key.pub").and_return(@dsa_key)
- allow(IO).to receive(:read).with("/etc/ssh/ssh_host_rsa_key.pub").and_return(@rsa_key)
- allow(IO).to receive(:read).with("/etc/ssh/ssh_host_ecdsa_key.pub").and_return(@ecdsa_key)
- allow(IO).to receive(:read).with("/etc/ssh/ssh_host_ed25519_key.pub").and_return(@ed25519_key)
+ allow(@plugin).to receive(:file_read).with("/etc/ssh/ssh_host_dsa_key.pub").and_return(@dsa_key)
+ allow(@plugin).to receive(:file_read).with("/etc/ssh/ssh_host_rsa_key.pub").and_return(@rsa_key)
+ allow(@plugin).to receive(:file_read).with("/etc/ssh/ssh_host_ecdsa_key.pub").and_return(@ecdsa_key)
+ allow(@plugin).to receive(:file_read).with("/etc/ssh/ssh_host_ed25519_key.pub").and_return(@ed25519_key)
end
shared_examples "loads keys" do
@@ -107,8 +103,8 @@ describe Ohai::System, "ssh_host_key plugin" do
end
before do
- allow(File).to receive(:exist?).with("/etc/ssh/sshd_config").and_return(false)
- allow(File).to receive(:exist?).with("/etc/sshd_config").and_return(false)
+ allow(@plugin).to receive(:file_exist?).with("/etc/ssh/sshd_config").and_return(false)
+ allow(@plugin).to receive(:file_exist?).with("/etc/sshd_config").and_return(false)
end
it_behaves_like "loads keys"
diff --git a/spec/unit/plugins/virtualbox_spec.rb b/spec/unit/plugins/virtualbox_spec.rb
index 98e15106..d3060159 100644
--- a/spec/unit/plugins/virtualbox_spec.rb
+++ b/spec/unit/plugins/virtualbox_spec.rb
@@ -1,5 +1,5 @@
# Author:: Tim Smith (<tsmith@chef.io>)
-# Copyright:: Copyright (c) 2015-2019 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/spec/unit/plugins/windows/dmi_spec.rb b/spec/unit/plugins/windows/dmi_spec.rb
index f9f1c16d..aa086611 100644
--- a/spec/unit/plugins/windows/dmi_spec.rb
+++ b/spec/unit/plugins/windows/dmi_spec.rb
@@ -22,7 +22,7 @@ describe Ohai::System, "DMI", :windows_only do
let(:plugin) { get_plugin("windows/dmi") }
before do
- require "wmi-lite/wmi"
+ require "wmi-lite/wmi" unless defined?(WmiLite::Wmi)
empty_wmi_object = WmiLite::Wmi::Instance.new(double(properties_: []))
%w{Processor Bios ComputerSystemProduct BaseBoard}.each do |type|
diff --git a/spec/unit/plugins/windows/filesystem_spec.rb b/spec/unit/plugins/windows/filesystem_spec.rb
index 7082259b..396eb300 100644
--- a/spec/unit/plugins/windows/filesystem_spec.rb
+++ b/spec/unit/plugins/windows/filesystem_spec.rb
@@ -17,7 +17,7 @@
#
require "spec_helper"
-require "wmi-lite/wmi"
+require "wmi-lite/wmi" unless defined?(WmiLite::Wmi)
describe Ohai::System, "Windows Filesystem Plugin", :windows_only do
let(:plugin) { get_plugin("filesystem") }
diff --git a/spec/unit/plugins/windows/kernel_spec.rb b/spec/unit/plugins/windows/kernel_spec.rb
index 6127848c..0ca81100 100644
--- a/spec/unit/plugins/windows/kernel_spec.rb
+++ b/spec/unit/plugins/windows/kernel_spec.rb
@@ -1,5 +1,5 @@
#
-# Copyright:: Copyright (c) 2018 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -21,7 +21,7 @@ describe Ohai::System, "Windows kernel plugin", :windows_only do
let(:plugin) { get_plugin("kernel") }
before do
- require "wmi-lite/wmi"
+ require "wmi-lite/wmi" unless defined?(WmiLite::Wmi)
# Mock a Win32_OperatingSystem OLE32 WMI object
caption = double("WIN32OLE", name: "Caption")
diff --git a/spec/unit/plugins/windows/memory_spec.rb b/spec/unit/plugins/windows/memory_spec.rb
index 38e88eda..bc788b86 100644
--- a/spec/unit/plugins/windows/memory_spec.rb
+++ b/spec/unit/plugins/windows/memory_spec.rb
@@ -18,7 +18,7 @@ require "spec_helper"
describe Ohai::System, "Windows memory plugin", :windows_only do
before do
- require "wmi-lite/wmi"
+ require "wmi-lite/wmi" unless defined?(WmiLite::Wmi)
@plugin = get_plugin("windows/memory")
mock_os = {
"TotalVisibleMemorySize" => "10485760",
diff --git a/spec/unit/plugins/windows/network_spec.rb b/spec/unit/plugins/windows/network_spec.rb
index ff732cc7..7c0e5cc6 100644
--- a/spec/unit/plugins/windows/network_spec.rb
+++ b/spec/unit/plugins/windows/network_spec.rb
@@ -17,7 +17,6 @@
#
require "spec_helper"
-require "ipaddress"
describe Ohai::System, "Windows Network Plugin" do
let(:plugin) { get_plugin("windows/network") }
diff --git a/spec/unit/plugins/windows/uptime_spec.rb b/spec/unit/plugins/windows/uptime_spec.rb
index 6486ded7..bfe33884 100644
--- a/spec/unit/plugins/windows/uptime_spec.rb
+++ b/spec/unit/plugins/windows/uptime_spec.rb
@@ -1,6 +1,6 @@
#
# Author:: Aliasgar Batterywala (<aliasgar.batterywala@msystechnologies.com>)
-# Copyright:: Copyright (c) 2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/spec/unit/plugins/windows/virtualization_spec.rb b/spec/unit/plugins/windows/virtualization_spec.rb
index 07badbda..805b1e7d 100644
--- a/spec/unit/plugins/windows/virtualization_spec.rb
+++ b/spec/unit/plugins/windows/virtualization_spec.rb
@@ -2,7 +2,7 @@
# Author:: Pavel Yudin (<pyudin@parallels.com>)
# Author:: Tim Smith (<tsmith@chef.io>)
# Copyright:: Copyright (c) 2015 Pavel Yudin
-# Copyright:: Copyright (c) 2015-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/spec/unit/plugins/zpools_spec.rb b/spec/unit/plugins/zpools_spec.rb
index 5ed5a559..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
@@ -71,8 +71,8 @@ describe Ohai::System, "zpools plugin" do
allow(plugin).to receive(:platform_family).and_return("rhel")
allow(plugin).to receive(:collect_os).and_return(:linux)
allow(plugin).to receive(:shell_out).with("zpool list -H -o name,size,alloc,free,cap,dedup,health,version").and_return(mock_shell_out(0, zpool_out, ""))
- allow(plugin).to receive(:shell_out).with("zpool status rpool").and_return(mock_shell_out(0, zpool_status_rpool, ""))
- allow(plugin).to receive(:shell_out).with("zpool status tank").and_return(mock_shell_out(0, zpool_status_tank, ""))
+ allow(plugin).to receive(:shell_out).with("zpool status rpool -L").and_return(mock_shell_out(0, zpool_status_rpool, ""))
+ allow(plugin).to receive(:shell_out).with("zpool status tank -L").and_return(mock_shell_out(0, zpool_status_tank, ""))
end
it "Has entries for both zpools" do
@@ -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
diff --git a/spec/unit/provides_map_spec.rb b/spec/unit/provides_map_spec.rb
index c1484ca1..618729cb 100644
--- a/spec/unit/provides_map_spec.rb
+++ b/spec/unit/provides_map_spec.rb
@@ -1,6 +1,6 @@
#
# Author:: Daniel DeLeo (<dan@chef.io>)
-# Copyright:: Copyright (c) 2013-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License"); you
diff --git a/spec/unit/runner_spec.rb b/spec/unit/runner_spec.rb
index 536ef17d..123e3e8e 100644
--- a/spec/unit/runner_spec.rb
+++ b/spec/unit/runner_spec.rb
@@ -1,6 +1,6 @@
#
# Author:: Claire McQuin (<claire@chef.io>)
-# Copyright:: Copyright (c) 2013-2019, Chef Software Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License"); you
diff --git a/spec/unit/system_spec.rb b/spec/unit/system_spec.rb
index 6d51c0ed..1e72c2c7 100644
--- a/spec/unit/system_spec.rb
+++ b/spec/unit/system_spec.rb
@@ -1,7 +1,7 @@
#
# Author:: Adam Jacob (<adam@chef.io>)
# Author:: Claire McQuin (<claire@chef.io>)
-# Copyright:: Copyright (c) 2008-2017, Chef Software Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -146,7 +146,7 @@ describe "Ohai::System" do
message("default")
end
- collect_data(:#{Ohai::Mixin::OS.collect_os}) do
+ collect_data(:#{Ohai::Mixin::OS.collect_os_local}) do
message("platform_specific_message")
end
end
@@ -212,7 +212,7 @@ describe "Ohai::System" do
Ohai.config[:plugin_path] = [ path_to(".") ]
# Make sure the stubbing of runner is not overriden with reset_system during test
allow(ohai).to receive(:reset_system)
- allow(ohai.instance_variable_get("@runner")).to receive(:run_plugin).and_raise(Ohai::Exceptions::AttributeNotFound)
+ allow(ohai.runner).to receive(:run_plugin).and_raise(Ohai::Exceptions::AttributeNotFound)
expect(ohai.logger).to receive(:error).with(/Encountered error while running plugins/)
expect { ohai.all_plugins }.to raise_error(Ohai::Exceptions::AttributeNotFound)
end
@@ -407,6 +407,8 @@ describe "Ohai::System" do
E
it "runs all the plugins" do
+ # disable a few slow running plugins
+ Ohai.config[:disabled_plugins] = %i{Packages Virtualbox Ruby}
ohai.run_additional_plugins(@plugins_directory)
expect(ohai.data[:canteloupe][:english][:version]).to eq(2014)
expect(ohai.data[:canteloupe][:french][:version]).to eq(2012)
diff --git a/spec/unit/util/ip_helper_spec.rb b/spec/unit/util/ip_helper_spec.rb
index ec9b37ba..1ea144d0 100644
--- a/spec/unit/util/ip_helper_spec.rb
+++ b/spec/unit/util/ip_helper_spec.rb
@@ -14,7 +14,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-require "ipaddress"
require "spec_helper"
require "ohai/util/ip_helper"
diff --git a/tasks/spellcheck.rb b/tasks/spellcheck.rb
new file mode 100644
index 00000000..ee994283
--- /dev/null
+++ b/tasks/spellcheck.rb
@@ -0,0 +1,49 @@
+# frozen_string_literal: true
+#
+# Copyright:: Copyright (c) Chef Software Inc.
+# License:: Apache License, Version 2.0
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+namespace :spellcheck do
+ task :fetch_common do
+ sh "wget -q https://raw.githubusercontent.com/chef/chef_dictionary/master/chef.txt -O chef_dictionary.txt"
+ end
+
+ task run: %i{config_check fetch_common} do
+ sh 'cspell "**/*"'
+ end
+
+ desc "List the unique unrecognized words in the project."
+ 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."
+task spellcheck: "spellcheck:run"