summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2016-10-03 14:49:54 -0700
committerTim Smith <tsmith@chef.io>2016-10-03 14:49:54 -0700
commit4c167c22c90cda0ee7db0b9eb7b668f37ade94fd (patch)
tree6d5d1732198e915890c58fb202194644c9949172
parent567dcb84ac6e7a6b7b6d2b569e85f2b3631f5d1b (diff)
downloadohai-4c167c22c90cda0ee7db0b9eb7b668f37ade94fd.tar.gz
Rename to info_getter
Ohai I'm just here renaming your app Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--.travis.yml2
-rw-r--r--CHANGELOG.md312
-rw-r--r--CONTRIBUTING.md34
-rw-r--r--DOC_CHANGES.md10
-rw-r--r--ISSUE_TEMPLATE.md12
-rw-r--r--NOTICE7
-rw-r--r--OHAI_MVPS.md63
-rw-r--r--README.md36
-rw-r--r--RELEASE_NOTES.md2
-rw-r--r--Rakefile4
-rw-r--r--appveyor.yml4
-rwxr-xr-xbin/ohai6
-rw-r--r--docs/man/man1/ohai.120
-rw-r--r--lib/ohai.rb8
-rw-r--r--lib/ohai/application.rb34
-rw-r--r--lib/ohai/common/dmi.rb8
-rw-r--r--lib/ohai/config.rb50
-rw-r--r--lib/ohai/dsl.rb6
-rw-r--r--lib/ohai/dsl/plugin.rb36
-rw-r--r--lib/ohai/dsl/plugin/versionvi.rb6
-rw-r--r--lib/ohai/dsl/plugin/versionvii.rb16
-rw-r--r--lib/ohai/exception.rb2
-rw-r--r--lib/ohai/hints.rb10
-rw-r--r--lib/ohai/loader.rb66
-rw-r--r--lib/ohai/log.rb2
-rw-r--r--lib/ohai/mixin/command.rb50
-rw-r--r--lib/ohai/mixin/constant_helper.rb4
-rw-r--r--lib/ohai/mixin/dmi_decode.rb2
-rw-r--r--lib/ohai/mixin/ec2_metadata.rb12
-rw-r--r--lib/ohai/mixin/gce_metadata.rb6
-rw-r--r--lib/ohai/mixin/network_constants.rb2
-rw-r--r--lib/ohai/mixin/os.rb2
-rw-r--r--lib/ohai/mixin/seconds_to_human.rb2
-rw-r--r--lib/ohai/mixin/softlayer_metadata.rb8
-rw-r--r--lib/ohai/plugin_config.rb6
-rw-r--r--lib/ohai/plugins/aix/cpu.rb2
-rw-r--r--lib/ohai/plugins/aix/filesystem.rb2
-rw-r--r--lib/ohai/plugins/aix/kernel.rb2
-rw-r--r--lib/ohai/plugins/aix/memory.rb2
-rw-r--r--lib/ohai/plugins/aix/network.rb4
-rw-r--r--lib/ohai/plugins/aix/os.rb4
-rw-r--r--lib/ohai/plugins/aix/platform.rb2
-rw-r--r--lib/ohai/plugins/aix/uptime.rb2
-rw-r--r--lib/ohai/plugins/aix/virtualization.rb2
-rw-r--r--lib/ohai/plugins/azure.rb12
-rw-r--r--lib/ohai/plugins/bsd/filesystem.rb2
-rw-r--r--lib/ohai/plugins/bsd/virtualization.rb30
-rw-r--r--lib/ohai/plugins/c.rb12
-rw-r--r--lib/ohai/plugins/chef.rb4
-rw-r--r--lib/ohai/plugins/cloud.rb2
-rw-r--r--lib/ohai/plugins/cloud_v2.rb6
-rw-r--r--lib/ohai/plugins/command.rb2
-rw-r--r--lib/ohai/plugins/darwin/cpu.rb2
-rw-r--r--lib/ohai/plugins/darwin/filesystem.rb2
-rw-r--r--lib/ohai/plugins/darwin/filesystem2.rb2
-rw-r--r--lib/ohai/plugins/darwin/hardware.rb6
-rw-r--r--lib/ohai/plugins/darwin/memory.rb2
-rw-r--r--lib/ohai/plugins/darwin/network.rb2
-rw-r--r--lib/ohai/plugins/darwin/platform.rb4
-rw-r--r--lib/ohai/plugins/darwin/system_profiler.rb4
-rw-r--r--lib/ohai/plugins/darwin/virtualization.rb2
-rw-r--r--lib/ohai/plugins/digital_ocean.rb10
-rw-r--r--lib/ohai/plugins/dmi.rb22
-rw-r--r--lib/ohai/plugins/dragonflybsd/cpu.rb2
-rw-r--r--lib/ohai/plugins/dragonflybsd/memory.rb2
-rw-r--r--lib/ohai/plugins/dragonflybsd/network.rb4
-rw-r--r--lib/ohai/plugins/dragonflybsd/os.rb4
-rw-r--r--lib/ohai/plugins/dragonflybsd/platform.rb2
-rw-r--r--lib/ohai/plugins/ec2.rb30
-rw-r--r--lib/ohai/plugins/elixir.rb6
-rw-r--r--lib/ohai/plugins/erlang.rb10
-rw-r--r--lib/ohai/plugins/eucalyptus.rb18
-rw-r--r--lib/ohai/plugins/freebsd/cpu.rb4
-rw-r--r--lib/ohai/plugins/freebsd/memory.rb2
-rw-r--r--lib/ohai/plugins/freebsd/network.rb4
-rw-r--r--lib/ohai/plugins/freebsd/os.rb4
-rw-r--r--lib/ohai/plugins/freebsd/platform.rb2
-rw-r--r--lib/ohai/plugins/gce.rb12
-rw-r--r--lib/ohai/plugins/go.rb6
-rw-r--r--lib/ohai/plugins/groovy.rb6
-rw-r--r--lib/ohai/plugins/hostname.rb8
-rw-r--r--lib/ohai/plugins/init_package.rb2
-rw-r--r--lib/ohai/plugins/ip_scopes.rb4
-rw-r--r--lib/ohai/plugins/java.rb6
-rw-r--r--lib/ohai/plugins/joyent.rb2
-rw-r--r--lib/ohai/plugins/kernel.rb4
-rw-r--r--lib/ohai/plugins/keys.rb2
-rw-r--r--lib/ohai/plugins/languages.rb2
-rw-r--r--lib/ohai/plugins/linode.rb8
-rw-r--r--lib/ohai/plugins/linux/block_device.rb2
-rw-r--r--lib/ohai/plugins/linux/cpu.rb2
-rw-r--r--lib/ohai/plugins/linux/filesystem.rb4
-rw-r--r--lib/ohai/plugins/linux/filesystem2.rb4
-rw-r--r--lib/ohai/plugins/linux/fips.rb2
-rw-r--r--lib/ohai/plugins/linux/hostnamectl.rb2
-rw-r--r--lib/ohai/plugins/linux/lsb.rb4
-rw-r--r--lib/ohai/plugins/linux/machineid.rb2
-rw-r--r--lib/ohai/plugins/linux/mdadm.rb2
-rw-r--r--lib/ohai/plugins/linux/memory.rb2
-rw-r--r--lib/ohai/plugins/linux/network.rb38
-rw-r--r--lib/ohai/plugins/linux/platform.rb2
-rw-r--r--lib/ohai/plugins/linux/sessions.rb2
-rw-r--r--lib/ohai/plugins/linux/virtualization.rb16
-rw-r--r--lib/ohai/plugins/lua.rb6
-rw-r--r--lib/ohai/plugins/mono.rb6
-rw-r--r--lib/ohai/plugins/netbsd/cpu.rb2
-rw-r--r--lib/ohai/plugins/netbsd/memory.rb2
-rw-r--r--lib/ohai/plugins/netbsd/network.rb4
-rw-r--r--lib/ohai/plugins/netbsd/platform.rb2
-rw-r--r--lib/ohai/plugins/network.rb32
-rw-r--r--lib/ohai/plugins/network_listeners.rb4
-rw-r--r--lib/ohai/plugins/nodejs.rb6
-rw-r--r--lib/ohai/plugins/ohai.rb12
-rw-r--r--lib/ohai/plugins/ohai_time.rb6
-rw-r--r--lib/ohai/plugins/openbsd/cpu.rb2
-rw-r--r--lib/ohai/plugins/openbsd/memory.rb2
-rw-r--r--lib/ohai/plugins/openbsd/network.rb4
-rw-r--r--lib/ohai/plugins/openbsd/platform.rb2
-rw-r--r--lib/ohai/plugins/openstack.rb24
-rw-r--r--lib/ohai/plugins/os.rb4
-rw-r--r--lib/ohai/plugins/packages.rb2
-rw-r--r--lib/ohai/plugins/passwd.rb2
-rw-r--r--lib/ohai/plugins/perl.rb6
-rw-r--r--lib/ohai/plugins/php.rb6
-rw-r--r--lib/ohai/plugins/platform.rb2
-rw-r--r--lib/ohai/plugins/powershell.rb6
-rw-r--r--lib/ohai/plugins/ps.rb2
-rw-r--r--lib/ohai/plugins/python.rb6
-rw-r--r--lib/ohai/plugins/rackspace.rb20
-rw-r--r--lib/ohai/plugins/root_group.rb6
-rw-r--r--lib/ohai/plugins/ruby.rb2
-rw-r--r--lib/ohai/plugins/rust.rb6
-rw-r--r--lib/ohai/plugins/scala.rb10
-rw-r--r--lib/ohai/plugins/shard.rb4
-rw-r--r--lib/ohai/plugins/shells.rb2
-rw-r--r--lib/ohai/plugins/sigar/cpu.rb2
-rw-r--r--lib/ohai/plugins/sigar/filesystem.rb2
-rw-r--r--lib/ohai/plugins/sigar/memory.rb2
-rw-r--r--lib/ohai/plugins/sigar/network.rb8
-rw-r--r--lib/ohai/plugins/sigar/network_route.rb10
-rw-r--r--lib/ohai/plugins/sigar/platform.rb2
-rw-r--r--lib/ohai/plugins/softlayer.rb10
-rw-r--r--lib/ohai/plugins/solaris2/cpu.rb2
-rw-r--r--lib/ohai/plugins/solaris2/dmi.rb28
-rw-r--r--lib/ohai/plugins/solaris2/filesystem.rb6
-rw-r--r--lib/ohai/plugins/solaris2/memory.rb2
-rw-r--r--lib/ohai/plugins/solaris2/network.rb6
-rw-r--r--lib/ohai/plugins/solaris2/platform.rb2
-rw-r--r--lib/ohai/plugins/solaris2/virtualization.rb10
-rw-r--r--lib/ohai/plugins/solaris2/zpools.rb2
-rw-r--r--lib/ohai/plugins/ssh_host_key.rb4
-rw-r--r--lib/ohai/plugins/timezone.rb2
-rw-r--r--lib/ohai/plugins/uptime.rb8
-rw-r--r--lib/ohai/plugins/virtualbox.rb2
-rw-r--r--lib/ohai/plugins/virtualization.rb4
-rw-r--r--lib/ohai/plugins/vmware.rb6
-rw-r--r--lib/ohai/plugins/windows/cpu.rb4
-rw-r--r--lib/ohai/plugins/windows/drivers.rb2
-rw-r--r--lib/ohai/plugins/windows/filesystem.rb2
-rw-r--r--lib/ohai/plugins/windows/fips.rb2
-rw-r--r--lib/ohai/plugins/windows/memory.rb2
-rw-r--r--lib/ohai/plugins/windows/network.rb2
-rw-r--r--lib/ohai/plugins/windows/platform.rb2
-rw-r--r--lib/ohai/plugins/windows/virtualization.rb2
-rw-r--r--lib/ohai/provides_map.rb30
-rw-r--r--lib/ohai/runner.rb18
-rw-r--r--lib/ohai/system.rb80
-rw-r--r--lib/ohai/util/file_helper.rb6
-rw-r--r--lib/ohai/util/ip_helper.rb2
-rw-r--r--lib/ohai/util/win32.rb2
-rw-r--r--lib/ohai/util/win32/group_helper.rb4
-rw-r--r--lib/ohai/version.rb4
-rw-r--r--ohai.gemspec16
-rw-r--r--platform_simulation_specs/README.md4
-rwxr-xr-xplatform_simulation_specs/common/lib/libc.so.64
-rw-r--r--platform_simulation_specs/common/lib/libc.so.6.bat2
-rwxr-xr-xplatform_simulation_specs/common/lib64/libc.so.64
-rw-r--r--platform_simulation_specs/common/lib64/libc.so.6.bat2
-rw-r--r--platform_simulation_specs/common/ohai_plugin_common.rb42
-rw-r--r--platform_simulation_specs/common/ohai_plugin_common_spec.rb4
-rw-r--r--platform_simulation_specs/plugins/c_spec.rb4
-rw-r--r--platform_simulation_specs/plugins/erlang_spec.rb4
-rw-r--r--platform_simulation_specs/plugins/go_spec.rb4
-rw-r--r--platform_simulation_specs/plugins/groovy_spec.rb4
-rw-r--r--platform_simulation_specs/plugins/java_spec.rb4
-rw-r--r--platform_simulation_specs/plugins/kernel_spec.rb4
-rw-r--r--platform_simulation_specs/plugins/lua_spec.rb4
-rw-r--r--platform_simulation_specs/plugins/nodejs_spec.rb4
-rw-r--r--platform_simulation_specs/plugins/perl_spec.rb4
-rw-r--r--platform_simulation_specs/plugins/php_spec.rb4
-rw-r--r--platform_simulation_specs/plugins/python_spec.rb4
-rw-r--r--platform_simulation_specs/tools/grab_data.rb6
-rw-r--r--spec/data/plugins/pkg-query.output2
-rw-r--r--spec/data/plugins/v7message.rb2
-rw-r--r--spec/functional/application_spec.rb32
-rw-r--r--spec/functional/loader_spec.rb10
-rw-r--r--spec/functional/plugins/powershell_spec.rb2
-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.rb4
-rw-r--r--spec/spec_helper.rb22
-rw-r--r--spec/support/integration_helper.rb2
-rw-r--r--spec/unit/application_spec.rb28
-rw-r--r--spec/unit/config_spec.rb74
-rw-r--r--spec/unit/dsl/plugin_spec.rb124
-rw-r--r--spec/unit/hints_spec.rb16
-rw-r--r--spec/unit/loader_spec.rb56
-rw-r--r--spec/unit/mixin/command_spec.rb50
-rw-r--r--spec/unit/mixin/ec2_metadata_spec.rb6
-rw-r--r--spec/unit/mixin/softlayer_metadata_spec.rb8
-rw-r--r--spec/unit/plugin_config_spec.rb8
-rw-r--r--spec/unit/plugins/abort_spec.rb8
-rw-r--r--spec/unit/plugins/aix/cpu_spec.rb2
-rw-r--r--spec/unit/plugins/aix/filesystem_spec.rb2
-rw-r--r--spec/unit/plugins/aix/hostname_spec.rb2
-rw-r--r--spec/unit/plugins/aix/kernel_spec.rb2
-rw-r--r--spec/unit/plugins/aix/memory_spec.rb2
-rw-r--r--spec/unit/plugins/aix/network_spec.rb2
-rw-r--r--spec/unit/plugins/aix/os_spec.rb2
-rw-r--r--spec/unit/plugins/aix/platform_spec.rb2
-rw-r--r--spec/unit/plugins/aix/uptime_spec.rb2
-rw-r--r--spec/unit/plugins/aix/virtualization_spec.rb2
-rw-r--r--spec/unit/plugins/azure_spec.rb2
-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/c_spec.rb18
-rw-r--r--spec/unit/plugins/chef_spec.rb4
-rw-r--r--spec/unit/plugins/cloud_spec.rb2
-rw-r--r--spec/unit/plugins/cloud_v2_spec.rb2
-rw-r--r--spec/unit/plugins/darwin/cpu_spec.rb2
-rw-r--r--spec/unit/plugins/darwin/filesystem2_spec.rb2
-rw-r--r--spec/unit/plugins/darwin/filesystem_spec.rb2
-rw-r--r--spec/unit/plugins/darwin/hardware_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/network_spec.rb2
-rw-r--r--spec/unit/plugins/darwin/platform_spec.rb2
-rw-r--r--spec/unit/plugins/darwin/system_profiler_spec.rb2
-rw-r--r--spec/unit/plugins/darwin/virtualization_spec.rb2
-rw-r--r--spec/unit/plugins/digital_ocean_spec.rb2
-rw-r--r--spec/unit/plugins/dmi_spec.rb2
-rw-r--r--spec/unit/plugins/ec2_spec.rb2
-rw-r--r--spec/unit/plugins/elixir_spec.rb4
-rw-r--r--spec/unit/plugins/erlang_spec.rb4
-rw-r--r--spec/unit/plugins/eucalyptus_spec.rb2
-rw-r--r--spec/unit/plugins/fail_spec.rb70
-rw-r--r--spec/unit/plugins/freebsd/cpu_spec.rb4
-rw-r--r--spec/unit/plugins/freebsd/hostname_spec.rb2
-rw-r--r--spec/unit/plugins/freebsd/kernel_spec.rb4
-rw-r--r--spec/unit/plugins/freebsd/os_spec.rb2
-rw-r--r--spec/unit/plugins/freebsd/platform_spec.rb2
-rw-r--r--spec/unit/plugins/gce_spec.rb2
-rw-r--r--spec/unit/plugins/go_spec.rb4
-rw-r--r--spec/unit/plugins/groovy_spec.rb4
-rw-r--r--spec/unit/plugins/hostname_spec.rb2
-rw-r--r--spec/unit/plugins/init_package_spec.rb2
-rw-r--r--spec/unit/plugins/ip_scopes_spec.rb2
-rw-r--r--spec/unit/plugins/java_spec.rb4
-rw-r--r--spec/unit/plugins/joyent_spec.rb2
-rw-r--r--spec/unit/plugins/kernel_spec.rb16
-rw-r--r--spec/unit/plugins/linode_spec.rb2
-rw-r--r--spec/unit/plugins/linux/block_device_spec.rb2
-rw-r--r--spec/unit/plugins/linux/cpu_spec.rb6
-rw-r--r--spec/unit/plugins/linux/filesystem2_spec.rb2
-rw-r--r--spec/unit/plugins/linux/filesystem_spec.rb2
-rw-r--r--spec/unit/plugins/linux/fips_spec.rb2
-rw-r--r--spec/unit/plugins/linux/hostname_spec.rb4
-rw-r--r--spec/unit/plugins/linux/hostnamectl_spec.rb2
-rw-r--r--spec/unit/plugins/linux/kernel_spec.rb2
-rw-r--r--spec/unit/plugins/linux/lsb_spec.rb2
-rw-r--r--spec/unit/plugins/linux/machineid_spec.rb2
-rw-r--r--spec/unit/plugins/linux/mdadm_spec.rb2
-rw-r--r--spec/unit/plugins/linux/memory_spec.rb2
-rw-r--r--spec/unit/plugins/linux/network_spec.rb34
-rw-r--r--spec/unit/plugins/linux/platform_spec.rb10
-rw-r--r--spec/unit/plugins/linux/sessions_spec.rb2
-rw-r--r--spec/unit/plugins/linux/uptime_spec.rb2
-rw-r--r--spec/unit/plugins/linux/virtualization_spec.rb2
-rw-r--r--spec/unit/plugins/lua_spec.rb4
-rw-r--r--spec/unit/plugins/mono_spec.rb4
-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/network_spec.rb98
-rw-r--r--spec/unit/plugins/nodejs_spec.rb4
-rw-r--r--spec/unit/plugins/ohai_spec.rb8
-rw-r--r--spec/unit/plugins/ohai_time_spec.rb8
-rw-r--r--spec/unit/plugins/openbsd/hostname_spec.rb2
-rw-r--r--spec/unit/plugins/openbsd/kernel_spec.rb4
-rw-r--r--spec/unit/plugins/openbsd/platform_spec.rb2
-rw-r--r--spec/unit/plugins/openstack_spec.rb30
-rw-r--r--spec/unit/plugins/os_spec.rb2
-rw-r--r--spec/unit/plugins/packages_spec.rb2
-rw-r--r--spec/unit/plugins/passwd_spec.rb2
-rw-r--r--spec/unit/plugins/perl_spec.rb4
-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/rackspace_spec.rb16
-rw-r--r--spec/unit/plugins/root_group_spec.rb6
-rw-r--r--spec/unit/plugins/ruby_spec.rb8
-rw-r--r--spec/unit/plugins/rust_spec.rb2
-rw-r--r--spec/unit/plugins/scala_spec.rb6
-rw-r--r--spec/unit/plugins/shard_spec.rb6
-rw-r--r--spec/unit/plugins/shells_spec.rb2
-rw-r--r--spec/unit/plugins/sigar/network_route_spec.rb8
-rw-r--r--spec/unit/plugins/softlayer_spec.rb2
-rw-r--r--spec/unit/plugins/solaris2/cpu_spec.rb2
-rw-r--r--spec/unit/plugins/solaris2/dmi_spec.rb2
-rw-r--r--spec/unit/plugins/solaris2/filesystem.rb8
-rw-r--r--spec/unit/plugins/solaris2/hostname_spec.rb2
-rw-r--r--spec/unit/plugins/solaris2/kernel_spec.rb2
-rw-r--r--spec/unit/plugins/solaris2/memory_spec.rb2
-rw-r--r--spec/unit/plugins/solaris2/network_spec.rb2
-rw-r--r--spec/unit/plugins/solaris2/platform_spec.rb2
-rw-r--r--spec/unit/plugins/solaris2/virtualization_spec.rb10
-rw-r--r--spec/unit/plugins/solaris2/zpools_spec.rb2
-rw-r--r--spec/unit/plugins/ssh_host_keys_spec.rb2
-rw-r--r--spec/unit/plugins/timezone_spec.rb2
-rw-r--r--spec/unit/plugins/virtualbox_spec.rb2
-rw-r--r--spec/unit/plugins/vmware_spec.rb2
-rw-r--r--spec/unit/plugins/windows/cpu_spec.rb2
-rw-r--r--spec/unit/plugins/windows/fips_spec.rb2
-rw-r--r--spec/unit/plugins/windows/memory_spec.rb2
-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/provides_map_spec.rb34
-rw-r--r--spec/unit/runner_spec.rb148
-rw-r--r--spec/unit/system_spec.rb352
-rw-r--r--spec/unit/util/file_helper_spec.rb6
-rw-r--r--spec/unit/util/ip_helper_spec.rb6
333 files changed, 1723 insertions, 1731 deletions
diff --git a/.travis.yml b/.travis.yml
index 44bc1b37..8b67a484 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -20,4 +20,4 @@ rvm:
script:
- bundle exec chefstyle
- bundle exec rake spec
- - bundle exec ohai
+ - bundle exec info_getter
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c23fb2ec..eed88218 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,214 +1,214 @@
# Change Log
-## [8.20.0](https://github.com/chef/ohai/tree/8.20.0) (2016-09-07)
+## [8.20.0](https://github.com/chef/info_getter/tree/8.20.0) (2016-09-07)
-[Full Changelog](https://github.com/chef/ohai/compare/v8.19.2...8.20.0)
+[Full Changelog](https://github.com/chef/info_getter/compare/v8.19.2...8.20.0)
**Implemented enhancements:**
-- Retrofit network plugin to work on Windows Nano Server [#872](https://github.com/chef/ohai/pull/872) ([mwrock](https://github.com/mwrock))
-- Detect lxd [#871](https://github.com/chef/ohai/pull/871) ([jeunito](https://github.com/jeunito))
-- Use chefstyle 0.4.0 for linting and resolve all warnings [#870](https://github.com/chef/ohai/pull/870) ([lamont-granquist](https://github.com/lamont-granquist))
-- Add kernel[:update] on Solaris Systems [#869](https://github.com/chef/ohai/pull/869) ([MarkGibbons](https://github.com/MarkGibbons))
-- Add hostnamectl plugin for Linux machine information [#867](https://github.com/chef/ohai/pull/867) ([davide125](https://github.com/davide125))
+- Retrofit network plugin to work on Windows Nano Server [#872](https://github.com/chef/info_getter/pull/872) ([mwrock](https://github.com/mwrock))
+- Detect lxd [#871](https://github.com/chef/info_getter/pull/871) ([jeunito](https://github.com/jeunito))
+- Use chefstyle 0.4.0 for linting and resolve all warnings [#870](https://github.com/chef/info_getter/pull/870) ([lamont-granquist](https://github.com/lamont-granquist))
+- Add kernel[:update] on Solaris Systems [#869](https://github.com/chef/info_getter/pull/869) ([MarkGibbons](https://github.com/MarkGibbons))
+- Add hostnamectl plugin for Linux machine information [#867](https://github.com/chef/info_getter/pull/867) ([davide125](https://github.com/davide125))
-## [v8.19.2](https://github.com/chef/ohai/tree/v8.19.2) (2016-08-16)
+## [v8.19.2](https://github.com/chef/info_getter/tree/v8.19.2) (2016-08-16)
-[Full Changelog](https://github.com/chef/ohai/compare/v8.19.1...v8.19.2)
+[Full Changelog](https://github.com/chef/info_getter/compare/v8.19.1...v8.19.2)
**Implemented enhancements:**
-- Require at least mixlib-log 1.7.1 [#866](https://github.com/chef/ohai/pull/866) ([tas50](https://github.com/tas50))
+- Require at least mixlib-log 1.7.1 [#866](https://github.com/chef/info_getter/pull/866) ([tas50](https://github.com/tas50))
-## [v8.19.1](https://github.com/chef/ohai/tree/v8.19.1) (2016-08-12)
+## [v8.19.1](https://github.com/chef/info_getter/tree/v8.19.1) (2016-08-12)
-[Full Changelog](https://github.com/chef/ohai/compare/v8.19.0...v8.19.1)
+[Full Changelog](https://github.com/chef/info_getter/compare/v8.19.0...v8.19.1)
**Fixed bugs:**
-- Move log configuration down to Mixlib::Log [#864](https://github.com/chef/ohai/pull/864) ([thommay](https://github.com/thommay))
-- Only configure logging if we must [#863](https://github.com/chef/ohai/pull/863) ([thommay](https://github.com/thommay))
+- Move log configuration down to Mixlib::Log [#864](https://github.com/chef/info_getter/pull/864) ([thommay](https://github.com/thommay))
+- Only configure logging if we must [#863](https://github.com/chef/info_getter/pull/863) ([thommay](https://github.com/thommay))
-## [v8.19.0](https://github.com/chef/ohai/tree/v8.19.0) (2016-08-11)
+## [v8.19.0](https://github.com/chef/info_getter/tree/v8.19.0) (2016-08-11)
-[Full Changelog](https://github.com/chef/ohai/compare/v8.18.0...v8.19.0)
+[Full Changelog](https://github.com/chef/info_getter/compare/v8.18.0...v8.19.0)
**Implemented enhancements:**
-- Add plugin for available shells [#854](https://github.com/chef/ohai/issues/854)
-- Add platform detection for Arista EOS [#860](https://github.com/chef/ohai/pull/860) ([jerearista](https://github.com/jerearista))
+- Add plugin for available shells [#854](https://github.com/chef/info_getter/issues/854)
+- Add platform detection for Arista EOS [#860](https://github.com/chef/info_getter/pull/860) ([jerearista](https://github.com/jerearista))
**Fixed bugs:**
-- Fix installs on Ruby 2.1 and rspec testing with rspec 3.5 [#861](https://github.com/chef/ohai/pull/861) ([tas50](https://github.com/tas50))
-- Fix solaris2 plugin network interface detection [#859](https://github.com/chef/ohai/pull/859) ([acaiafa](https://github.com/acaiafa))
+- Fix installs on Ruby 2.1 and rspec testing with rspec 3.5 [#861](https://github.com/chef/info_getter/pull/861) ([tas50](https://github.com/tas50))
+- Fix solaris2 plugin network interface detection [#859](https://github.com/chef/info_getter/pull/859) ([acaiafa](https://github.com/acaiafa))
-## [8.18.0](https://github.com/chef/ohai/tree/8.18.0) (2016-08-04)
+## [8.18.0](https://github.com/chef/info_getter/tree/8.18.0) (2016-08-04)
-[Full Changelog](https://github.com/chef/ohai/compare/v8.17.1...8.18.0)
+[Full Changelog](https://github.com/chef/info_getter/compare/v8.17.1...8.18.0)
**Implemented enhancements:**
-- Add a plugin for collecting available shells [#856](https://github.com/chef/ohai/pull/856) ([tas50](https://github.com/tas50))
-- BlockDevice: Add physical and logical block size [#850](https://github.com/chef/ohai/pull/850) ([sun77](https://github.com/sun77))
-- Properly detect PHP 7 [#848](https://github.com/chef/ohai/pull/848) ([tas50](https://github.com/tas50))
-- Add support for Linux HugePages [#842](https://github.com/chef/ohai/pull/842) ([bjk-soundcloud](https://github.com/bjk-soundcloud))
-- Add detection of Virtualbox and VMware Fusion on OS X [#840](https://github.com/chef/ohai/pull/840) ([tas50](https://github.com/tas50))
-- Remove support for Ruby 2.0 [#838](https://github.com/chef/ohai/pull/838) ([tas50](https://github.com/tas50))
-- Add hardware plugin for ohai on darwin [#839](https://github.com/chef/ohai/pull/839) ([natewalck](https://github.com/natewalck))
+- Add a plugin for collecting available shells [#856](https://github.com/chef/info_getter/pull/856) ([tas50](https://github.com/tas50))
+- BlockDevice: Add physical and logical block size [#850](https://github.com/chef/info_getter/pull/850) ([sun77](https://github.com/sun77))
+- Properly detect PHP 7 [#848](https://github.com/chef/info_getter/pull/848) ([tas50](https://github.com/tas50))
+- Add support for Linux HugePages [#842](https://github.com/chef/info_getter/pull/842) ([bjk-soundcloud](https://github.com/bjk-soundcloud))
+- Add detection of Virtualbox and VMware Fusion on OS X [#840](https://github.com/chef/info_getter/pull/840) ([tas50](https://github.com/tas50))
+- Remove support for Ruby 2.0 [#838](https://github.com/chef/info_getter/pull/838) ([tas50](https://github.com/tas50))
+- Add hardware plugin for info_getter on darwin [#839](https://github.com/chef/info_getter/pull/839) ([natewalck](https://github.com/natewalck))
**Fixed bugs:**
-- Avoid global mutation. [#852](https://github.com/chef/ohai/pull/852) ([coderanger](https://github.com/coderanger))
+- Avoid global mutation. [#852](https://github.com/chef/info_getter/pull/852) ([coderanger](https://github.com/coderanger))
-## [8.17.1](https://github.com/chef/ohai/tree/8.17.1) (2016-06-30)
-[Full Changelog](https://github.com/chef/ohai/compare/v8.17.0...8.17.1)
+## [8.17.1](https://github.com/chef/info_getter/tree/8.17.1) (2016-06-30)
+[Full Changelog](https://github.com/chef/info_getter/compare/v8.17.0...8.17.1)
**Fixed bugs:**
-- Move timezone value under time [\#836](https://github.com/chef/ohai/pull/836) ([tas50](https://github.com/tas50))
-- Update PowerShell Version Compat Detection / Unblock bundler on Appveyor [\#832](https://github.com/chef/ohai/pull/832) ([smurawski](https://github.com/smurawski))
+- Move timezone value under time [\#836](https://github.com/chef/info_getter/pull/836) ([tas50](https://github.com/tas50))
+- Update PowerShell Version Compat Detection / Unblock bundler on Appveyor [\#832](https://github.com/chef/info_getter/pull/832) ([smurawski](https://github.com/smurawski))
-## [v8.17.0](https://github.com/chef/ohai/tree/v8.17.0) (2016-06-20)
-[Full Changelog](https://github.com/chef/ohai/compare/v8.16.0...v8.17.0)
+## [v8.17.0](https://github.com/chef/info_getter/tree/v8.17.0) (2016-06-20)
+[Full Changelog](https://github.com/chef/info_getter/compare/v8.16.0...v8.17.0)
**Implemented enhancements:**
-- Add additional info to networking interfaces/addresses [\#830](https://github.com/chef/ohai/pull/830) ([jaymzh](https://github.com/jaymzh))
-- Add a simple plugin to get the local timezone. [\#829](https://github.com/chef/ohai/pull/829) ([johnbellone](https://github.com/johnbellone))
-- Switch to kernel version to identify platform_version on Gentoo [\#828](https://github.com/chef/ohai/pull/828) ([tas50](https://github.com/tas50))
-- Expose ring parameters in the network plugin [\#827](https://github.com/chef/ohai/pull/827) ([davide125](https://github.com/davide125))
-- Improve packages attributes [\#820](https://github.com/chef/ohai/pull/820) ([glensc](https://github.com/glensc))
-- Add version for linux modules when available [\#816](https://github.com/chef/ohai/pull/816) ([jmauro](https://github.com/jmauro))
-- Add freebsd support in packages plugin [\#814](https://github.com/chef/ohai/pull/814) ([vr](https://github.com/vr))
+- Add additional info to networking interfaces/addresses [\#830](https://github.com/chef/info_getter/pull/830) ([jaymzh](https://github.com/jaymzh))
+- Add a simple plugin to get the local timezone. [\#829](https://github.com/chef/info_getter/pull/829) ([johnbellone](https://github.com/johnbellone))
+- Switch to kernel version to identify platform_version on Gentoo [\#828](https://github.com/chef/info_getter/pull/828) ([tas50](https://github.com/tas50))
+- Expose ring parameters in the network plugin [\#827](https://github.com/chef/info_getter/pull/827) ([davide125](https://github.com/davide125))
+- Improve packages attributes [\#820](https://github.com/chef/info_getter/pull/820) ([glensc](https://github.com/glensc))
+- Add version for linux modules when available [\#816](https://github.com/chef/info_getter/pull/816) ([jmauro](https://github.com/jmauro))
+- Add freebsd support in packages plugin [\#814](https://github.com/chef/info_getter/pull/814) ([vr](https://github.com/vr))
-## [v8.16.0](https://github.com/chef/ohai/tree/v8.16.0) (2016-05-12)
-[Full Changelog](https://github.com/chef/ohai/compare/v8.15.1...v8.16.0)
+## [v8.16.0](https://github.com/chef/info_getter/tree/v8.16.0) (2016-05-12)
+[Full Changelog](https://github.com/chef/info_getter/compare/v8.15.1...v8.16.0)
**Implemented enhancements:**
-- Properly poll Openstack metadata + other Openstack improvements [\#818](https://github.com/chef/ohai/pull/818) ([tas50](https://github.com/tas50))
-- Update packages plugin to support PLD Linux as an RPM distro [\#813](https://github.com/chef/ohai/pull/813) ([glensc](https://github.com/glensc))
-- Add detection of bhyve guests running Linux/\*BSD [\#812](https://github.com/chef/ohai/pull/812) ([tas50](https://github.com/tas50))
-- Consistent plugin debug logging [\#810](https://github.com/chef/ohai/pull/810) ([tas50](https://github.com/tas50))
-- Extra debug logging and error handling in plugin loading [\#808](https://github.com/chef/ohai/pull/808) ([tas50](https://github.com/tas50))
-- Language plugins: Improve failure logging, update specs, general cleanup [\#805](https://github.com/chef/ohai/pull/805) ([tas50](https://github.com/tas50))
-- Add method to safely get or check the existence of attributes [\#796](https://github.com/chef/ohai/pull/796) ([mcquin](https://github.com/mcquin))
+- Properly poll Openstack metadata + other Openstack improvements [\#818](https://github.com/chef/info_getter/pull/818) ([tas50](https://github.com/tas50))
+- Update packages plugin to support PLD Linux as an RPM distro [\#813](https://github.com/chef/info_getter/pull/813) ([glensc](https://github.com/glensc))
+- Add detection of bhyve guests running Linux/\*BSD [\#812](https://github.com/chef/info_getter/pull/812) ([tas50](https://github.com/tas50))
+- Consistent plugin debug logging [\#810](https://github.com/chef/info_getter/pull/810) ([tas50](https://github.com/tas50))
+- Extra debug logging and error handling in plugin loading [\#808](https://github.com/chef/info_getter/pull/808) ([tas50](https://github.com/tas50))
+- Language plugins: Improve failure logging, update specs, general cleanup [\#805](https://github.com/chef/info_getter/pull/805) ([tas50](https://github.com/tas50))
+- Add method to safely get or check the existence of attributes [\#796](https://github.com/chef/info_getter/pull/796) ([mcquin](https://github.com/mcquin))
**Fixed bugs:**
-- Prevent parallels spec from checking the filesystem [\#811](https://github.com/chef/ohai/pull/811) ([tas50](https://github.com/tas50))
+- Prevent parallels spec from checking the filesystem [\#811](https://github.com/chef/info_getter/pull/811) ([tas50](https://github.com/tas50))
-## [v8.15.1](https://github.com/chef/ohai/tree/v8.15.1) (2016-04-20)
-[Full Changelog](https://github.com/chef/ohai/compare/v8.15.0...v8.15.1)
+## [v8.15.1](https://github.com/chef/info_getter/tree/v8.15.1) (2016-04-20)
+[Full Changelog](https://github.com/chef/info_getter/compare/v8.15.0...v8.15.1)
**Fixed bugs:**
-- Avoid defining WINDOWS\_ATTRIBUTE\_ALIASES multiple times [\#806](https://github.com/chef/ohai/pull/806) ([mwrock](https://github.com/mwrock))
+- Avoid defining WINDOWS\_ATTRIBUTE\_ALIASES multiple times [\#806](https://github.com/chef/info_getter/pull/806) ([mwrock](https://github.com/mwrock))
-## [8.15.0](https://github.com/chef/ohai/tree/8.15.0) (2016-04-18)
-[Full Changelog](https://github.com/chef/ohai/compare/v8.14.0...8.15.0)
+## [8.15.0](https://github.com/chef/info_getter/tree/8.15.0) (2016-04-18)
+[Full Changelog](https://github.com/chef/info_getter/compare/v8.14.0...8.15.0)
**Implemented enhancements:**
-- Add a fips plugin to detect if fips is enabled [\#803](https://github.com/chef/ohai/pull/803) ([mwrock](https://github.com/mwrock))
-- Add debug logging to hints and improve cloud specs [\#797](https://github.com/chef/ohai/pull/797) ([tas50](https://github.com/tas50))
+- Add a fips plugin to detect if fips is enabled [\#803](https://github.com/chef/info_getter/pull/803) ([mwrock](https://github.com/mwrock))
+- Add debug logging to hints and improve cloud specs [\#797](https://github.com/chef/info_getter/pull/797) ([tas50](https://github.com/tas50))
**Fixed bugs:**
-- Fix Elixir version detection on newer Elixir releases [\#802](https://github.com/chef/ohai/pull/802) ([tas50](https://github.com/tas50))
-- Correct the version detection in erlang plugin [\#801](https://github.com/chef/ohai/pull/801) ([tas50](https://github.com/tas50))
-- Fix mono builddate capture and add debug logging [\#800](https://github.com/chef/ohai/pull/800) ([tas50](https://github.com/tas50))
-- Fix the scala plugin to properly return data [\#799](https://github.com/chef/ohai/pull/799) ([tas50](https://github.com/tas50))
-- Don't execute .so libs for Windows [\#798](https://github.com/chef/ohai/pull/798) ([chefsalim](https://github.com/chefsalim))
+- Fix Elixir version detection on newer Elixir releases [\#802](https://github.com/chef/info_getter/pull/802) ([tas50](https://github.com/tas50))
+- Correct the version detection in erlang plugin [\#801](https://github.com/chef/info_getter/pull/801) ([tas50](https://github.com/tas50))
+- Fix mono builddate capture and add debug logging [\#800](https://github.com/chef/info_getter/pull/800) ([tas50](https://github.com/tas50))
+- Fix the scala plugin to properly return data [\#799](https://github.com/chef/info_getter/pull/799) ([tas50](https://github.com/tas50))
+- Don't execute .so libs for Windows [\#798](https://github.com/chef/info_getter/pull/798) ([chefsalim](https://github.com/chefsalim))
-## [8.14.0](https://github.com/chef/ohai/tree/8.14.0) (2016-04-08)
+## [8.14.0](https://github.com/chef/info_getter/tree/8.14.0) (2016-04-08)
-[Full Changelog](https://github.com/chef/ohai/compare/v8.13.0...8.14.0)
+[Full Changelog](https://github.com/chef/info_getter/compare/v8.13.0...8.14.0)
**Implemented enhancements:**
-- Improve Linux EC2 detection, fix false detection, and add Windows detection [#793](https://github.com/chef/ohai/pull/793) ([tas50](https://github.com/tas50))
-- Ohai shell_out logging, timeouts, and error handling [#788](https://github.com/chef/ohai/pull/788) ([mcquin](https://github.com/mcquin))
-- Detect openSUSE Leap as platform opensuseleap [#784](https://github.com/chef/ohai/pull/784) ([tas50](https://github.com/tas50))
-- Windows packages plugin - Get packages from registry [#778](https://github.com/chef/ohai/pull/778) ([sh9189](https://github.com/sh9189))
+- Improve Linux EC2 detection, fix false detection, and add Windows detection [#793](https://github.com/chef/info_getter/pull/793) ([tas50](https://github.com/tas50))
+- info_getter shell_out logging, timeouts, and error handling [#788](https://github.com/chef/info_getter/pull/788) ([mcquin](https://github.com/mcquin))
+- Detect openSUSE Leap as platform opensuseleap [#784](https://github.com/chef/info_getter/pull/784) ([tas50](https://github.com/tas50))
+- Windows packages plugin - Get packages from registry [#778](https://github.com/chef/info_getter/pull/778) ([sh9189](https://github.com/sh9189))
**Fixed bugs:**
-- AIX: Set os_version to match the output of oslevel -s [#790](https://github.com/chef/ohai/pull/790) ([juliandunn](https://github.com/juliandunn))
-- Remove ec2metadata CLI as an EC2 detection method [#787](https://github.com/chef/ohai/pull/787) ([tas50](https://github.com/tas50))
-- solaris11_network: Handle solaris 11 zone interfaces [#742](https://github.com/chef/ohai/pull/742) ([MarkGibbons](https://github.com/MarkGibbons))
+- AIX: Set os_version to match the output of oslevel -s [#790](https://github.com/chef/info_getter/pull/790) ([juliandunn](https://github.com/juliandunn))
+- Remove ec2metadata CLI as an EC2 detection method [#787](https://github.com/chef/info_getter/pull/787) ([tas50](https://github.com/tas50))
+- solaris11_network: Handle solaris 11 zone interfaces [#742](https://github.com/chef/info_getter/pull/742) ([MarkGibbons](https://github.com/MarkGibbons))
**Merged pull requests:**
-- Update chefstyle to 0.3.1 and fix new offenses. [#789](https://github.com/chef/ohai/pull/789) ([mcquin](https://github.com/mcquin))
+- Update chefstyle to 0.3.1 and fix new offenses. [#789](https://github.com/chef/info_getter/pull/789) ([mcquin](https://github.com/mcquin))
-## [v8.13.0](https://github.com/chef/ohai/tree/v8.13.0) (2016-03-24)
+## [v8.13.0](https://github.com/chef/info_getter/tree/v8.13.0) (2016-03-24)
-[Full Changelog](https://github.com/chef/ohai/compare/v8.12.1...v8.13.0)
+[Full Changelog](https://github.com/chef/info_getter/compare/v8.12.1...v8.13.0)
**Implemented enhancements:**
-- Add language scala [#524](https://github.com/chef/ohai/pull/524) ([cmluciano](https://github.com/cmluciano))
+- Add language scala [#524](https://github.com/chef/info_getter/pull/524) ([cmluciano](https://github.com/cmluciano))
**Fixed bugs:**
-- Lock plist to 3.x [#779](https://github.com/chef/ohai/pull/779) ([danielsdeleo](https://github.com/danielsdeleo))
+- Lock plist to 3.x [#779](https://github.com/chef/info_getter/pull/779) ([danielsdeleo](https://github.com/danielsdeleo))
-## [v8.12.1](https://github.com/chef/ohai/tree/v8.12.1) (2016-03-15)
+## [v8.12.1](https://github.com/chef/info_getter/tree/v8.12.1) (2016-03-15)
-[Full Changelog](https://github.com/chef/ohai/compare/v8.12.0...v8.12.1)
+[Full Changelog](https://github.com/chef/info_getter/compare/v8.12.0...v8.12.1)
**Fixed bugs:**
-- Fix gem conflicts in ruby environments that load rake 11 [#774](https://github.com/chef/ohai/pull/774) ([danielsdeleo](https://github.com/danielsdeleo))
+- Fix gem conflicts in ruby environments that load rake 11 [#774](https://github.com/chef/info_getter/pull/774) ([danielsdeleo](https://github.com/danielsdeleo))
-## [v8.12.0](https://github.com/chef/ohai/tree/v8.12.0) (2016-03-09)
+## [v8.12.0](https://github.com/chef/info_getter/tree/v8.12.0) (2016-03-09)
-[Full Changelog](https://github.com/chef/ohai/compare/v8.11.1...v8.12.0)
+[Full Changelog](https://github.com/chef/info_getter/compare/v8.11.1...v8.12.0)
**Implemented enhancements:**
-- add plugin to detect user sessions using loginctl [#766](https://github.com/chef/ohai/pull/766) ([davide125](https://github.com/davide125))
-- Improve virtualization detection on Solaris [#760](https://github.com/chef/ohai/pull/760) ([tas50](https://github.com/tas50))
-- Improve FreeBSD guest virtualization detection [#756](https://github.com/chef/ohai/pull/756) ([tas50](https://github.com/tas50))
-- Detect Openstack hosts [#751](https://github.com/chef/ohai/pull/751) ([tas50](https://github.com/tas50))
-- Improve KVM host and guest detection [#750](https://github.com/chef/ohai/pull/750) ([tas50](https://github.com/tas50))
-- Update GCE metadata API version and fail better [#736](https://github.com/chef/ohai/pull/736) ([tas50](https://github.com/tas50))
+- add plugin to detect user sessions using loginctl [#766](https://github.com/chef/info_getter/pull/766) ([davide125](https://github.com/davide125))
+- Improve virtualization detection on Solaris [#760](https://github.com/chef/info_getter/pull/760) ([tas50](https://github.com/tas50))
+- Improve FreeBSD guest virtualization detection [#756](https://github.com/chef/info_getter/pull/756) ([tas50](https://github.com/tas50))
+- Detect Openstack hosts [#751](https://github.com/chef/info_getter/pull/751) ([tas50](https://github.com/tas50))
+- Improve KVM host and guest detection [#750](https://github.com/chef/info_getter/pull/750) ([tas50](https://github.com/tas50))
+- Update GCE metadata API version and fail better [#736](https://github.com/chef/info_getter/pull/736) ([tas50](https://github.com/tas50))
**Fixed bugs:**
-- Make ohai work with Chef 12.7 and below [#768](https://github.com/chef/ohai/pull/768) ([jkeiser](https://github.com/jkeiser))
-- Remove XML output in VirtualizationInfo and need for hpricot gem [#755](https://github.com/chef/ohai/pull/755) ([tas50](https://github.com/tas50))
+- Make info_getter work with Chef 12.7 and below [#768](https://github.com/chef/info_getter/pull/768) ([jkeiser](https://github.com/jkeiser))
+- Remove XML output in VirtualizationInfo and need for hpricot gem [#755](https://github.com/chef/info_getter/pull/755) ([tas50](https://github.com/tas50))
-## [v8.11.1](https://github.com/chef/ohai/tree/v8.11.1) (2016-03-08)
+## [v8.11.1](https://github.com/chef/info_getter/tree/v8.11.1) (2016-03-08)
-[Full Changelog](https://github.com/chef/ohai/compare/v8.10.0...v8.11.1)
+[Full Changelog](https://github.com/chef/info_getter/compare/v8.10.0...v8.11.1)
**Implemented enhancements:**
-- Detect Azure on non-bootstrapped hosts [#657](https://github.com/chef/ohai/issues/657)
-- Deprecate run_command and popen4 in the command mixin [#730](https://github.com/chef/ohai/pull/730) ([tas50](https://github.com/tas50))
-- OHAI-726 Regex to support openjdk 1.8 [#727](https://github.com/chef/ohai/pull/727) ([davidnewman](https://github.com/davidnewman))
-- Add support for the 2 latest EC2 metadata versions [#725](https://github.com/chef/ohai/pull/725) ([tas50](https://github.com/tas50))
-- Improved debug logging for cloud plugins [#724](https://github.com/chef/ohai/pull/724) ([tas50](https://github.com/tas50))
-- Detect paravirt amazon instances without hint files [#722](https://github.com/chef/ohai/pull/722) ([tas50](https://github.com/tas50))
-- Detect Azure using the Azure agent and DHCP options [#714](https://github.com/chef/ohai/pull/714) ([tas50](https://github.com/tas50))
+- Detect Azure on non-bootstrapped hosts [#657](https://github.com/chef/info_getter/issues/657)
+- Deprecate run_command and popen4 in the command mixin [#730](https://github.com/chef/info_getter/pull/730) ([tas50](https://github.com/tas50))
+- info_getter-726 Regex to support openjdk 1.8 [#727](https://github.com/chef/info_getter/pull/727) ([davidnewman](https://github.com/davidnewman))
+- Add support for the 2 latest EC2 metadata versions [#725](https://github.com/chef/info_getter/pull/725) ([tas50](https://github.com/tas50))
+- Improved debug logging for cloud plugins [#724](https://github.com/chef/info_getter/pull/724) ([tas50](https://github.com/tas50))
+- Detect paravirt amazon instances without hint files [#722](https://github.com/chef/info_getter/pull/722) ([tas50](https://github.com/tas50))
+- Detect Azure using the Azure agent and DHCP options [#714](https://github.com/chef/info_getter/pull/714) ([tas50](https://github.com/tas50))
**Fixed bugs:**
-- Use escape_glob_dir instead of escape_glob [#747](https://github.com/chef/ohai/pull/747) ([jaym](https://github.com/jaym))
-- have a proper dependency on plist [#737](https://github.com/chef/ohai/pull/737) ([thommay](https://github.com/thommay))
-- Fix digital ocean ip address detection [#735](https://github.com/chef/ohai/pull/735) ([ctso](https://github.com/ctso))
-- Log sigar gem load failures [#731](https://github.com/chef/ohai/pull/731) ([tas50](https://github.com/tas50))
-- ipaddress on Linux - default route pointing to unaddressed interface, with route src [#682](https://github.com/chef/ohai/pull/682) ([glennmatthews](https://github.com/glennmatthews))
+- Use escape_glob_dir instead of escape_glob [#747](https://github.com/chef/info_getter/pull/747) ([jaym](https://github.com/jaym))
+- have a proper dependency on plist [#737](https://github.com/chef/info_getter/pull/737) ([thommay](https://github.com/thommay))
+- Fix digital ocean ip address detection [#735](https://github.com/chef/info_getter/pull/735) ([ctso](https://github.com/ctso))
+- Log sigar gem load failures [#731](https://github.com/chef/info_getter/pull/731) ([tas50](https://github.com/tas50))
+- ipaddress on Linux - default route pointing to unaddressed interface, with route src [#682](https://github.com/chef/info_getter/pull/682) ([glennmatthews](https://github.com/glennmatthews))
## Release 8.10.0
-* [pr#720](https://github.com/chef/ohai/pull/720) Make Windows driver plugin opt-in via config
-* [pr#717](https://github.com/chef/ohai/pull/717) Don't enable packages plugin by default
-* [pr#711](https://github.com/chef/ohai/pull/711) Improve EC2 detection for HVM instances when a hint isn't present
+* [pr#720](https://github.com/chef/info_getter/pull/720) Make Windows driver plugin opt-in via config
+* [pr#717](https://github.com/chef/info_getter/pull/717) Don't enable packages plugin by default
+* [pr#711](https://github.com/chef/info_getter/pull/711) Improve EC2 detection for HVM instances when a hint isn't present
## Release 8.9.0
* [**phreakocious**](https://github.com/phreakocious):
@@ -225,17 +225,17 @@
- Allow route table override
* [**JM Howard Brown**](https://github.com/jmhbrown)
- Add tests and queue_depth to block_device
-* [pr#672](https://github.com/chef/ohai/pull/672) CPU plugin for Darwin (OS X) now properly reports the number of real CPUs adds "cores" to match the CPU output on Linux
-* [pr#674](https://github.com/chef/ohai/pull/674) CPU plugin for FreeBSD now reports "real" and "core" values to match the CPU output on Linux
-* [pr#654](https://github.com/chef/ohai/pull/654) Improvements to filesystem and wpar detection on AIX
-* [pr#683](https://github.com/chef/ohai/pull/683) Properly detect the init package on older Linux kernels
-* [pr#684](https://github.com/chef/ohai/pull/684) Remove non-functional cucumber tests
-* [pr#695](https://github.com/chef/ohai/pull/695) Fix detection of mac address on IPv6 only systems
-* [pr#703](https://github.com/chef/ohai/pull/703) Enable ChefStyle per RFC 64
+* [pr#672](https://github.com/chef/info_getter/pull/672) CPU plugin for Darwin (OS X) now properly reports the number of real CPUs adds "cores" to match the CPU output on Linux
+* [pr#674](https://github.com/chef/info_getter/pull/674) CPU plugin for FreeBSD now reports "real" and "core" values to match the CPU output on Linux
+* [pr#654](https://github.com/chef/info_getter/pull/654) Improvements to filesystem and wpar detection on AIX
+* [pr#683](https://github.com/chef/info_getter/pull/683) Properly detect the init package on older Linux kernels
+* [pr#684](https://github.com/chef/info_getter/pull/684) Remove non-functional cucumber tests
+* [pr#695](https://github.com/chef/info_getter/pull/695) Fix detection of mac address on IPv6 only systems
+* [pr#703](https://github.com/chef/info_getter/pull/703) Enable ChefStyle per RFC 64
## Release 8.8.1
-* [pr#677](https://github.com/chef/ohai/pull/677) Remove dependency on mime-types gem
-* [pr#662](https://github.com/chef/ohai/pull/662) Skip the VMware plugin if DMI data doesn't indicate we're on a VMware system
+* [pr#677](https://github.com/chef/info_getter/pull/677) Remove dependency on mime-types gem
+* [pr#662](https://github.com/chef/info_getter/pull/662) Skip the VMware plugin if DMI data doesn't indicate we're on a VMware system
## Release 8.8.0
* [**James Flemer, NDP LLC**](https://github.com/jflemer-ndp):
@@ -257,7 +257,7 @@
* Add kernel bitness detection for AIX
* Fix CPU detection on FreeBSD 10.2+, add collection CPU family and model data.
* Add inode data for filesystems on FreeBSD
-* Detect Virtualbox, VMware, and KVM on Windows guests and speed up Ohai runs
+* Detect Virtualbox, VMware, and KVM on Windows guests and speed up info_getter runs
* Add a plugin for Virtualbox to provide host / guest version information
* Escape plugin directory path to prevent failures on Windows
* Detect Microsoft Hyper-V Linux/BSD guests, which were previously detected as VirtualPC guests
@@ -267,7 +267,7 @@
## Release 8.7.0
* [**Shahul Khajamohideen**](https://github.com/sh9189):
- Add total cores to linux cpu plugin
-* Fix behavior when abort called from plug-in (Ohai should exit with error code)
+* Fix behavior when abort called from plug-in (info_getter should exit with error code)
## Release 8.6.0
* [**Phil Dibowitz**](https://github.com/jaymzh):
@@ -281,9 +281,9 @@
* [**Pavel Yudin**](https://github.com/Kasen):
- Detect Parallels host and guest virtualization
* [**Claire McQuin**](https://github.com/mcquin):
- - Deprecate Ohai::Config in favor of Ohai::Config.ohai.
+ - Deprecate info_getter::Config in favor of info_getter::Config.info_getter.
- Load a configuration file while running as an application.
-* [PR #597](https//github.com/chef/ohai/pull/597):
+* [PR #597](https//github.com/chef/info_getter/pull/597):
- Correct platform, platform\_family and version detection on Cisco's Nexus platforms.
* [**cmluciano**](https://github.com/cmluciano):
- add vmware plugin
@@ -307,13 +307,13 @@
* [**Shahul Khajamohideen**](https://github.com/sh9189) and [**Sean Escriva**](https://github.com/webframp):
- Windows Memory plugin
* [**Chris Chambers**](https://github.com/cachamber):
- - Convert Solaris OHAI CPU detection to kstat from psrinfo
+ - Convert Solaris info_getter CPU detection to kstat from psrinfo
## Release 8.5.0
-* [PR #548](https://github.com/chef/ohai/pull/548):
+* [PR #548](https://github.com/chef/info_getter/pull/548):
Coerce non-UTF8 strings to UTF8 in output to suppress UTF8 encoding exceptions
-* [PR #544](https://github.com/chef/ohai/pull/544)
+* [PR #544](https://github.com/chef/info_getter/pull/544)
add support for Wind River Linux and Cisco's Nexus platforms
## Release 8.4.0
@@ -327,7 +327,7 @@
Removing trailing space and '\r' for windows #474
* [**Tim Smith**](https://github.com/tas50):
Ensure Gentoo based Linuxen get IP information
-* [PR #534](https://github.com/chef/ohai/pull/534)
+* [PR #534](https://github.com/chef/info_getter/pull/534)
Ignore OEM logo on Windows
## Release 8.2.0
@@ -346,7 +346,7 @@
* [**Chris Luciano**](https://github.com/cmluciano)
Add language elixir
* [**Chris Luciano**](https://github.com/cmluciano)
- Update WARNING for ohai 7 syntax docs page
+ Update WARNING for info_getter 7 syntax docs page
* [**Malte Swart**](https://github.com/mswart)
ssh_host_key: detect ed25519 host key
* [**hirose31**](https://github.com/hirose31)
@@ -358,9 +358,9 @@
* [**Paul Czarkowski**](https://github.com/paulczar)
detect if inside Docker container
* [**Michael Schmidt**](https://github.com/BugRoger)
- OHAI-339 Unable to detect IPAddress on CoreOS/Gentoo
+ info_getter-339 Unable to detect IPAddress on CoreOS/Gentoo
* [**Stafford Brunk**](https://github.com/wingrunr21)
- Digital Ocean ohai/cloud support round
+ Digital Ocean info_getter/cloud support round
* [**Sten Spans**](https://github.com/sspans)
Fix network.rb for XenServer Creedence
* [**Shuo Zhang**](https://github.com/zshuo)
@@ -433,48 +433,48 @@
## Release: 7.2.0
* [**Lance Bragstad**:](https://github.com/lbragstad)
- Added platform_family support for ibm_powerkvm (OHAI-558)
+ Added platform_family support for ibm_powerkvm (info_getter-558)
* [**Pierre Carrier**:](https://github.com/pcarrier)
- EC2 metadata errors are unhelpful (OHAI-566)
+ EC2 metadata errors are unhelpful (info_getter-566)
* [**Elan Ruusamäe**:](https://github.com/glensc)
- Support deep virtualization systems in `node[:virtualization][:systems]` (OHAI-182)
+ Support deep virtualization systems in `node[:virtualization][:systems]` (info_getter-182)
* [**Sean Walberg**:](https://github.com/swalberg)
- :Passwd plugin now ignores duplicate users. (OHAI-561)
+ :Passwd plugin now ignores duplicate users. (info_getter-561)
* [**Joe Richards**:](https://github.com/viyh)
- Fix warning message about constants already defined (OHAI-572)
+ Fix warning message about constants already defined (info_getter-572)
* [**Tim Smith**:](https://github.com/tas50)
- Present all CPU flags on FreeBSD (OHAI-568)
+ Present all CPU flags on FreeBSD (info_getter-568)
* [**Tim Smith**:](https://github.com/tas50)
- Ohai doesn't detect all KVM processor types as KVM on FreeBSD (OHAI-575)
+ info_getter doesn't detect all KVM processor types as KVM on FreeBSD (info_getter-575)
* [**Tim Smith**:](https://github.com/tas50)
- Ohai should expose mdadm raid information on Linux systems (OHAI-578)
+ info_getter should expose mdadm raid information on Linux systems (info_getter-578)
* [**Cam Cope**:](https://github.com/ccope)
- relax regex to match newer Oracle Solaris releases (OHAI-563)
+ relax regex to match newer Oracle Solaris releases (info_getter-563)
* [**Vasiliy Tolstov**:](https://github.com/vtolstov)
- add exherbo support (OHAI-570)
+ add exherbo support (info_getter-570)
* [**jasonpgignac**](https://github.com/jasonpgignac)
- Add inode information to the Linux Filesystem plugin. (OHAI-539)
+ Add inode information to the Linux Filesystem plugin. (info_getter-539)
* [**Benedikt Böhm**](https://github.com/hollow)
Change log-level from warn to debug for missing gateway IPs.
* [**sawanoboly**](https://github.com/sawanoboly)
- Include Joyent SmartOS specific attributes in Ohai. (OHAI-458)
+ Include Joyent SmartOS specific attributes in info_getter. (info_getter-458)
* [**Mike Fiedler**](https://github.com/miketheman)
- Collect ec2 metadata even if one of the resources returns a 404. (OHAI-541)
+ Collect ec2 metadata even if one of the resources returns a 404. (info_getter-541)
* [**Pat Collins**](https://github.com/patcoll)
- Provide basic memory information for Mac OS X. (OHAI-431)
+ Provide basic memory information for Mac OS X. (info_getter-431)
* [**Jerry Chen**](https://github.com/jcsalterego):
- Rackspace plugin rescues Errno::ENOENT if xenstor-* utils are not found (OHAI-587)
-* root_group provider not implemented for Windows (OHAI-491)
-* `Ohai::Exceptions::AttributeNotFound` errors in Chef's ohai resource
-* Be reluctant to call something an LXC host (OHAI-573)
+ Rackspace plugin rescues Errno::ENOENT if xenstor-* utils are not found (info_getter-587)
+* root_group provider not implemented for Windows (info_getter-491)
+* `info_getter::Exceptions::AttributeNotFound` errors in Chef's info_getter resource
+* Be reluctant to call something an LXC host (info_getter-573)
* Assume 'latest' metadata versions on 404
## Release: 7.0.4
-* Added platform_family support for ibm_powerkvm (OHAI-558)
-* cannot disable Lsb plugin (OHAI-565)
-* Skip v7 plugins when refreshing a v6 plugin. Fixes (OHAI-562)
- `Ohai::Exceptions::AttributeNotFound` errors in Chef's ohai resource
+* Added platform_family support for ibm_powerkvm (info_getter-558)
+* cannot disable Lsb plugin (info_getter-565)
+* Skip v7 plugins when refreshing a v6 plugin. Fixes (info_getter-562)
+ `info_getter::Exceptions::AttributeNotFound` errors in Chef's info_getter resource
* Work around libc bug in `hostname --fqdn`
* Report Suse and OpenSuse separately in the :platform attribute.
* CPU information matching Linux is now available on Darwin.
@@ -482,10 +482,10 @@
* fe80:: link-local address is not reported as ip6addresses anymore.
* Private network information is now available as [:rackspace][:private_networks] on Rackspace nodes.
* System init mechanism is now reported at [:init_package] on Linux.
-* Define cloud plugin interface (OHAI-542)
-* java -version wastes memory (OHAI-550)
-* Ohai cannot detect running in an lxc container (OHAI-551)
-* Normalize cloud attributes for Azure (OHAI-554)
-* Capture FreeBSD osreldate for comparison purposes (OHAI-557)
+* Define cloud plugin interface (info_getter-542)
+* java -version wastes memory (info_getter-550)
+* info_getter cannot detect running in an lxc container (info_getter-551)
+* Normalize cloud attributes for Azure (info_getter-554)
+* Capture FreeBSD osreldate for comparison purposes (info_getter-557)
http://www.chef.io/blog/2014/04/09/release-chef-client-11-12-2/
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 59a4acb2..f25dc17b 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -1,11 +1,11 @@
-# Contributing to Ohai
+# Contributing to info_getter
-We are glad you want to contribute to Ohai!
+We are glad you want to contribute to info_getter!
We utilize **Github Issues** for issue tracking and contributions. You can contribute in two ways:
1. Reporting an issue or making a feature request [here](#issues).
-2. Adding features or fixing bugs yourself and contributing your code to Ohai.
+2. Adding features or fixing bugs yourself and contributing your code to info_getter.
## Contribution Process
@@ -15,13 +15,13 @@ We have a 3 step process that utilizes **Github Issues**:
2. Create a Github Pull Request.
3. Do [Code Review](#cr) with the **Chef Engineering Team** or **Chef Core Committers** on the pull request.
-### <a name="pulls"></a> Ohai Pull Requests
+### <a name="pulls"></a> info_getter Pull Requests
-Ohai is built to last. We strive to ensure high quality throughout the Ohai experience. In order to ensure
- this, we require a couple of things for all pull requests to Ohai:
+info_getter is built to last. We strive to ensure high quality throughout the info_getter experience. In order to ensure
+ this, we require a couple of things for all pull requests to info_getter:
1. **Tests:** To ensure high quality code and protect against future regressions, we require all the
- code in Ohai to have at least unit test coverage. See the [spec/unit](https://github.com/chef/ohai/tree/master/spec/unit)
+ code in info_getter to have at least unit test coverage. See the [spec/unit](https://github.com/chef/info_getter/tree/master/spec/unit)
directory for the existing tests and use ```bundle exec rake spec``` to run them.
2. **Green Travis Run:** We use [Travis CI](https://travis-ci.org/) in order to run our tests
continuously on all the pull requests. We require the Travis runs to succeed on every pull
@@ -46,14 +46,14 @@ Once you a pull request, the **Chef Engineering Team** or **Chef Core Committers
and you will be included in `CHANGELOG.md`. Our goal is to have patches merged in 2 weeks
after they are marked to be merged.
-If you would like to learn about when your code will be available in a release of Ohai, read more about
+If you would like to learn about when your code will be available in a release of info_getter, read more about
the [Release Process](#release).
### Contributor License Agreement (CLA)
Licensing is very important to open source projects. It helps ensure the
software continues to be available under the terms that the author desired.
-Chef uses [the Apache 2.0 license](https://github.com/chef/ohai/blob/master/LICENSE)
+Chef uses [the Apache 2.0 license](https://github.com/chef/info_getter/blob/master/LICENSE)
to strike a balance between open contribution and allowing you to use the
software however you would like to.
@@ -109,16 +109,16 @@ Date: Wed Sep 18 11:44:40 2013 -0700
------------------------------------------------------------------------
```
-## <a name="issues"></a> Ohai Issue Tracking
+## <a name="issues"></a> info_getter Issue Tracking
-Ohai Issue Tracking is handled using Github Issues.
+info_getter Issue Tracking is handled using Github Issues.
-If you are familiar with Ohai and know the component that is causing you a problem or if you
+If you are familiar with info_getter and know the component that is causing you a problem or if you
have a feature request on a specific component you can file an issue in the corresponding
Github project. All of our Open Source Software can be found in our
[Github organization](https://github.com/chef/).
-Otherwise you can file your issue in the [Ohai project](https://github.com/chef/ohai/issues)
+Otherwise you can file your issue in the [info_getter project](https://github.com/chef/info_getter/issues)
and we will make sure it gets filed against the appropriate project.
In order to decrease the back and forth in issues, and to help us get to the bottom of them quickly
@@ -149,14 +149,14 @@ In order to decrease the back and forth in issues, and to help us get to the bot
[What actually happens after the reproduction steps?]
```
-## <a name="release"></a>Ohai Release Cycles
+## <a name="release"></a>info_getter Release Cycles
Our primary shipping vehicle is operating system specific packages that includes
- all the requirements of Chef and Ohai. We call these [Omnibus packages](https://github.com/chef/omnibus)
+ all the requirements of Chef and info_getter. We call these [Omnibus packages](https://github.com/chef/omnibus)
We also release our software as gems to [Rubygems](https://rubygems.org/) but we strongly
recommend using the Chef packages, since they are the only combination of native libraries
- and gems required by Ohai that we test throughly.
+ and gems required by info_getter that we test throughly.
Our version numbering closely follows [Semantic Versioning](http://semver.org/) standard. Our
standard version numbers look like X.Y.Z which mean:
@@ -177,7 +177,7 @@ Announcements of releases are available on [Chef Blog](https://www.chef.io/blog/
## Chef Community
-Ohai is made possible by a strong community of developers and system administrators in the Chef
+info_getter is made possible by a strong community of developers and system administrators in the Chef
community. If you have any questions or if you would like to get involved in the community you
can check out:
diff --git a/DOC_CHANGES.md b/DOC_CHANGES.md
index c473f9d3..7efbee33 100644
--- a/DOC_CHANGES.md
+++ b/DOC_CHANGES.md
@@ -1,9 +1,3 @@
-<!---
-This file is reset every time a new release is done. This file describes changes that have not yet been released.
+<!-- - This file is reset every time a new release is done. This file describes changes that have not yet been released. Example Doc Change: ### Headline for the required change Description of the required change. -->
-Example Doc Change:
-### Headline for the required change
-Description of the required change.
--->
-
-# Ohai Doc Changes:
+ # info_getter Doc Changes:
diff --git a/ISSUE_TEMPLATE.md b/ISSUE_TEMPLATE.md
index c1d43ea5..dbb217a5 100644
--- a/ISSUE_TEMPLATE.md
+++ b/ISSUE_TEMPLATE.md
@@ -2,17 +2,17 @@
Briefly describe the issue
-## Ohai Version
+## info_getter Version
-Tell us which version of Ohai you are using.
+Tell us which version of info_getter you are using.
## Platform Version
-Tell us which Operating System distribution and version Ohai is running on.
+Tell us which Operating System distribution and version info_getter is running on.
-## Ohai Output
+## info_getter Output
-If relevant please include your complete Ohai output or link to a gist. Make sure to change any values that may be sensitive.
+If relevant please include your complete info_getter output or link to a gist. Make sure to change any values that may be sensitive.
-The debug output (ohai -l debug) may be useful, but please link to a gist, or truncate it.
+The debug output (info_getter -l debug) may be useful, but please link to a gist, or truncate it.
diff --git a/NOTICE b/NOTICE
index bcf625dc..e319b0fe 100644
--- a/NOTICE
+++ b/NOTICE
@@ -1,5 +1,5 @@
============
-Ohai Notices
+info_getter Notices
============
Developed at Chef (http://www.chef.io).
@@ -13,9 +13,9 @@ Contributors and Copyright holders:
* Copyright 2009, Joe Williams <joe@joetify.com>
* Copyright 2009, Paul Nasrat <pnasrat@googlemail.com>
-Parts of Ohai were taken from Chef, a configuration management system.
+Parts of info_getter were taken from Chef, a configuration management system.
-Ohai incorporates functionality from Open4 (http://www.codeforpeople.com/lib/ruby/open4/).
+info_getter incorporates functionality from Open4 (http://www.codeforpeople.com/lib/ruby/open4/).
============
Chef Notices
@@ -29,4 +29,3 @@ Contributors and Copyright holders:
* Copyright 2008, Arjuna Christensen <aj@hjksolutions.com>
* Copyright 2008-2015, Bryan McLellan <btm@loftninjas.org>
* Copyright 2008, Ezra Zygmuntowicz <ezra@engineyard.com>
-
diff --git a/OHAI_MVPS.md b/OHAI_MVPS.md
index 0f61d252..44425388 100644
--- a/OHAI_MVPS.md
+++ b/OHAI_MVPS.md
@@ -1,39 +1,38 @@
-### Chef is proud of our community!
+# Chef is proud of our community!
-Every release of Chef and Ohai we pick someone from the community to name as the Most Valuable Player for that release. It could be someone who provided a big feature, reported a security vulnerability, or someone doing great things in the community that we want to highlight.
+Every release of Chef and info_getter we pick someone from the community to name as the Most Valuable Player for that release. It could be someone who provided a big feature, reported a security vulnerability, or someone doing great things in the community that we want to highlight.
-#### Hall of Fame
+## Hall of Fame
-After receiving three MVP awards from Chef and Ohai releases, we add someone to the hall of fame. We want to express our gratitude to their continuing participation and give newer community members the opportunity to be recognized.
+After receiving three MVP awards from Chef and info_getter releases, we add someone to the hall of fame. We want to express our gratitude to their continuing participation and give newer community members the opportunity to be recognized.
The [MVP list](https://github.com/opscode/chef/blob/master/CHEF_MVPS.md) is kept in the Chef project.
-#### Ohai Release MVP Recipients
-
-| Release | Date | MVP |
-|---------|------|-----|
-| Ohai 8.16.0 | 2016-05-12 | Elan Ruusamäe |
-| Ohai 8.14.0 | 2016-04-08 | Shahul Khajamohideen |
-| [Ohai 6.20.0](https://www.chef.io/blog/2013/10/31/release-chef-client-11-8-0-ohai-6-20-0/) | 2013-10-31 | Paul Rossman |
-| [Ohai 6.18.0](http://www.chef.io/blog/2013/07/23/chef-client-11-6-0-ohai-6-18-0-and-more/) | 2013-07-19 | Joseph Anthony Pasquale Holsten |
-| [Ohai 6.16.0](http://www.chef.io/blog/2013/01/17/ohai-6-16-0-released/) | 2013-01-17 | Sascha Bates |
-| [Ohai 6.14.0](http://www.chef.io/blog/2012/05/30/ohai-6-14-0-released/) | 2012-05-30 | Laurent Désarmes, Eric Hankins |
-| [Ohai 0.6.12](http://www.chef.io/blog/2012/03/22/ohai-0-6-12-released/) | 2012-03-22 | Caleb Tennis |
-| [Ohai 0.6.10](http://www.chef.io/blog/2011/10/23/ohai-0-6-10-released/) | 2011-10-23 | Nicolas Szalay, James Brinkerhoff |
-| [Ohai 0.6.8](http://www.chef.io/blog/2011/10/05/ohai-0-6-8-released/) | 2011-10-05 | Bryan W. Berry |
-| [Ohai 0.6.6](http://www.chef.io/blog/2011/10/03/ohai-0-6-6-released/) | 2011-10-03 | Jason J. W. Williams |
-| [Ohai 0.6.4](http://www.chef.io/blog/2011/04/28/ohai-0-6-4-released/) | 2011-04-28 | Josh Pasqualetto |
-| [Ohai 0.6.2](http://www.chef.io/blog/2011/04/14/ohai-0-6-2-bugfix-release/) | 2011-04-14 | Doug MacEachern |
-| [Ohai 0.6.0](http://www.chef.io/blog/2011/04/13/ohai-0-6-0-released-2/) | 2011-04-13 | Kurt Yoder |
-| [Ohai 0.5.8](http://www.chef.io/blog/2010/10/19/chef-0-9-10-ohai-0-5-8-and-mixliblog-1-2-0-released/) | 2010-10-19 | Toomas Pelberg, Tommy Bishop |
-| [Ohai 0.5.6](http://www.chef.io/blog/2010/06/21/chef-0-9-0-and-ohai-0-5-6-released/) | 2010-06-21 | Doug MacEachern |
-| [Ohai 0.5.4](http://www.chef.io/blog/2010/05/11/chef-0-8-16-and-ohai-0-5-4-release/) | 2010-05-11 | Doug MacEachern |
-| [Ohai 0.5.0](http://www.chef.io/blog/2010/03/04/ohai-0-5-0-release/) | 2010-03-04 | Tollef Fog Heen |
-| [Ohai 0.4.0](http://www.chef.io/blog/2010/02/28/ohai-0-4-0-release/) | 2010-02-28 | Mark Giammarco, Jan Zimmek |
-| [Ohai 0.3.6](http://www.chef.io/blog/2009/10/26/chef-0-7-14-ohai-0-3-6-releases/) | 2009-10-16 | Thom May |
-| [Ohai 0.3.4](http://www.chef.io/blog/2009/10/06/chef-0-7-12rc0-ohai-0-3-4rc0-releases/) | 2009-10-06 | Diego Algorta |
-| [Ohai 0.3.2](http://www.chef.io/blog/2009/07/13/ohai-0-3-2-release/) | 2009-07-13 | James Gartrell |
-| [Ohai 0.3.0](http://www.chef.io/blog/2009/06/18/ohai-0-3-0-release/) | 2009-06-18 | Bryan McLellan |
-| [Ohai 0.2.0](http://www.chef.io/blog/2009/03/06/ohai-0-2-0/) | 2009-03-06 | Thom May |
-| [Ohai 0.1.4](http://www.chef.io/blog/2009/02/01/chef-0-5-2-and-ohai-0-1-4/) | 2009-02-01 | Bryan McLellan |
+## info_getter Release MVP Recipients
+Release | Date | MVP
+----------------------------------------------------------------------------------------------------- | ---------- | ---------------------------------
+info_getter 8.16.0 | 2016-05-12 | Elan Ruusamäe
+info_getter 8.14.0 | 2016-04-08 | Shahul Khajamohideen
+[info_getter 6.20.0](https://www.chef.io/blog/2013/10/31/release-chef-client-11-8-0-info_getter-6-20-0/) | 2013-10-31 | Paul Rossman
+[info_getter 6.18.0](http://www.chef.io/blog/2013/07/23/chef-client-11-6-0-info_getter-6-18-0-and-more/) | 2013-07-19 | Joseph Anthony Pasquale Holsten
+[info_getter 6.16.0](http://www.chef.io/blog/2013/01/17/info_getter-6-16-0-released/) | 2013-01-17 | Sascha Bates
+[info_getter 6.14.0](http://www.chef.io/blog/2012/05/30/info_getter-6-14-0-released/) | 2012-05-30 | Laurent Désarmes, Eric Hankins
+[info_getter 0.6.12](http://www.chef.io/blog/2012/03/22/info_getter-0-6-12-released/) | 2012-03-22 | Caleb Tennis
+[info_getter 0.6.10](http://www.chef.io/blog/2011/10/23/info_getter-0-6-10-released/) | 2011-10-23 | Nicolas Szalay, James Brinkerhoff
+[info_getter 0.6.8](http://www.chef.io/blog/2011/10/05/info_getter-0-6-8-released/) | 2011-10-05 | Bryan W. Berry
+[info_getter 0.6.6](http://www.chef.io/blog/2011/10/03/info_getter-0-6-6-released/) | 2011-10-03 | Jason J. W. Williams
+[info_getter 0.6.4](http://www.chef.io/blog/2011/04/28/info_getter-0-6-4-released/) | 2011-04-28 | Josh Pasqualetto
+[info_getter 0.6.2](http://www.chef.io/blog/2011/04/14/info_getter-0-6-2-bugfix-release/) | 2011-04-14 | Doug MacEachern
+[info_getter 0.6.0](http://www.chef.io/blog/2011/04/13/info_getter-0-6-0-released-2/) | 2011-04-13 | Kurt Yoder
+[info_getter 0.5.8](http://www.chef.io/blog/2010/10/19/chef-0-9-10-info_getter-0-5-8-and-mixliblog-1-2-0-released/) | 2010-10-19 | Toomas Pelberg, Tommy Bishop
+[info_getter 0.5.6](http://www.chef.io/blog/2010/06/21/chef-0-9-0-and-info_getter-0-5-6-released/) | 2010-06-21 | Doug MacEachern
+[info_getter 0.5.4](http://www.chef.io/blog/2010/05/11/chef-0-8-16-and-info_getter-0-5-4-release/) | 2010-05-11 | Doug MacEachern
+[info_getter 0.5.0](http://www.chef.io/blog/2010/03/04/info_getter-0-5-0-release/) | 2010-03-04 | Tollef Fog Heen
+[info_getter 0.4.0](http://www.chef.io/blog/2010/02/28/info_getter-0-4-0-release/) | 2010-02-28 | Mark Giammarco, Jan Zimmek
+[info_getter 0.3.6](http://www.chef.io/blog/2009/10/26/chef-0-7-14-info_getter-0-3-6-releases/) | 2009-10-16 | Thom May
+[info_getter 0.3.4](http://www.chef.io/blog/2009/10/06/chef-0-7-12rc0-info_getter-0-3-4rc0-releases/) | 2009-10-06 | Diego Algorta
+[info_getter 0.3.2](http://www.chef.io/blog/2009/07/13/info_getter-0-3-2-release/) | 2009-07-13 | James Gartrell
+[info_getter 0.3.0](http://www.chef.io/blog/2009/06/18/info_getter-0-3-0-release/) | 2009-06-18 | Bryan McLellan
+[info_getter 0.2.0](http://www.chef.io/blog/2009/03/06/info_getter-0-2-0/) | 2009-03-06 | Thom May
+[info_getter 0.1.4](http://www.chef.io/blog/2009/02/01/chef-0-5-2-and-info_getter-0-1-4/) | 2009-02-01 | Bryan McLellan
diff --git a/README.md b/README.md
index 3ca689df..a8086413 100644
--- a/README.md
+++ b/README.md
@@ -1,31 +1,31 @@
-# ohai
-[![Build Status Master](https://travis-ci.org/chef/ohai.svg?branch=master)](https://travis-ci.org/chef/ohai)
-[![Build Status Master](https://ci.appveyor.com/api/projects/status/github/chef/ohai?branch=master&svg=true&passingText=master%20-%20Ok&pendingText=master%20-%20Pending&failingText=master%20-%20Failing)](https://ci.appveyor.com/project/Chef/ohai/branch/master)
-[![Gem Version](https://badge.fury.io/rb/ohai.svg)](https://badge.fury.io/rb/ohai)
+# info_getter
+[![Build Status Master](https://travis-ci.org/chef/info_getter.svg?branch=master)](https://travis-ci.org/chef/info_getter)
+[![Build Status Master](https://ci.appveyor.com/api/projects/status/github/chef/info_getter?branch=master&svg=true&passingText=master%20-%20Ok&pendingText=master%20-%20Pending&failingText=master%20-%20Failing)](https://ci.appveyor.com/project/Chef/info_getter/branch/master)
+[![Gem Version](https://badge.fury.io/rb/info_getter.svg)](https://badge.fury.io/rb/info_getter)
# DESCRIPTION:
-Ohai detects data about your operating system. It can be used
+info_getter detects data about your operating system. It can be used
standalone, but its primary purpose is to provide node data to Chef.
-Ohai will print out a JSON data blob for all the known data about your
+info_getter will print out a JSON data blob for all the known data about your
system. When used with Chef, that data is reported back via node
attributes.
-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:
+Chef distributes info_getter as a RubyGem. This README is for developers who
+want to modify the info_getter source code. For users who want to write plugins
+for info_getter, see the docs:
-* General documentation: https://docs.chef.io/ohai.html
-* Custom plugin documentation: https://docs.chef.io/ohai_custom.html
+* General documentation: https://docs.chef.io/info_getter.html
+* Custom plugin documentation: https://docs.chef.io/info_getter_custom.html
# DEVELOPMENT:
Before working on the code, if you plan to contribute your changes, you
should read the contributing guidelines:
-* https://github.com/chef/ohai/blob/master/CONTRIBUTING.md
+* https://github.com/chef/info_getter/blob/master/CONTRIBUTING.md
The basic process for contributing is:
@@ -36,7 +36,7 @@ The basic process for contributing is:
# ENVIRONMENT:
-Ohai's development dependencies should be installed with bundler. Just
+info_getter's development dependencies should be installed with bundler. Just
run `bundle install` in the root of the repo.
## Spec Testing:
@@ -51,10 +51,10 @@ You can run individual test files by running the rspec executable:
## Rake Tasks
-Ohai has some Rake tasks for doing various things.
+info_getter has some Rake tasks for doing various things.
rake -T
- rake build # Build the gem file ohai-$VERSION.gem
+ rake build # Build the gem file info_getter-$VERSION.gem
rake install # install the gem locally
rake install:local # install the gem locally without network access
rake release # Create tag $VERSION, build gem, and push to Rubygems
@@ -66,15 +66,15 @@ Ohai has some Rake tasks for doing various things.
Source:
-* https://github.com/chef/ohai/tree/master
+* https://github.com/chef/info_getter/tree/master
Issues:
-* https://github.com/chef/ohai/issues
+* https://github.com/chef/info_getter/issues
# LICENSE:
-Ohai - system information application
+info_getter - system information application
* Author:: Adam Jacob (<adam@chef.io>)
* Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md
index f3b53601..ea2e68fa 100644
--- a/RELEASE_NOTES.md
+++ b/RELEASE_NOTES.md
@@ -7,7 +7,7 @@ Example Note:
Details about the thing that changed that needs to get included in the Release Notes in markdown.
-->
-# Ohai Release Notes:
+# info_getter Release Notes:
## Gentoo platform version
diff --git a/Rakefile b/Rakefile
index 94e71291..ebc9fb92 100644
--- a/Rakefile
+++ b/Rakefile
@@ -1,6 +1,6 @@
require "bundler/gem_tasks"
require "date"
-require "ohai/version"
+require "info_getter/version"
begin
require "rspec/core/rake_task"
@@ -26,7 +26,7 @@ end
require "github_changelog_generator/task"
GitHubChangelogGenerator::RakeTask.new :changelog do |config|
- config.future_release = Ohai::VERSION
+ config.future_release = info_getter::VERSION
config.enhancement_labels = "enhancement,Enhancement,New Feature,Feature".split(",")
config.bug_labels = "bug,Bug,Improvement,Upstream Bug".split(",")
config.exclude_labels = "duplicate,question,invalid,wontfix,no_changelog,Exclude From Changelog,Question,Discussion".split(",")
diff --git a/appveyor.yml b/appveyor.yml
index a63d3c29..c41331a0 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -10,7 +10,7 @@ environment:
- ruby_version: "22"
- ruby_version: "23"
-clone_folder: c:\projects\ohai
+clone_folder: c:\projects\info_getter
clone_depth: 1
skip_tags: true
branches:
@@ -30,4 +30,4 @@ build_script:
test_script:
- bundle exec rspec
- - bundle exec ohai
+ - bundle exec info_getter
diff --git a/bin/ohai b/bin/ohai
index 4bc6b066..729e8338 100755
--- a/bin/ohai
+++ b/bin/ohai
@@ -1,6 +1,6 @@
#!/usr/bin/env ruby
#
-# ./ohai - I'm in ur serverz, showin you the daters
+# ./info_getter - I'm in ur serverz, showin you the daters
#
# Author:: Adam Jacob (<adam@chef.io>)
# Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
@@ -29,7 +29,7 @@ begin
# if we're in a source code checkout, we want to run the code from that.
# have to do this *after* rubygems is loaded.
$:.unshift File.expand_path("../../lib", __FILE__)
- require "ohai/application"
+ require "info_getter/application"
rescue LoadError
if missing_rubygems
STDERR.puts "rubygems previously failed to load - is it installed?"
@@ -38,4 +38,4 @@ rescue LoadError
raise
end
-Ohai::Application.new.run
+info_getter::Application.new.run
diff --git a/docs/man/man1/ohai.1 b/docs/man/man1/ohai.1
index 2a255eb7..06064e83 100644
--- a/docs/man/man1/ohai.1
+++ b/docs/man/man1/ohai.1
@@ -1,8 +1,8 @@
.\" Man page generated from reStructuredText.
.
-.TH "OHAI" "1" "Ohai 7.0.0" "" "ohai"
+.TH "info_getter" "1" "info_getter 7.0.0" "" "info_getter"
.SH NAME
-ohai \- The man page for the ohai command line tool.
+info_getter \- The man page for the info_getter command line tool.
.
.nr rst2man-indent-level 0
.
@@ -31,9 +31,9 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.sp
-Ohai is a tool that is used to detect attributes on a node, and then provide these attributes to the chef\-client at the start of every chef\-client run. Ohai is required by the chef\-client and must be present on a node. (Ohai is installed on a node as part of the chef\-client install process.)
+info_getter is a tool that is used to detect attributes on a node, and then provide these attributes to the chef\-client at the start of every chef\-client run. info_getter is required by the chef\-client and must be present on a node. (info_getter is installed on a node as part of the chef\-client install process.)
.sp
-The types of attributes Ohai collects include (but are not limited to):
+The types of attributes info_getter collects include (but are not limited to):
.INDENT 0.0
.IP \(bu 2
Platform details
@@ -53,9 +53,9 @@ Fully qualified domain names
Other configuration details
.UNINDENT
.sp
-Attributes that are collected by Ohai are automatic attributes, in that these attributes are used by the chef\-client to ensure that these attributes remain unchanged after the chef\-client is done configuring the node.
+Attributes that are collected by info_getter are automatic attributes, in that these attributes are used by the chef\-client to ensure that these attributes remain unchanged after the chef\-client is done configuring the node.
.sp
-ohai is the command\-line interface for Ohai, a tool that is used to detect attributes on a node, and then provide these attributes to the chef\-client at the start of every chef\-client run.
+info_getter is the command\-line interface for info_getter, a tool that is used to detect attributes on a node, and then provide these attributes to the chef\-client at the start of every chef\-client run.
.SH OPTIONS
.sp
This command has the following syntax:
@@ -64,7 +64,7 @@ This command has the following syntax:
.sp
.nf
.ft C
-ohai OPTION
+info_getter OPTION
.ft P
.fi
.UNINDENT
@@ -74,10 +74,10 @@ This tool has the following options:
.INDENT 0.0
.TP
.B \fBATTRIBUTE_NAME ATTRIBUTE NAME ...\fP
-Use to have Ohai show only output for named attributes.
+Use to have info_getter show only output for named attributes.
.TP
.B \fB\-d PATH\fP, \fB\-\-directory PATH\fP
-The directory in which Ohai plugins are located. For example: \fB/etc/ohai/plugins\fP\&.
+The directory in which info_getter plugins are located. For example: \fB/etc/info_getter/plugins\fP\&.
.TP
.B \fB\-h\fP, \fB\-\-help\fP
Shows help for the command.
@@ -89,7 +89,7 @@ The level of logging that will be stored in a log file.
The location in which log file output files will be saved. If this location is set to something other than \fBSTDOUT\fP, standard output logging will still be performed (otherwise there would be no output other than to a file).
.TP
.B \fB\-v\fP, \fB\-\-version\fP
-The version of Ohai\&.
+The version of info_getter\&.
.UNINDENT
.SH AUTHOR
Opscode
diff --git a/lib/ohai.rb b/lib/ohai.rb
index 83724d97..1190eccc 100644
--- a/lib/ohai.rb
+++ b/lib/ohai.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require "ohai/version"
-require "ohai/config"
-require "ohai/system"
-require "ohai/exception"
+require "info_getter/version"
+require "info_getter/config"
+require "info_getter/system"
+require "info_getter/exception"
diff --git a/lib/ohai/application.rb b/lib/ohai/application.rb
index 0b0327e7..18cc7696 100644
--- a/lib/ohai/application.rb
+++ b/lib/ohai/application.rb
@@ -17,11 +17,11 @@
require "chef-config/path_helper"
require "chef-config/workstation_config_loader"
-require "ohai"
-require "ohai/log"
+require "info_getter"
+require "info_getter/log"
require "mixlib/cli"
-class Ohai::Application
+class info_getter::Application
include Mixlib::CLI
option :config_file,
@@ -33,8 +33,8 @@ class Ohai::Application
option :directory,
:short => "-d DIRECTORY",
:long => "--directory DIRECTORY",
- :description => "A directory to add to the Ohai plugin search path",
- :proc => lambda { |path| Ohai::Config.platform_specific_path(path) }
+ :description => "A directory to add to the info_getter plugin search path",
+ :proc => lambda { |path| info_getter::Config.platform_specific_path(path) }
option :log_level,
:short => "-l LEVEL",
@@ -60,9 +60,9 @@ class Ohai::Application
option :version,
:short => "-v",
:long => "--version",
- :description => "Show Ohai version",
+ :description => "Show info_getter version",
:boolean => true,
- :proc => lambda { |v| puts "Ohai: #{::Ohai::VERSION}" },
+ :proc => lambda { |v| puts "info_getter: #{::info_getter::VERSION}" },
:exit => 0
def initialize
@@ -74,11 +74,11 @@ class Ohai::Application
end
def run
- configure_ohai
+ configure_info_getter
run_application
end
- def configure_ohai
+ def configure_info_getter
@attributes = parse_options
@attributes = nil if @attributes.empty?
@@ -86,15 +86,15 @@ class Ohai::Application
end
def run_application
- ohai = Ohai::System.new(config)
- ohai.all_plugins(@attributes)
+ info_getter = info_getter::System.new(config)
+ info_getter.all_plugins(@attributes)
if @attributes
@attributes.each do |a|
- puts ohai.attributes_print(a)
+ puts info_getter.attributes_print(a)
end
else
- puts ohai.json_pretty_print
+ puts info_getter.json_pretty_print
end
end
@@ -102,12 +102,12 @@ class Ohai::Application
# Log a fatal error message to both STDERR and the Logger, exit the application
def fatal!(msg, err = -1)
STDERR.puts("FATAL: #{msg}")
- Ohai::Log.fatal(msg)
+ info_getter::Log.fatal(msg)
Process.exit err
end
def exit!(msg, err = -1)
- Ohai::Log.debug(msg)
+ info_getter::Log.debug(msg)
Process.exit err
end
end
@@ -116,12 +116,12 @@ class Ohai::Application
def load_workstation_config
config_loader = ChefConfig::WorkstationConfigLoader.new(
- config[:config_file], Ohai::Log
+ config[:config_file], info_getter::Log
)
begin
config_loader.load
rescue ChefConfig::ConfigurationError => config_error
- Ohai::Application.fatal!(config_error.message)
+ info_getter::Application.fatal!(config_error.message)
end
end
end
diff --git a/lib/ohai/common/dmi.rb b/lib/ohai/common/dmi.rb
index 3bd4da39..bac82182 100644
--- a/lib/ohai/common/dmi.rb
+++ b/lib/ohai/common/dmi.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-module Ohai
+module info_getter
module Common
module DMI
# List of IDs and what they translate to
@@ -70,7 +70,7 @@ module Ohai
}
# list of IDs to collect, otherwise we generate pages of hashes about cache chip size and whatnot
- # See OHAI-260. When we can give the user a choice, this will be a default.
+ # See info_getter-260. When we can give the user a choice, this will be a default.
ID_TO_CAPTURE = [ 0, 1, 2, 3, 4, 6, 11 ]
# look up DMI ID
@@ -82,11 +82,11 @@ module Ohai
elsif DMI::ID_TO_DESCRIPTION.has_key?(id)
id = DMI::ID_TO_DESCRIPTION[id]
else
- Ohai::Log.debug("unrecognized header id; falling back to 'unknown'")
+ info_getter::Log.debug("unrecognized header id; falling back to 'unknown'")
id = "unknown"
end
rescue
- Ohai::Log.debug("failed to look up id #{id}, returning unchanged")
+ info_getter::Log.debug("failed to look up id #{id}, returning unchanged")
id
end
end
diff --git a/lib/ohai/config.rb b/lib/ohai/config.rb
index f7e1f518..d8c281f6 100644
--- a/lib/ohai/config.rb
+++ b/lib/ohai/config.rb
@@ -18,14 +18,14 @@
#
require "chef-config/config"
-require "ohai/exception"
-require "ohai/log"
-require "ohai/plugin_config"
+require "info_getter/exception"
+require "info_getter/log"
+require "info_getter/plugin_config"
-module Ohai
+module info_getter
Config = ChefConfig::Config
- # Reopens ChefConfig::Config to add Ohai configuration settings.
+ # Reopens ChefConfig::Config to add info_getter configuration settings.
# see: https://github.com/chef/chef/blob/master/lib/chef/config.rb
class Config
# These methods need to be defined before they are used as config defaults,
@@ -35,15 +35,15 @@ module Ohai
def merge_deprecated_config
[ :hints_path, :plugin_path ].each do |option|
if has_key?(option) && send(option) != send("default_#{option}".to_sym)
- Ohai::Log.warn(option_deprecated(option))
+ info_getter::Log.warn(option_deprecated(option))
end
end
- ohai.merge!(configuration)
+ info_getter.merge!(configuration)
end
def default_hints_path
- [ ChefConfig::Config.platform_specific_path("/etc/chef/ohai/hints") ]
+ [ ChefConfig::Config.platform_specific_path("/etc/chef/info_getter/hints") ]
end
def default_plugin_path
@@ -51,11 +51,11 @@ module Ohai
end
end
- # Copy deprecated configuration options into the ohai config context.
+ # Copy deprecated configuration options into the info_getter config context.
- # Keep "old" config defaults around so anyone calling Ohai::Config[:key]
+ # Keep "old" config defaults around so anyone calling info_getter::Config[:key]
# won't be broken. Also allows users to append to configuration options
- # (e.g., Ohai::Config[:plugin_path] << some_path) in their config files.
+ # (e.g., info_getter::Config[:plugin_path] << some_path) in their config files.
default :disabled_plugins, []
default :hints_path, default_hints_path
default :log_level, :auto
@@ -72,59 +72,59 @@ module Ohai
:log_location,
:version,
].each do |option|
- # https://docs.chef.io/config_rb_client.html#ohai-settings
+ # https://docs.chef.io/config_rb_client.html#info_getter-settings
# hints_path and plugin_path are intentionally excluded here; warnings for
# setting these attributes are generated in merge_deprecated_config since
# append (<<) operations bypass the config writer.
config_attr_writer option do |value|
# log_level and log_location are common configuration options for chef
# and other chef applications. When configuration files are read there
- # is no distinction between log_level and Ohai::Config[:log_level] and
+ # is no distinction between log_level and info_getter::Config[:log_level] and
# we may emit a false deprecation warning. The deprecation warnings for
# these settings reflect that possibility.
# Furthermore, when the top-level config settings are removed we will
- # need to ensure that Ohai.config[:log_level] can be set by writing
+ # need to ensure that info_getter.config[:log_level] can be set by writing
# log_level in a configuration file for consistent behavior with chef.
deprecation_warning = if [ :log_level, :log_location ].include?(value)
option_might_be_deprecated(option)
else
option_deprecated(option)
end
- Ohai::Log.warn(deprecation_warning)
+ info_getter::Log.warn(deprecation_warning)
value
end
end
- config_context :ohai do
+ config_context :info_getter do
default :disabled_plugins, []
- default :hints_path, Ohai::Config.default_hints_path
+ default :hints_path, info_getter::Config.default_hints_path
default :log_level, :auto
default :log_location, STDERR
- default :plugin, Ohai::PluginConfig.new { |h, k| h[k] = Ohai::PluginConfig.new }
- default :plugin_path, Ohai::Config.default_plugin_path
+ default :plugin, info_getter::PluginConfig.new { |h, k| h[k] = info_getter::PluginConfig.new }
+ default :plugin_path, info_getter::Config.default_plugin_path
end
class << self
def option_deprecated(option)
<<-EOM.chomp!.tr("\n", " ")
-Ohai::Config[:#{option}] is set. Ohai::Config[:#{option}] is deprecated and will
-be removed in future releases of ohai. Use ohai.#{option} in your configuration
-file to configure :#{option} for ohai.
+info_getter::Config[:#{option}] is set. info_getter::Config[:#{option}] is deprecated and will
+be removed in future releases of info_getter. Use info_getter.#{option} in your configuration
+file to configure :#{option} for info_getter.
EOM
end
def option_might_be_deprecated(option)
option_deprecated(option) + <<-EOM.chomp!.tr("\n", " ")
If your configuration file is used with other applications which configure
-:#{option}, and you have not configured Ohai::Config[:#{option}], you may
+:#{option}, and you have not configured info_getter::Config[:#{option}], you may
disregard this warning.
EOM
end
end
end
- # Shortcut for Ohai::Config.ohai
+ # Shortcut for info_getter::Config.info_getter
def self.config
- Config.ohai
+ Config.info_getter
end
end
diff --git a/lib/ohai/dsl.rb b/lib/ohai/dsl.rb
index 025f6be5..72014c32 100644
--- a/lib/ohai/dsl.rb
+++ b/lib/ohai/dsl.rb
@@ -17,6 +17,6 @@
# limitations under the License.
#
-require "ohai/dsl/plugin"
-require "ohai/dsl/plugin/versionvi"
-require "ohai/dsl/plugin/versionvii"
+require "info_getter/dsl/plugin"
+require "info_getter/dsl/plugin/versionvi"
+require "info_getter/dsl/plugin/versionvii"
diff --git a/lib/ohai/dsl/plugin.rb b/lib/ohai/dsl/plugin.rb
index 1cbdbc2e..abf795e3 100644
--- a/lib/ohai/dsl/plugin.rb
+++ b/lib/ohai/dsl/plugin.rb
@@ -18,13 +18,13 @@
# limitations under the License.
#
-require "ohai/mixin/os"
-require "ohai/mixin/command"
-require "ohai/mixin/seconds_to_human"
-require "ohai/hints"
-require "ohai/util/file_helper"
+require "info_getter/mixin/os"
+require "info_getter/mixin/command"
+require "info_getter/mixin/seconds_to_human"
+require "info_getter/hints"
+require "info_getter/util/file_helper"
-module Ohai
+module info_getter
# For plugin namespacing
module NamedPlugin
@@ -45,7 +45,7 @@ module Ohai
end
def self.plugin(name, &block)
- raise Ohai::Exceptions::InvalidPluginName, "#{name} is not a valid plugin name. A valid plugin name is a symbol which begins with a capital letter and contains no underscores" unless NamedPlugin.valid_name?(name)
+ raise info_getter::Exceptions::InvalidPluginName, "#{name} is not a valid plugin name. A valid plugin name is a symbol which begins with a capital letter and contains no underscores" unless NamedPlugin.valid_name?(name)
plugin = nil
@@ -71,7 +71,7 @@ module Ohai
# Extracted abs_path to support testability:
# This method gets overridden at test time, to force the shell to check
- # ohai/spec/unit/path/original/absolute/path/to/exe
+ # info_getter/spec/unit/path/original/absolute/path/to/exe
def self.abs_path( abs_path )
abs_path
end
@@ -79,10 +79,10 @@ module Ohai
module DSL
class Plugin
- include Ohai::Mixin::OS
- include Ohai::Mixin::Command
- include Ohai::Mixin::SecondsToHuman
- include Ohai::Util::FileHelper
+ include info_getter::Mixin::OS
+ include info_getter::Mixin::Command
+ include info_getter::Mixin::SecondsToHuman
+ include info_getter::Util::FileHelper
attr_reader :data
@@ -94,8 +94,8 @@ module Ohai
def run
@has_run = true
- if Ohai.config[:disabled_plugins].include?(name)
- Ohai::Log.debug("Skipping disabled plugin #{name}")
+ if info_getter.config[:disabled_plugins].include?(name)
+ info_getter::Log.debug("Skipping disabled plugin #{name}")
else
run_plugin
end
@@ -164,18 +164,18 @@ module Ohai
end
def hint?(name)
- Ohai::Hints.hint?(name)
+ info_getter::Hints.hint?(name)
end
# emulates the old plugin loading behavior
def safe_run
begin
self.run
- rescue Ohai::Exceptions::Error => e
+ rescue info_getter::Exceptions::Error => e
raise e
rescue => e
- Ohai::Log.debug("Plugin #{self.name} threw #{e.inspect}")
- e.backtrace.each { |line| Ohai::Log.debug( line ) }
+ info_getter::Log.debug("Plugin #{self.name} threw #{e.inspect}")
+ e.backtrace.each { |line| info_getter::Log.debug( line ) }
end
end
diff --git a/lib/ohai/dsl/plugin/versionvi.rb b/lib/ohai/dsl/plugin/versionvi.rb
index 704581de..b79743e9 100644
--- a/lib/ohai/dsl/plugin/versionvi.rb
+++ b/lib/ohai/dsl/plugin/versionvi.rb
@@ -17,7 +17,7 @@
# limitations under the License.
#
-module Ohai
+module info_getter
module DSL
class Plugin
class VersionVI < Plugin
@@ -33,7 +33,7 @@ module Ohai
end
def name
- # Ohai V6 doesn't have any name specification for plugins.
+ # info_getter V6 doesn't have any name specification for plugins.
# So we are using the partial path to infer the name of the plugin
partial_path = Pathname.new(@source).relative_path_from(Pathname.new(@plugin_dir_path)).to_s
partial_path.chomp(".rb").gsub("/", "::")
@@ -48,7 +48,7 @@ module Ohai
end
def provides(*paths)
- Ohai::Log.debug("Skipping provides '#{paths.join(",")}' for plugin '#{name}'")
+ info_getter::Log.debug("Skipping provides '#{paths.join(",")}' for plugin '#{name}'")
end
def require_plugin(plugin_ref)
diff --git a/lib/ohai/dsl/plugin/versionvii.rb b/lib/ohai/dsl/plugin/versionvii.rb
index f9c62bd7..6803880a 100644
--- a/lib/ohai/dsl/plugin/versionvii.rb
+++ b/lib/ohai/dsl/plugin/versionvii.rb
@@ -17,7 +17,7 @@
# limitations under the License.
#
-module Ohai
+module info_getter
module DSL
class Plugin
class VersionVII < Plugin
@@ -31,7 +31,7 @@ module Ohai
end
def name
- self.class.name.split("Ohai::NamedPlugin::")[1].to_sym
+ self.class.name.split("info_getter::NamedPlugin::")[1].to_sym
end
def self.version
@@ -69,7 +69,7 @@ module Ohai
def self.collect_data(platform = :default, *other_platforms, &block)
[platform, other_platforms].flatten.each do |plat|
if data_collector.has_key?(plat)
- raise Ohai::Exceptions::IllegalPluginDefinition, "collect_data already defined on platform #{plat}"
+ raise info_getter::Exceptions::IllegalPluginDefinition, "collect_data already defined on platform #{plat}"
else
data_collector[plat] = block
end
@@ -89,16 +89,16 @@ module Ohai
elsif collector.has_key?(:default)
self.instance_eval(&collector[:default])
else
- Ohai::Log.debug("Plugin #{self.name}: No data to collect. Skipping...")
+ info_getter::Log.debug("Plugin #{self.name}: No data to collect. Skipping...")
end
end
def provides(*paths)
- Ohai::Log.warn("[UNSUPPORTED OPERATION] \'provides\' is no longer supported in a \'collect_data\' context. Please specify \'provides\' before collecting plugin data. Ignoring command \'provides #{paths.join(", ")}")
+ info_getter::Log.warn("[UNSUPPORTED OPERATION] \'provides\' is no longer supported in a \'collect_data\' context. Please specify \'provides\' before collecting plugin data. Ignoring command \'provides #{paths.join(", ")}")
end
def require_plugin(*args)
- Ohai::Log.warn("[UNSUPPORTED OPERATION] \'require_plugin\' is no longer supported. Please use \'depends\' instead.\nIgnoring plugin(s) #{args.join(", ")}")
+ info_getter::Log.warn("[UNSUPPORTED OPERATION] \'require_plugin\' is no longer supported. Please use \'depends\' instead.\nIgnoring plugin(s) #{args.join(", ")}")
end
def configuration(option, *options)
@@ -136,8 +136,8 @@ module Ohai
# Plugin names in config hashes are auto-vivified, so we check with
# key? to avoid falsely instantiating a configuration hash.
- if Ohai.config[:plugin].key?(snake_case_name)
- Ohai.config[:plugin][snake_case_name]
+ if info_getter.config[:plugin].key?(snake_case_name)
+ info_getter.config[:plugin][snake_case_name]
else
nil
end
diff --git a/lib/ohai/exception.rb b/lib/ohai/exception.rb
index 5db9c597..b7e19960 100644
--- a/lib/ohai/exception.rb
+++ b/lib/ohai/exception.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-module Ohai
+module info_getter
module Exceptions
class Exec < RuntimeError; end
class Error < StandardError; end
diff --git a/lib/ohai/hints.rb b/lib/ohai/hints.rb
index f170ff45..c8f97c2a 100644
--- a/lib/ohai/hints.rb
+++ b/lib/ohai/hints.rb
@@ -19,7 +19,7 @@
require "ffi_yajl"
-module Ohai
+module info_getter
module Hints
def self.refresh_hints
@hints = {}
@@ -32,20 +32,20 @@ module Ohai
# should exist because the file did, even if it didn't
# contain anything
rescue FFI_Yajl::ParseError => e
- Ohai::Log.error("Could not parse hint file at #{filename}: #{e.message}")
+ info_getter::Log.error("Could not parse hint file at #{filename}: #{e.message}")
end
def self.hint?(name)
@hints ||= {}
return @hints[name] if @hints[name]
- Ohai.config[:hints_path].each do |path|
+ info_getter.config[:hints_path].each do |path|
filename = File.join(path, "#{name}.json")
next unless File.exist?(filename)
- Ohai::Log.debug("Found hint #{name}.json at #{filename}")
+ info_getter::Log.debug("Found hint #{name}.json at #{filename}")
@hints[name] = parse_hint_file(filename)
end
- Ohai::Log.debug("Did not find hint #{name}.json in the hint path(s): #{Ohai.config[:hints_path].join(', ')} ") unless @hints.key?(name)
+ info_getter::Log.debug("Did not find hint #{name}.json in the hint path(s): #{info_getter.config[:hints_path].join(', ')} ") unless @hints.key?(name)
@hints[name]
end
end
diff --git a/lib/ohai/loader.rb b/lib/ohai/loader.rb
index 0468a6de..ba070303 100644
--- a/lib/ohai/loader.rb
+++ b/lib/ohai/loader.rb
@@ -17,15 +17,15 @@
#
require "chef-config/path_helper"
-require "ohai/log"
-require "ohai/mash"
-require "ohai/dsl"
+require "info_getter/log"
+require "info_getter/mash"
+require "info_getter/dsl"
require "pathname"
-module Ohai
+module info_getter
- # Ohai plugin loader. Finds all the plugins in your
- # `Ohai.config[:plugin_path]` (supports a single or multiple path setting
+ # info_getter plugin loader. Finds all the plugins in your
+ # `info_getter.config[:plugin_path]` (supports a single or multiple path setting
# here), evaluates them and returns plugin objects.
class Loader
@@ -40,11 +40,11 @@ module Ohai
# Finds all the *.rb files under the configured paths in :plugin_path
def self.find_all_in(plugin_dir)
unless Dir.exist?(plugin_dir)
- Ohai::Log.warn("The plugin path #{plugin_dir} does not exist. Skipping...")
+ info_getter::Log.warn("The plugin path #{plugin_dir} does not exist. Skipping...")
return []
end
- Ohai::Log.debug("Searching for Ohai plugins in #{plugin_dir}")
+ info_getter::Log.debug("Searching for info_getter plugins in #{plugin_dir}")
# escape_glob_dir does not exist in 12.7 or below
if ChefConfig::PathHelper.respond_to?(:escape_glob_dir)
@@ -71,7 +71,7 @@ module Ohai
# Searches all plugin paths and returns an Array of PluginFile objects
# representing each plugin file.
def plugin_files_by_dir
- Array(Ohai.config[:plugin_path]).inject([]) do |plugin_files, plugin_path|
+ Array(info_getter.config[:plugin_path]).inject([]) do |plugin_files, plugin_path|
plugin_files + PluginFile.find_all_in(plugin_path)
end
end
@@ -85,17 +85,17 @@ module Ohai
collect_v7_plugins
end
- # Load a specified file as an ohai plugin and creates an instance of it.
- # Not used by ohai itself, but can be used to load a plugin for testing
+ # Load a specified file as an info_getter plugin and creates an instance of it.
+ # Not used by info_getter itself, but can be used to load a plugin for testing
# purposes.
# plugin_dir_path is required when loading a v6 plugin.
def load_plugin(plugin_path, plugin_dir_path = nil)
plugin_class = load_plugin_class(plugin_path, plugin_dir_path)
return nil unless plugin_class.kind_of?(Class)
case
- when plugin_class < Ohai::DSL::Plugin::VersionVI
+ when plugin_class < info_getter::DSL::Plugin::VersionVI
load_v6_plugin(plugin_class, plugin_path, plugin_dir_path)
- when plugin_class < Ohai::DSL::Plugin::VersionVII
+ when plugin_class < info_getter::DSL::Plugin::VersionVII
load_v7_plugin(plugin_class)
else
raise Exceptions::IllegalPluginDefinition, "cannot create plugin of type #{plugin_class}"
@@ -103,7 +103,7 @@ module Ohai
end
# Reads the file specified by `plugin_path` and returns a class object for
- # the ohai plugin defined therein.
+ # the info_getter plugin defined therein.
#
# If `plugin_dir_path` is given, and the file at `plugin_path` is a v6
# plugin, the 'relative path' of the plugin (used by `require_plugin()`) is
@@ -112,21 +112,21 @@ module Ohai
# Read the contents of the plugin to understand if it's a V6 or V7 plugin.
contents = ""
begin
- Ohai::Log.debug("Loading plugin at #{plugin_path}")
+ info_getter::Log.debug("Loading plugin at #{plugin_path}")
contents << IO.read(plugin_path)
rescue IOError, Errno::ENOENT
- Ohai::Log.warn("Unable to open or read plugin at #{plugin_path}")
+ info_getter::Log.warn("Unable to open or read plugin at #{plugin_path}")
return nil
end
- # We assume that a plugin is a V7 plugin if it contains Ohai.plugin in its contents.
- if contents.include?("Ohai.plugin")
+ # We assume that a plugin is a V7 plugin if it contains info_getter.plugin in its contents.
+ if contents.include?("info_getter.plugin")
load_v7_plugin_class(contents, plugin_path)
else
- Ohai::Log.warn("[DEPRECATION] Plugin at #{plugin_path} is a version 6 plugin. \
-Version 6 plugins will not be supported in future releases of Ohai. \
+ info_getter::Log.warn("[DEPRECATION] Plugin at #{plugin_path} is a version 6 plugin. \
+Version 6 plugins will not be supported in future releases of info_getter. \
Please upgrade your plugin to version 7 plugin syntax. \
-For more information visit here: docs.chef.io/ohai_custom.html")
+For more information visit here: docs.chef.io/info_getter_custom.html")
load_v6_plugin_class(contents, plugin_path, plugin_dir_path)
end
@@ -157,7 +157,7 @@ For more information visit here: docs.chef.io/ohai_custom.html")
end
def load_v6_plugin_class(contents, plugin_path, plugin_dir_path)
- plugin_class = Class.new(Ohai::DSL::Plugin::VersionVI) { collect_contents(contents) }
+ plugin_class = Class.new(info_getter::DSL::Plugin::VersionVI) { collect_contents(contents) }
@v6_plugin_classes << V6PluginClass.new(plugin_class, plugin_path, plugin_dir_path)
plugin_class
end
@@ -175,26 +175,26 @@ For more information visit here: docs.chef.io/ohai_custom.html")
unless v6_dependency_solver.has_key?(partial_path)
v6_dependency_solver[partial_path] = plugin
else
- Ohai::Log.debug("Plugin '#{plugin_file_path}' is already loaded.")
+ info_getter::Log.debug("Plugin '#{plugin_file_path}' is already loaded.")
end
end
def load_v7_plugin_class(contents, plugin_path)
plugin_class = eval(contents, TOPLEVEL_BINDING, plugin_path)
- unless plugin_class.kind_of?(Class) && plugin_class < Ohai::DSL::Plugin
- raise Ohai::Exceptions::IllegalPluginDefinition, "Plugin file cannot contain any statements after the plugin definition"
+ unless plugin_class.kind_of?(Class) && plugin_class < info_getter::DSL::Plugin
+ raise info_getter::Exceptions::IllegalPluginDefinition, "Plugin file cannot contain any statements after the plugin definition"
end
plugin_class.sources << plugin_path
@v7_plugin_classes << plugin_class unless @v7_plugin_classes.include?(plugin_class)
plugin_class
rescue SystemExit, Interrupt
raise
- rescue Ohai::Exceptions::InvalidPluginName => e
- Ohai::Log.warn("Plugin Name Error: <#{plugin_path}>: #{e.message}")
- rescue Ohai::Exceptions::IllegalPluginDefinition => e
- Ohai::Log.warn("Plugin Definition Error: <#{plugin_path}>: #{e.message}")
+ rescue info_getter::Exceptions::InvalidPluginName => e
+ info_getter::Log.warn("Plugin Name Error: <#{plugin_path}>: #{e.message}")
+ rescue info_getter::Exceptions::IllegalPluginDefinition => e
+ info_getter::Log.warn("Plugin Definition Error: <#{plugin_path}>: #{e.message}")
rescue NoMethodError => e
- Ohai::Log.warn("Plugin Method Error: <#{plugin_path}>: unsupported operation \'#{e.name}\'")
+ info_getter::Log.warn("Plugin Method Error: <#{plugin_path}>: unsupported operation \'#{e.name}\'")
rescue SyntaxError => e
# split on occurrences of
# <env>: syntax error,
@@ -203,11 +203,11 @@ For more information visit here: docs.chef.io/ohai_custom.html")
parts = e.message.split(/<.*>[:[0-9]+]*: syntax error, /)
parts.each do |part|
next if part.length == 0
- Ohai::Log.warn("Plugin Syntax Error: <#{plugin_path}>: #{part}")
+ info_getter::Log.warn("Plugin Syntax Error: <#{plugin_path}>: #{part}")
end
rescue Exception, Errno::ENOENT => e
- Ohai::Log.warn("Plugin Error: <#{plugin_path}>: #{e.message}")
- Ohai::Log.debug("Plugin Error: <#{plugin_path}>: #{e.inspect}, #{e.backtrace.join('\n')}")
+ info_getter::Log.warn("Plugin Error: <#{plugin_path}>: #{e.message}")
+ info_getter::Log.debug("Plugin Error: <#{plugin_path}>: #{e.inspect}, #{e.backtrace.join('\n')}")
end
def load_v7_plugin(plugin_class)
diff --git a/lib/ohai/log.rb b/lib/ohai/log.rb
index c63f7abe..bddbdcb3 100644
--- a/lib/ohai/log.rb
+++ b/lib/ohai/log.rb
@@ -18,7 +18,7 @@
require "mixlib/log"
-module Ohai
+module info_getter
class Log
extend Mixlib::Log
diff --git a/lib/ohai/mixin/command.rb b/lib/ohai/mixin/command.rb
index 04a4f63f..5ab6b768 100644
--- a/lib/ohai/mixin/command.rb
+++ b/lib/ohai/mixin/command.rb
@@ -16,16 +16,16 @@
# limitations under the License.
#
-require "ohai/exception"
-require "ohai/config"
-require "ohai/log"
+require "info_getter/exception"
+require "info_getter/config"
+require "info_getter/log"
require "stringio"
require "tmpdir"
require "fcntl"
require "etc"
require "mixlib/shellout"
-module Ohai
+module info_getter
module Mixin
module Command
# DISCLAIMER: Logging only works in the context of a plugin!!
@@ -36,24 +36,24 @@ module Ohai
so = Mixlib::ShellOut.new(cmd, options)
begin
so.run_command
- Ohai::Log.debug("Plugin #{self.name}: ran '#{cmd}' and returned #{so.exitstatus}")
+ info_getter::Log.debug("Plugin #{self.name}: ran '#{cmd}' and returned #{so.exitstatus}")
so
rescue Errno::ENOENT => e
- Ohai::Log.debug("Plugin #{self.name}: ran '#{cmd}' and failed #{e.inspect}")
- raise Ohai::Exceptions::Exec, e
+ info_getter::Log.debug("Plugin #{self.name}: ran '#{cmd}' and failed #{e.inspect}")
+ raise info_getter::Exceptions::Exec, e
rescue Mixlib::ShellOut::CommandTimeout => e
- Ohai::Log.debug("Plugin #{self.name}: ran '#{cmd}' and timed out after #{options[:timeout]} seconds")
- raise Ohai::Exceptions::Exec, e
+ info_getter::Log.debug("Plugin #{self.name}: ran '#{cmd}' and timed out after #{options[:timeout]} seconds")
+ raise info_getter::Exceptions::Exec, e
end
end
module_function :shell_out
def run_command(args = {})
- Ohai::Log.warn("Ohai::Mixin::Command run_command is deprecated and will be removed in Ohai 9.0.0")
+ info_getter::Log.warn("info_getter::Mixin::Command run_command is deprecated and will be removed in info_getter 9.0.0")
if args.has_key?(:creates)
if File.exists?(args[:creates])
- Ohai::Log.debug("Skipping #{args[:command]} - creates #{args[:creates]} exists.")
+ info_getter::Log.debug("Skipping #{args[:command]} - creates #{args[:creates]} exists.")
return false
end
end
@@ -63,7 +63,7 @@ module Ohai
args[:cwd] ||= Dir.tmpdir
unless File.directory?(args[:cwd])
- raise Ohai::Exceptions::Exec, "#{args[:cwd]} does not exist or is not a directory"
+ raise info_getter::Exceptions::Exec, "#{args[:cwd]} does not exist or is not a directory"
end
status = nil
@@ -71,22 +71,22 @@ module Ohai
status, stdout_string, stderr_string = run_command_backend(args[:command], args[:timeout])
if stdout_string
- Ohai::Log.debug("---- Begin #{args[:command]} STDOUT ----")
- Ohai::Log.debug(stdout_string.strip)
- Ohai::Log.debug("---- End #{args[:command]} STDOUT ----")
+ info_getter::Log.debug("---- Begin #{args[:command]} STDOUT ----")
+ info_getter::Log.debug(stdout_string.strip)
+ info_getter::Log.debug("---- End #{args[:command]} STDOUT ----")
end
if stderr_string
- Ohai::Log.debug("---- Begin #{args[:command]} STDERR ----")
- Ohai::Log.debug(stderr_string.strip)
- Ohai::Log.debug("---- End #{args[:command]} STDERR ----")
+ info_getter::Log.debug("---- Begin #{args[:command]} STDERR ----")
+ info_getter::Log.debug(stderr_string.strip)
+ info_getter::Log.debug("---- End #{args[:command]} STDERR ----")
end
args[:returns] ||= 0
args[:no_status_check] ||= false
if status.exitstatus != args[:returns] && (not args[:no_status_check])
- raise Ohai::Exceptions::Exec, "#{args[:command_string]} returned #{status.exitstatus}, expected #{args[:returns]}"
+ raise info_getter::Exceptions::Exec, "#{args[:command_string]} returned #{status.exitstatus}, expected #{args[:returns]}"
else
- Ohai::Log.debug("Ran #{args[:command_string]} (#{args[:command]}) returned #{status.exitstatus}")
+ info_getter::Log.debug("Ran #{args[:command_string]} (#{args[:command]}) returned #{status.exitstatus}")
end
end
return status, stdout_string, stderr_string
@@ -131,18 +131,18 @@ module Ohai
alias :run_command_backend :run_command_unix
end
# This is taken directly from Ara T Howard's Open4 library, and then
- # modified to suit the needs of Ohai. Any bugs here are most likely
+ # modified to suit the needs of info_getter. Any bugs here are most likely
# my own, and not Ara's.
#
# The original appears in external/open4.rb in its unmodified form.
#
# Thanks Ara!
def popen4(cmd, args = {}, &b)
- Ohai::Log.warn("Ohai::Mixin::Command popen4 is deprecated and will be removed in Ohai 9.0.0")
+ info_getter::Log.warn("info_getter::Mixin::Command popen4 is deprecated and will be removed in info_getter 9.0.0")
# Disable garbage collection to work around possible bug in MRI
# Ruby 1.8 suffers from intermittent segfaults believed to be due to GC while IO.select
- # See OHAI-330 / CHEF-2916 / CHEF-1305
+ # See info_getter-330 / CHEF-2916 / CHEF-1305
GC.disable
# Waitlast - this is magic.
@@ -321,7 +321,7 @@ module Ohai
o.rewind
e.rewind
- # **OHAI-275**
+ # **info_getter-275**
# The way we read from the pipes causes ruby to mark the strings
# as ASCII-8BIT (i.e., binary), but the content should be encoded
# as the default external encoding. For example, a command may
@@ -354,7 +354,7 @@ module Ohai
[cid, pw.last, pr.first, pe.first]
end
rescue Errno::ENOENT
- raise Ohai::Exceptions::Exec, "command #{cmd} doesn't exist or is not in the PATH"
+ raise info_getter::Exceptions::Exec, "command #{cmd} doesn't exist or is not in the PATH"
ensure
# we disabled GC entering
GC.enable
diff --git a/lib/ohai/mixin/constant_helper.rb b/lib/ohai/mixin/constant_helper.rb
index af2f0a52..036b7bcb 100644
--- a/lib/ohai/mixin/constant_helper.rb
+++ b/lib/ohai/mixin/constant_helper.rb
@@ -17,7 +17,7 @@
# limitations under the License.
#
-module Ohai
+module info_getter
module Mixin
module ConstantHelper
@@ -27,7 +27,7 @@ module Ohai
Object.send(:remove_const, constant) unless Object.const_get(constant).is_a?(Module)
end
- recursive_remove_constants(Ohai::NamedPlugin)
+ recursive_remove_constants(info_getter::NamedPlugin)
end
def recursive_remove_constants(object)
diff --git a/lib/ohai/mixin/dmi_decode.rb b/lib/ohai/mixin/dmi_decode.rb
index c56291c7..48170109 100644
--- a/lib/ohai/mixin/dmi_decode.rb
+++ b/lib/ohai/mixin/dmi_decode.rb
@@ -16,7 +16,7 @@
# limitations under the License.
# http://www.dmo.ca/blog/detecting-virtualization-on-linux
-module ::Ohai::Mixin::DmiDecode
+module ::info_getter::Mixin::DmiDecode
def guest_from_dmi(dmi_data)
dmi_data.each_line do |line|
case line
diff --git a/lib/ohai/mixin/ec2_metadata.rb b/lib/ohai/mixin/ec2_metadata.rb
index eb4e4e6a..89e8c35f 100644
--- a/lib/ohai/mixin/ec2_metadata.rb
+++ b/lib/ohai/mixin/ec2_metadata.rb
@@ -20,7 +20,7 @@
require "net/http"
require "socket"
-module Ohai
+module info_getter
module Mixin
##
# This code parses the EC2 Instance Metadata API to provide details
@@ -71,14 +71,14 @@ module Ohai
end
rescue SystemCallError
end
- Ohai::Log.debug("ec2 metadata mixin: can_metadata_connect? == #{connected}")
+ info_getter::Log.debug("ec2 metadata mixin: can_metadata_connect? == #{connected}")
connected
end
def best_api_version
response = http_client.get("/")
if response.code == "404"
- Ohai::Log.debug("ec2 metadata mixin: Received HTTP 404 from metadata server while determining API version, assuming 'latest'")
+ info_getter::Log.debug("ec2 metadata mixin: Received HTTP 404 from metadata server while determining API version, assuming 'latest'")
return "latest"
elsif response.code != "200"
raise "Unable to determine EC2 metadata version (returned #{response.code} response)"
@@ -89,9 +89,9 @@ module Ohai
versions = response.body.split("\n").sort
until versions.empty? || EC2_SUPPORTED_VERSIONS.include?(versions.last)
pv = versions.pop
- Ohai::Log.debug("ec2 metadata mixin: EC2 shows unsupported metadata version: #{pv}") unless pv == "latest"
+ info_getter::Log.debug("ec2 metadata mixin: EC2 shows unsupported metadata version: #{pv}") unless pv == "latest"
end
- Ohai::Log.debug("ec2 metadata mixin: EC2 metadata version: #{versions.last}")
+ info_getter::Log.debug("ec2 metadata mixin: EC2 metadata version: #{versions.last}")
if versions.empty?
raise "Unable to determine EC2 metadata version (no supported entries found)"
end
@@ -116,7 +116,7 @@ module Ohai
when "200"
response.body
when "404"
- Ohai::Log.debug("ec2 metadata mixin: Encountered 404 response retreiving EC2 metadata path: #{path} ; continuing.")
+ info_getter::Log.debug("ec2 metadata mixin: Encountered 404 response retreiving EC2 metadata path: #{path} ; continuing.")
nil
else
raise "Encountered error retrieving EC2 metadata (#{path} returned #{response.code} response)"
diff --git a/lib/ohai/mixin/gce_metadata.rb b/lib/ohai/mixin/gce_metadata.rb
index aef65250..12832e15 100644
--- a/lib/ohai/mixin/gce_metadata.rb
+++ b/lib/ohai/mixin/gce_metadata.rb
@@ -17,7 +17,7 @@
require "net/http"
require "socket"
-module Ohai
+module info_getter
module Mixin
module GCEMetadata
@@ -30,7 +30,7 @@ module Ohai
begin
saddr = Socket.pack_sockaddr_in(port, addr)
rescue SocketError => e # occurs when non-GCE systems try to resolve metadata.google.internal
- Ohai::Log.debug("Mixin GCE: can_metadata_connect? failed setting up socket: #{e}")
+ info_getter::Log.debug("Mixin GCE: can_metadata_connect? failed setting up socket: #{e}")
return false
end
@@ -53,7 +53,7 @@ module Ohai
end
rescue SystemCallError
end
- Ohai::Log.debug("Mixin GCE: can_metadata_connect? == #{connected}")
+ info_getter::Log.debug("Mixin GCE: can_metadata_connect? == #{connected}")
connected
end
diff --git a/lib/ohai/mixin/network_constants.rb b/lib/ohai/mixin/network_constants.rb
index ed53bb8b..b79c63a8 100644
--- a/lib/ohai/mixin/network_constants.rb
+++ b/lib/ohai/mixin/network_constants.rb
@@ -17,7 +17,7 @@
# limitations under the License.
#
-module Ohai
+module info_getter
module Mixin
module NetworkConstants
FAMILIES = {
diff --git a/lib/ohai/mixin/os.rb b/lib/ohai/mixin/os.rb
index 83cdc34e..4448b3c8 100644
--- a/lib/ohai/mixin/os.rb
+++ b/lib/ohai/mixin/os.rb
@@ -19,7 +19,7 @@
require "rbconfig"
-module Ohai
+module info_getter
module Mixin
module OS
diff --git a/lib/ohai/mixin/seconds_to_human.rb b/lib/ohai/mixin/seconds_to_human.rb
index 6d888970..49520633 100644
--- a/lib/ohai/mixin/seconds_to_human.rb
+++ b/lib/ohai/mixin/seconds_to_human.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-module Ohai
+module info_getter
module Mixin
module SecondsToHuman
def seconds_to_human(seconds)
diff --git a/lib/ohai/mixin/softlayer_metadata.rb b/lib/ohai/mixin/softlayer_metadata.rb
index f8568110..5041859e 100644
--- a/lib/ohai/mixin/softlayer_metadata.rb
+++ b/lib/ohai/mixin/softlayer_metadata.rb
@@ -21,7 +21,7 @@ require "net/https"
require "uri"
# http://sldn.softlayer.com/reference/services/SoftLayer_Resource_Metadata
-module ::Ohai::Mixin::SoftlayerMetadata
+module ::info_getter::Mixin::SoftlayerMetadata
SOFTLAYER_API_QUERY_URL = "https://api.service.softlayer.com/rest/v3.1/SoftLayer_Resource_Metadata" unless defined?(SOFTLAYER_API_QUERY_URL)
def fetch_metadata
@@ -40,7 +40,7 @@ module ::Ohai::Mixin::SoftlayerMetadata
# Manually supply and specify a suitable CA bundle here or
# set the SSL_CERT_FILE file environment variable to a valid value otherwise.
def ca_file_location
- ::Ohai::Config[:ca_file]
+ ::info_getter::Config[:ca_file]
end
def fetch_metadata_item(item)
@@ -54,11 +54,11 @@ module ::Ohai::Mixin::SoftlayerMetadata
if res.code.to_i.between?(200, 299)
res.body
else
- ::Ohai::Log.error("Unable to fetch item #{full_url}: status (#{res.code}) body (#{res.body})")
+ ::info_getter::Log.error("Unable to fetch item #{full_url}: status (#{res.code}) body (#{res.body})")
nil
end
rescue => e
- ::Ohai::Log.error("Unable to fetch softlayer metadata from #{u}: #{e.class}: #{e.message}")
+ ::info_getter::Log.error("Unable to fetch softlayer metadata from #{u}: #{e.class}: #{e.message}")
raise e
end
end
diff --git a/lib/ohai/plugin_config.rb b/lib/ohai/plugin_config.rb
index b757af21..d1ab360b 100644
--- a/lib/ohai/plugin_config.rb
+++ b/lib/ohai/plugin_config.rb
@@ -15,9 +15,9 @@
# limitations under the License.
#
-require "ohai/exception"
+require "info_getter/exception"
-module Ohai
+module info_getter
class PluginConfig < Hash
def []=(key, value_or_hash)
@@ -31,7 +31,7 @@ module Ohai
def enforce_symbol(key)
unless key.is_a?(Symbol)
msg = "Expected Symbol, got #{key.inspect}"
- raise Ohai::Exceptions::PluginConfigError, msg
+ raise info_getter::Exceptions::PluginConfigError, msg
end
end
diff --git a/lib/ohai/plugins/aix/cpu.rb b/lib/ohai/plugins/aix/cpu.rb
index f1e548b1..3f0118c2 100644
--- a/lib/ohai/plugins/aix/cpu.rb
+++ b/lib/ohai/plugins/aix/cpu.rb
@@ -18,7 +18,7 @@
# limitations under the License.
#
-Ohai.plugin(:CPU) do
+info_getter.plugin(:CPU) do
provides "cpu"
collect_data(:aix) do
diff --git a/lib/ohai/plugins/aix/filesystem.rb b/lib/ohai/plugins/aix/filesystem.rb
index 8f90921c..1da72387 100644
--- a/lib/ohai/plugins/aix/filesystem.rb
+++ b/lib/ohai/plugins/aix/filesystem.rb
@@ -19,7 +19,7 @@
# limitations under the License.
#
-Ohai.plugin(:Filesystem) do
+info_getter.plugin(:Filesystem) do
provides "filesystem"
def parse_df_or_mount(shell_out)
diff --git a/lib/ohai/plugins/aix/kernel.rb b/lib/ohai/plugins/aix/kernel.rb
index 0124f7e6..5a25efc7 100644
--- a/lib/ohai/plugins/aix/kernel.rb
+++ b/lib/ohai/plugins/aix/kernel.rb
@@ -17,7 +17,7 @@
# limitations under the License.
#
-Ohai.plugin(:Kernel) do
+info_getter.plugin(:Kernel) do
provides "kernel", "kernel/modules"
collect_data(:aix) do
diff --git a/lib/ohai/plugins/aix/memory.rb b/lib/ohai/plugins/aix/memory.rb
index 40630110..3758a120 100644
--- a/lib/ohai/plugins/aix/memory.rb
+++ b/lib/ohai/plugins/aix/memory.rb
@@ -17,7 +17,7 @@
# limitations under the License.
#
-Ohai.plugin(:Memory) do
+info_getter.plugin(:Memory) do
provides "memory"
collect_data(:aix) do
diff --git a/lib/ohai/plugins/aix/network.rb b/lib/ohai/plugins/aix/network.rb
index 292b45c6..7c80f804 100644
--- a/lib/ohai/plugins/aix/network.rb
+++ b/lib/ohai/plugins/aix/network.rb
@@ -18,7 +18,7 @@
# limitations under the License.
#
-Ohai.plugin(:Network) do
+info_getter.plugin(:Network) do
require "ipaddr"
provides "network", "counters/network", "macaddress"
@@ -46,7 +46,7 @@ Ohai.plugin(:Network) do
network Mash.new unless network
network[:interfaces] = Mash.new unless network[:interfaces]
- # We unfortunately have to do things a bit different here, if ohai is running
+ # We unfortunately have to do things a bit different here, if info_getter is running
# within a WPAR. For instance, the WPAR isn't aware of some of its own networking
# minutia such as default gateway/route.
unless shell_out("uname -W").stdout.to_i > 0
diff --git a/lib/ohai/plugins/aix/os.rb b/lib/ohai/plugins/aix/os.rb
index ecb3e22d..2fc4d0ff 100644
--- a/lib/ohai/plugins/aix/os.rb
+++ b/lib/ohai/plugins/aix/os.rb
@@ -17,9 +17,9 @@
# limitations under the License.
#
-require "ohai/mixin/os"
+require "info_getter/mixin/os"
-Ohai.plugin(:OS) do
+info_getter.plugin(:OS) do
provides "os", "os_version"
depends "kernel"
diff --git a/lib/ohai/plugins/aix/platform.rb b/lib/ohai/plugins/aix/platform.rb
index 776bb2f2..e503d7e7 100644
--- a/lib/ohai/plugins/aix/platform.rb
+++ b/lib/ohai/plugins/aix/platform.rb
@@ -17,7 +17,7 @@
# limitations under the License.
#
-Ohai.plugin(:Platform) do
+info_getter.plugin(:Platform) do
provides "platform", "platform_version", "platform_family"
depends "kernel"
diff --git a/lib/ohai/plugins/aix/uptime.rb b/lib/ohai/plugins/aix/uptime.rb
index ce463753..6670027f 100644
--- a/lib/ohai/plugins/aix/uptime.rb
+++ b/lib/ohai/plugins/aix/uptime.rb
@@ -17,7 +17,7 @@
# limitations under the License.
#
-Ohai.plugin(:Uptime) do
+info_getter.plugin(:Uptime) do
provides "uptime", "uptime_seconds"
collect_data(:aix) do
diff --git a/lib/ohai/plugins/aix/virtualization.rb b/lib/ohai/plugins/aix/virtualization.rb
index 9271323a..90b5b619 100644
--- a/lib/ohai/plugins/aix/virtualization.rb
+++ b/lib/ohai/plugins/aix/virtualization.rb
@@ -17,7 +17,7 @@
# limitations under the License.
#
-Ohai.plugin(:Virtualization) do
+info_getter.plugin(:Virtualization) do
provides "virtualization", "virtualization/wpars"
collect_data(:aix) do
diff --git a/lib/ohai/plugins/azure.rb b/lib/ohai/plugins/azure.rb
index 8bc29964..f93e23a8 100644
--- a/lib/ohai/plugins/azure.rb
+++ b/lib/ohai/plugins/azure.rb
@@ -14,7 +14,7 @@
# limitations under the License.
#
-Ohai.plugin(:Azure) do
+info_getter.plugin(:Azure) do
provides "azure"
collect_data do
@@ -24,14 +24,14 @@ Ohai.plugin(:Azure) do
# project for details
azure_metadata_from_hints = hint?("azure")
if azure_metadata_from_hints
- Ohai::Log.debug("azure plugin: azure_metadata_from_hints is present.")
+ info_getter::Log.debug("azure plugin: azure_metadata_from_hints is present.")
azure Mash.new
azure_metadata_from_hints.each { |k, v| azure[k] = v }
elsif has_waagent? || has_dhcp_option_245?
- Ohai::Log.debug("azure plugin: No hints present, but system appears to be on azure.")
+ info_getter::Log.debug("azure plugin: No hints present, but system appears to be on azure.")
azure Mash.new
else
- Ohai::Log.debug("azure plugin: No hints present for azure and doesn't appear to be azure.")
+ info_getter::Log.debug("azure plugin: No hints present for azure and doesn't appear to be azure.")
false
end
end
@@ -40,7 +40,7 @@ Ohai.plugin(:Azure) do
# 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')
- Ohai::Log.debug("azure plugin: Found waagent used by MS Azure.")
+ info_getter::Log.debug("azure plugin: Found waagent used by MS Azure.")
return true
end
end
@@ -50,7 +50,7 @@ Ohai.plugin(:Azure) do
if File.exist?("/var/lib/dhcp/dhclient.eth0.leases")
File.open("/var/lib/dhcp/dhclient.eth0.leases").each do |line|
if line =~ /unknown-245/
- Ohai::Log.debug("azure plugin: Found unknown-245 DHCP option used by MS Azure.")
+ info_getter::Log.debug("azure plugin: Found unknown-245 DHCP option used by MS Azure.")
has_245 = true
break
end
diff --git a/lib/ohai/plugins/bsd/filesystem.rb b/lib/ohai/plugins/bsd/filesystem.rb
index 4842d3fc..6f5308c0 100644
--- a/lib/ohai/plugins/bsd/filesystem.rb
+++ b/lib/ohai/plugins/bsd/filesystem.rb
@@ -17,7 +17,7 @@
# limitations under the License.
#
-Ohai.plugin(:Filesystem) do
+info_getter.plugin(:Filesystem) do
provides "filesystem"
collect_data(:freebsd, :openbsd, :netbsd, :dragonflybsd) do
diff --git a/lib/ohai/plugins/bsd/virtualization.rb b/lib/ohai/plugins/bsd/virtualization.rb
index 46304982..b6d404f6 100644
--- a/lib/ohai/plugins/bsd/virtualization.rb
+++ b/lib/ohai/plugins/bsd/virtualization.rb
@@ -17,10 +17,10 @@
# limitations under the License.
#
-require "ohai/mixin/dmi_decode"
+require "info_getter/mixin/dmi_decode"
-Ohai.plugin(:Virtualization) do
- include Ohai::Mixin::DmiDecode
+info_getter.plugin(:Virtualization) do
+ include info_getter::Mixin::DmiDecode
provides "virtualization"
collect_data(:freebsd, :openbsd, :netbsd, :dragonflybsd) do
@@ -34,7 +34,7 @@ Ohai.plugin(:Virtualization) do
virtualization[:system] = "jail"
virtualization[:role] = "guest"
virtualization[:systems][:jail] = "guest"
- Ohai::Log.debug("Plugin Virtualization: Guest running in FreeBSD jail detected")
+ info_getter::Log.debug("Plugin Virtualization: Guest running in FreeBSD jail detected")
end
# run jls to get a list of running jails
@@ -45,23 +45,23 @@ Ohai.plugin(:Virtualization) do
virtualization[:system] = "jail"
virtualization[:role] = "host"
virtualization[:systems][:jail] = "host"
- Ohai::Log.debug("Plugin Virtualization: Host running FreeBSD jails detected")
+ info_getter::Log.debug("Plugin Virtualization: Host running FreeBSD jails detected")
end
# detect from modules
- so = shell_out("#{Ohai.abs_path('/sbin/kldstat')}")
+ so = shell_out("#{info_getter.abs_path('/sbin/kldstat')}")
so.stdout.lines do |line|
case line
when /vboxdrv/
virtualization[:system] = "vbox"
virtualization[:role] = "host"
virtualization[:systems][:vbox] = "host"
- Ohai::Log.debug("Plugin Virtualization: Guest running on VirtualBox detected")
+ info_getter::Log.debug("Plugin Virtualization: Guest running on VirtualBox detected")
when /vboxguest/
virtualization[:system] = "vbox"
virtualization[:role] = "guest"
virtualization[:systems][:vbox] = "guest"
- Ohai::Log.debug("Plugin Virtualization: Host running VirtualBox detected")
+ info_getter::Log.debug("Plugin Virtualization: Host running VirtualBox detected")
end
end
@@ -70,7 +70,7 @@ Ohai.plugin(:Virtualization) do
virtualization[:system] = "bhyve"
virtualization[:role] = "host"
virtualization[:systems][:bhyve] = "host"
- Ohai::Log.debug("Plugin Virtualization: Host running bhyve detected")
+ info_getter::Log.debug("Plugin Virtualization: Host running bhyve detected")
end
# Detect KVM/QEMU paravirt guests from cpu, report as KVM
@@ -80,7 +80,7 @@ Ohai.plugin(:Virtualization) do
virtualization[:system] = "kvm"
virtualization[:role] = "guest"
virtualization[:systems][:kvm] = "guest"
- Ohai::Log.debug("Plugin Virtualization: Guest running on KVM detected")
+ info_getter::Log.debug("Plugin Virtualization: Guest running on KVM detected")
end
# gather hypervisor of guests from sysctl kern.vm_guest
@@ -92,22 +92,22 @@ Ohai.plugin(:Virtualization) do
virtualization[:system] = "vmware"
virtualization[:role] = "guest"
virtualization[:systems][:vmware] = "guest"
- Ohai::Log.debug("Plugin Virtualization: Guest running on VMware detected")
+ info_getter::Log.debug("Plugin Virtualization: Guest running on VMware detected")
when /hv/
virtualization[:system] = "hyperv"
virtualization[:role] = "guest"
virtualization[:systems][:hyperv] = "guest"
- Ohai::Log.debug("Plugin Virtualization: Guest running on Hyper-V detected")
+ info_getter::Log.debug("Plugin Virtualization: Guest running on Hyper-V detected")
when /xen/
virtualization[:system] = "xen"
virtualization[:role] = "guest"
virtualization[:systems][:xen] = "guest"
- Ohai::Log.debug("Plugin Virtualization: Guest running on Xen detected")
+ info_getter::Log.debug("Plugin Virtualization: Guest running on Xen detected")
when /bhyve/
virtualization[:system] = "bhyve"
virtualization[:role] = "guest"
virtualization[:systems][:bhyve] = "guest"
- Ohai::Log.debug("Plugin Virtualization: Guest running on bhyve detected")
+ info_getter::Log.debug("Plugin Virtualization: Guest running on bhyve detected")
end
# parse dmidecode to discover various virtualization guests
@@ -117,7 +117,7 @@ Ohai.plugin(:Virtualization) do
virtualization[:system] = guest
virtualization[:role] = "guest"
virtualization[:systems][guest.to_sym] = "guest"
- Ohai::Log.debug("Plugin Virtualization: Guest running on #{guest} detected")
+ info_getter::Log.debug("Plugin Virtualization: Guest running on #{guest} detected")
end
end
end
diff --git a/lib/ohai/plugins/c.rb b/lib/ohai/plugins/c.rb
index e5107cdc..ac7fcba7 100644
--- a/lib/ohai/plugins/c.rb
+++ b/lib/ohai/plugins/c.rb
@@ -18,7 +18,7 @@
require "rbconfig"
-Ohai.plugin(:C) do
+info_getter.plugin(:C) do
provides "languages/c"
depends "languages"
@@ -28,10 +28,10 @@ Ohai.plugin(:C) do
if so.exitstatus == 0
yield(so)
else
- Ohai::Log.debug("Plugin C '#{cmd}' failed. Skipping data.")
+ info_getter::Log.debug("Plugin C '#{cmd}' failed. Skipping data.")
end
- rescue Ohai::Exceptions::Exec
- Ohai::Log.debug("Plugin C '#{cmd}' binary could not be found. Skipping data.")
+ rescue info_getter::Exceptions::Exec
+ info_getter::Log.debug("Plugin C '#{cmd}' binary could not be found. Skipping data.")
end
collect_data do
@@ -56,7 +56,7 @@ Ohai.plugin(:C) do
#glibc
["/lib/libc.so.6", "/lib64/libc.so.6"].each do |glibc|
- collect( Ohai.abs_path( glibc )) do |so|
+ collect( info_getter.abs_path( glibc )) do |so|
description = so.stdout.split($/).first
if description =~ /(\d+\.\d+\.?\d*)/
c[:glibc] = Mash.new
@@ -98,7 +98,7 @@ Ohai.plugin(:C) do
c[:xlc][:description] = description.strip
end
end
- rescue Ohai::Exceptions::Exec
+ rescue info_getter::Exceptions::Exec
end
#sun pro
diff --git a/lib/ohai/plugins/chef.rb b/lib/ohai/plugins/chef.rb
index 211a320e..903edf3e 100644
--- a/lib/ohai/plugins/chef.rb
+++ b/lib/ohai/plugins/chef.rb
@@ -16,14 +16,14 @@
# limitations under the License.
#
-Ohai.plugin(:Chef) do
+info_getter.plugin(:Chef) do
provides "chef_packages/chef"
collect_data do
begin
require "chef/version"
rescue Gem::LoadError
- # this catches when you've done a major version bump of ohai, but
+ # this catches when you've done a major version bump of info_getter, but
# your chef gem is incompatible, so we can't load it in the same VM
# (affects mostly internal testing)
next
diff --git a/lib/ohai/plugins/cloud.rb b/lib/ohai/plugins/cloud.rb
index 23084631..35e6933b 100644
--- a/lib/ohai/plugins/cloud.rb
+++ b/lib/ohai/plugins/cloud.rb
@@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-Ohai.plugin(:Cloud) do
+info_getter.plugin(:Cloud) do
provides "cloud"
depends "ec2"
diff --git a/lib/ohai/plugins/cloud_v2.rb b/lib/ohai/plugins/cloud_v2.rb
index fceb4d3f..5f253cd2 100644
--- a/lib/ohai/plugins/cloud_v2.rb
+++ b/lib/ohai/plugins/cloud_v2.rb
@@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-Ohai.plugin(:CloudV2) do
+info_getter.plugin(:CloudV2) do
provides "cloud_v2"
depends "ec2"
@@ -26,7 +26,7 @@ Ohai.plugin(:CloudV2) do
depends "azure"
depends "digital_ocean"
- # Class to help enforce the interface exposed to node[:cloud] (OHAI-542)
+ # Class to help enforce the interface exposed to node[:cloud] (info_getter-542)
#
# cloud[:provider] - (String) the cloud provider the VM is running on.
#
@@ -107,7 +107,7 @@ Ohai.plugin(:CloudV2) do
ipaddr = IPAddr.new(ip)
raise ArgumentError, "not valid #{address_family} address" unless (address_family == :ipv4) ? ipaddr.ipv4? : ipaddr.ipv6?
rescue ArgumentError => e
- raise "ERROR: the ohai 'cloud' plugin failed with an IP address of '#{ip}' : #{e.message}"
+ raise "ERROR: the info_getter 'cloud' plugin failed with an IP address of '#{ip}' : #{e.message}"
end
ipaddr
end
diff --git a/lib/ohai/plugins/command.rb b/lib/ohai/plugins/command.rb
index ddecde10..ae137e9f 100644
--- a/lib/ohai/plugins/command.rb
+++ b/lib/ohai/plugins/command.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-Ohai.plugin(:Command) do
+info_getter.plugin(:Command) do
provides "command"
collect_data do
diff --git a/lib/ohai/plugins/darwin/cpu.rb b/lib/ohai/plugins/darwin/cpu.rb
index baa72836..644778fa 100644
--- a/lib/ohai/plugins/darwin/cpu.rb
+++ b/lib/ohai/plugins/darwin/cpu.rb
@@ -17,7 +17,7 @@
# limitations under the License.
#
-Ohai.plugin(:CPU) do
+info_getter.plugin(:CPU) do
provides "cpu"
collect_data(:darwin) do
diff --git a/lib/ohai/plugins/darwin/filesystem.rb b/lib/ohai/plugins/darwin/filesystem.rb
index c3534bbb..72f0adbd 100644
--- a/lib/ohai/plugins/darwin/filesystem.rb
+++ b/lib/ohai/plugins/darwin/filesystem.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-Ohai.plugin(:Filesystem) do
+info_getter.plugin(:Filesystem) do
provides "filesystem"
collect_data(:darwin) do
diff --git a/lib/ohai/plugins/darwin/filesystem2.rb b/lib/ohai/plugins/darwin/filesystem2.rb
index 45b41e18..b5e04845 100644
--- a/lib/ohai/plugins/darwin/filesystem2.rb
+++ b/lib/ohai/plugins/darwin/filesystem2.rb
@@ -18,7 +18,7 @@
# limitations under the License.
#
-Ohai.plugin(:Filesystem2) do
+info_getter.plugin(:Filesystem2) do
provides "filesystem2"
def generate_device_view(fs)
diff --git a/lib/ohai/plugins/darwin/hardware.rb b/lib/ohai/plugins/darwin/hardware.rb
index 1aab3b92..3711d407 100644
--- a/lib/ohai/plugins/darwin/hardware.rb
+++ b/lib/ohai/plugins/darwin/hardware.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-Ohai.plugin(:Hardware) do
+info_getter.plugin(:Hardware) do
provides "hardware"
def system_profiler(datatype)
@@ -30,7 +30,7 @@ Ohai.plugin(:Hardware) do
unless hardware
hardware Mash.new
else
- Ohai::Log.debug("Plugin Darwin Hardware: namespace already exists")
+ info_getter::Log.debug("Plugin Darwin Hardware: namespace already exists")
next
end
@@ -38,7 +38,7 @@ Ohai.plugin(:Hardware) do
require "plist"
rescue LoadError => e
# In case the plist gem isn't present, skip this plugin.
- Ohai::Log.debug("Plugin Hardware: Can't load gem: #{e}. Cannot continue.")
+ info_getter::Log.debug("Plugin Hardware: Can't load gem: #{e}. Cannot continue.")
next
end
diff --git a/lib/ohai/plugins/darwin/memory.rb b/lib/ohai/plugins/darwin/memory.rb
index 28214c87..01024160 100644
--- a/lib/ohai/plugins/darwin/memory.rb
+++ b/lib/ohai/plugins/darwin/memory.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-Ohai.plugin(:Memory) do
+info_getter.plugin(:Memory) do
provides "memory"
collect_data(:darwin) do
diff --git a/lib/ohai/plugins/darwin/network.rb b/lib/ohai/plugins/darwin/network.rb
index 780b1da7..ebf67112 100644
--- a/lib/ohai/plugins/darwin/network.rb
+++ b/lib/ohai/plugins/darwin/network.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-Ohai.plugin(:Network) do
+info_getter.plugin(:Network) do
provides "network", "network/interfaces"
provides "counters/network", "counters/network/interfaces"
diff --git a/lib/ohai/plugins/darwin/platform.rb b/lib/ohai/plugins/darwin/platform.rb
index 0281663c..88c94589 100644
--- a/lib/ohai/plugins/darwin/platform.rb
+++ b/lib/ohai/plugins/darwin/platform.rb
@@ -16,11 +16,11 @@
# limitations under the License.
#
-Ohai.plugin(:Platform) do
+info_getter.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" )}")
+ so = shell_out("#{ info_getter.abs_path( "/usr/bin/sw_vers" )}")
so.stdout.lines do |line|
case line
when /^ProductName:\s+(.+)$/
diff --git a/lib/ohai/plugins/darwin/system_profiler.rb b/lib/ohai/plugins/darwin/system_profiler.rb
index 20798cc4..92afd99a 100644
--- a/lib/ohai/plugins/darwin/system_profiler.rb
+++ b/lib/ohai/plugins/darwin/system_profiler.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-Ohai.plugin(:SystemProfile) do
+info_getter.plugin(:SystemProfile) do
provides "system_profile"
collect_data(:darwin) do
@@ -66,7 +66,7 @@ SPAirPortData},
system_profile items.sort_by { |h| h["_dataType"] }
rescue LoadError => e
- Ohai::Log.debug("Can't load gem: #{e})")
+ info_getter::Log.debug("Can't load gem: #{e})")
end
end
end
diff --git a/lib/ohai/plugins/darwin/virtualization.rb b/lib/ohai/plugins/darwin/virtualization.rb
index 61102cf1..e459b054 100644
--- a/lib/ohai/plugins/darwin/virtualization.rb
+++ b/lib/ohai/plugins/darwin/virtualization.rb
@@ -18,7 +18,7 @@
# limitations under the License.
#
-Ohai.plugin(:Virtualization) do
+info_getter.plugin(:Virtualization) do
provides "virtualization"
def vboxmanage_exists?
diff --git a/lib/ohai/plugins/digital_ocean.rb b/lib/ohai/plugins/digital_ocean.rb
index a06c3c67..f293986d 100644
--- a/lib/ohai/plugins/digital_ocean.rb
+++ b/lib/ohai/plugins/digital_ocean.rb
@@ -14,10 +14,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-require "ohai/util/ip_helper"
+require "info_getter/util/ip_helper"
-Ohai.plugin(:DigitalOcean) do
- include Ohai::Util::IpHelper
+info_getter.plugin(:DigitalOcean) do
+ include info_getter::Util::IpHelper
DIGITALOCEAN_FILE = "/etc/digitalocean" unless defined?(DIGITALOCEAN_FILE)
@@ -63,7 +63,7 @@ Ohai.plugin(:DigitalOcean) do
collect_data do
if looks_like_digital_ocean?
- Ohai::Log.debug("Plugin Digitalocean: looks_like_digital_ocean? == true")
+ info_getter::Log.debug("Plugin Digitalocean: looks_like_digital_ocean? == true")
digital_ocean Mash.new
hint = hint?("digital_ocean") || {}
hint.each { |k, v| digital_ocean[k] = v unless k == "ip_addresses" }
@@ -74,7 +74,7 @@ Ohai.plugin(:DigitalOcean) do
# https://developers.digitalocean.com/#droplets
digital_ocean[:networks] = extract_droplet_ip_addresses
else
- Ohai::Log.debug("Plugin Digitalocean: No hints present for and doesn't look like digitalocean")
+ info_getter::Log.debug("Plugin Digitalocean: No hints present for and doesn't look like digitalocean")
false
end
end
diff --git a/lib/ohai/plugins/dmi.rb b/lib/ohai/plugins/dmi.rb
index bcda1c4a..0c588f59 100644
--- a/lib/ohai/plugins/dmi.rb
+++ b/lib/ohai/plugins/dmi.rb
@@ -16,13 +16,13 @@
# limitations under the License.
#
-Ohai.plugin(:DMI) do
+info_getter.plugin(:DMI) do
provides "dmi"
# dmidecode does not return data without access to /dev/mem (or its equivalent)
collect_data do
- require "ohai/common/dmi"
+ require "info_getter/common/dmi"
dmi Mash.new
# all output lines should fall within one of these patterns
@@ -74,13 +74,13 @@ Ohai.plugin(:DMI) do
dmi[:table_location] = table_location[1]
elsif handle = handle_line.match(line)
- # Don't overcapture for now (OHAI-260)
- unless Ohai::Common::DMI::ID_TO_CAPTURE.include?(handle[2].to_i)
+ # Don't overcapture for now (info_getter-260)
+ unless info_getter::Common::DMI::ID_TO_CAPTURE.include?(handle[2].to_i)
dmi_record = nil
next
end
- dmi_record = { :type => Ohai::Common::DMI.id_lookup(handle[2]) }
+ dmi_record = { :type => info_getter::Common::DMI.id_lookup(handle[2]) }
dmi[dmi_record[:type]] = Mash.new unless dmi.has_key?(dmi_record[:type])
dmi[dmi_record[:type]][:all_records] = [] unless dmi[dmi_record[:type]].has_key?(:all_records)
@@ -92,14 +92,14 @@ Ohai.plugin(:DMI) do
elsif type = type_line.match(line)
if dmi_record == nil
- Ohai::Log.debug("unexpected data line found before header; discarding:\n#{line}")
+ info_getter::Log.debug("unexpected data line found before header; discarding:\n#{line}")
next
end
dmi[dmi_record[:type]][:all_records][dmi_record[:position]][:application_identifier] = type[1]
elsif data = data_line.match(line)
if dmi_record == nil
- Ohai::Log.debug("unexpected data line found before header; discarding:\n#{line}")
+ info_getter::Log.debug("unexpected data line found before header; discarding:\n#{line}")
next
end
dmi[dmi_record[:type]][:all_records][dmi_record[:position]][data[1]] = data[2]
@@ -107,11 +107,11 @@ Ohai.plugin(:DMI) do
elsif extended_data = extended_data_line.match(line)
if dmi_record == nil
- Ohai::Log.debug("unexpected extended data line found before header; discarding:\n#{line}")
+ info_getter::Log.debug("unexpected extended data line found before header; discarding:\n#{line}")
next
end
if field == nil
- Ohai::Log.debug("unexpected extended data line found outside data section; discarding:\n#{line}")
+ info_getter::Log.debug("unexpected extended data line found outside data section; discarding:\n#{line}")
next
end
# overwrite "raw" value with a new Mash
@@ -119,11 +119,11 @@ Ohai.plugin(:DMI) do
dmi[dmi_record[:type]][:all_records][dmi_record[:position]][field][extended_data[1]] = nil
else
- Ohai::Log.debug("unrecognized output line; discarding:\n#{line}")
+ info_getter::Log.debug("unrecognized output line; discarding:\n#{line}")
end
end
- Ohai::Common::DMI.convenience_keys(dmi)
+ info_getter::Common::DMI.convenience_keys(dmi)
end
end
diff --git a/lib/ohai/plugins/dragonflybsd/cpu.rb b/lib/ohai/plugins/dragonflybsd/cpu.rb
index c9f49a86..9007f22f 100644
--- a/lib/ohai/plugins/dragonflybsd/cpu.rb
+++ b/lib/ohai/plugins/dragonflybsd/cpu.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-Ohai.plugin(:CPU) do
+info_getter.plugin(:CPU) do
provides "cpu"
collect_data(:dragonflybsd) do
diff --git a/lib/ohai/plugins/dragonflybsd/memory.rb b/lib/ohai/plugins/dragonflybsd/memory.rb
index a4ff7165..772b43ce 100644
--- a/lib/ohai/plugins/dragonflybsd/memory.rb
+++ b/lib/ohai/plugins/dragonflybsd/memory.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-Ohai.plugin(:Memory) do
+info_getter.plugin(:Memory) do
provides "memory", "memory/swap"
collect_data(:dragonflybsd) do
diff --git a/lib/ohai/plugins/dragonflybsd/network.rb b/lib/ohai/plugins/dragonflybsd/network.rb
index 48d2ecdc..4e96b2d1 100644
--- a/lib/ohai/plugins/dragonflybsd/network.rb
+++ b/lib/ohai/plugins/dragonflybsd/network.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-Ohai.plugin(:Network) do
+info_getter.plugin(:Network) do
provides "network", "network/interfaces"
provides "counters/network", "counters/network/interfaces"
@@ -39,7 +39,7 @@ Ohai.plugin(:Network) do
end
iface = Mash.new
- so = shell_out("#{ Ohai.abs_path( "/sbin/ifconfig" )} -a")
+ so = shell_out("#{ info_getter.abs_path( "/sbin/ifconfig" )} -a")
cint = nil
so.stdout.lines do |line|
if line =~ /^([0-9a-zA-Z\.]+):\s+/
diff --git a/lib/ohai/plugins/dragonflybsd/os.rb b/lib/ohai/plugins/dragonflybsd/os.rb
index 836ee25f..f18a7260 100644
--- a/lib/ohai/plugins/dragonflybsd/os.rb
+++ b/lib/ohai/plugins/dragonflybsd/os.rb
@@ -18,9 +18,9 @@
# limitations under the License.
#
-require "ohai/mixin/os"
+require "info_getter/mixin/os"
-Ohai.plugin(:OS) do
+info_getter.plugin(:OS) do
provides "os", "os_version"
collect_data(:dragonflybsd) do
diff --git a/lib/ohai/plugins/dragonflybsd/platform.rb b/lib/ohai/plugins/dragonflybsd/platform.rb
index 169488e2..58fe804d 100644
--- a/lib/ohai/plugins/dragonflybsd/platform.rb
+++ b/lib/ohai/plugins/dragonflybsd/platform.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-Ohai.plugin(:Platform) do
+info_getter.plugin(:Platform) do
provides "platform", "platform_version", "platform_family"
collect_data(:dragonflybsd) do
diff --git a/lib/ohai/plugins/ec2.rb b/lib/ohai/plugins/ec2.rb
index c7f78568..39e08a11 100644
--- a/lib/ohai/plugins/ec2.rb
+++ b/lib/ohai/plugins/ec2.rb
@@ -19,16 +19,16 @@
# limitations under the License.
# How we detect EC2 from easiest to hardest & least reliable
-# 1. Ohai ec2 hint exists. This always works
+# 1. info_getter ec2 hint exists. This always works
# 2. Xen hypervisor UUID starts with 'ec2'. This catches Linux HVM & paravirt instances
# 3. DMI data mentions amazon. This catches HVM instances in a VPC
# 4. Kernel data mentioned Amazon. This catches Windows HVM & paravirt instances
-require "ohai/mixin/ec2_metadata"
+require "info_getter/mixin/ec2_metadata"
require "base64"
-Ohai.plugin(:EC2) do
- include Ohai::Mixin::Ec2Metadata
+info_getter.plugin(:EC2) do
+ include info_getter::Mixin::Ec2Metadata
provides "ec2"
@@ -40,10 +40,10 @@ Ohai.plugin(:EC2) do
def has_ec2_dmi?
# detect a version of '4.2.amazon'
if get_attribute(:dmi, :bios, :all_records, 0, :Version) =~ /amazon/
- Ohai::Log.debug("Plugin EC2: has_ec2_dmi? == true")
+ info_getter::Log.debug("Plugin EC2: has_ec2_dmi? == true")
return true
else
- Ohai::Log.debug("Plugin EC2: has_ec2_dmi? == false")
+ info_getter::Log.debug("Plugin EC2: has_ec2_dmi? == false")
return false
end
end
@@ -53,11 +53,11 @@ Ohai.plugin(:EC2) do
def has_ec2_xen_uuid?
if ::File.exist?("/sys/hypervisor/uuid")
if ::File.read("/sys/hypervisor/uuid") =~ /^ec2/
- Ohai::Log.debug("Plugin EC2: has_ec2_xen_uuid? == true")
+ info_getter::Log.debug("Plugin EC2: has_ec2_xen_uuid? == true")
return true
end
end
- Ohai::Log.debug("Plugin EC2: has_ec2_xen_uuid? == false")
+ info_getter::Log.debug("Plugin EC2: has_ec2_xen_uuid? == false")
return false
end
@@ -66,10 +66,10 @@ Ohai.plugin(:EC2) do
def has_amazon_org?
# detect an Organization of 'Amazon.com'
if get_attribute(:kernel, :os_info, :organization) =~ /Amazon/
- Ohai::Log.debug("Plugin EC2: has_amazon_org? == true")
+ info_getter::Log.debug("Plugin EC2: has_amazon_org? == true")
return true
else
- Ohai::Log.debug("Plugin EC2: has_amazon_org? == false")
+ info_getter::Log.debug("Plugin EC2: has_amazon_org? == false")
return false
end
end
@@ -79,17 +79,17 @@ Ohai.plugin(:EC2) do
# Even if it looks like EC2 try to connect first
if has_ec2_xen_uuid? || has_ec2_dmi? || has_amazon_org?
- return true if can_metadata_connect?(Ohai::Mixin::Ec2Metadata::EC2_METADATA_ADDR, 80)
+ return true if can_metadata_connect?(info_getter::Mixin::Ec2Metadata::EC2_METADATA_ADDR, 80)
end
end
collect_data do
if looks_like_ec2?
- Ohai::Log.debug("Plugin EC2: looks_like_ec2? == true")
+ info_getter::Log.debug("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
+ # secret access key. We'd rather not have info_getter 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")
@@ -98,11 +98,11 @@ Ohai.plugin(:EC2) do
ec2[:userdata] = fetch_userdata
# ASCII-8BIT is equivalent to BINARY in this case
if ec2[:userdata] && ec2[:userdata].encoding.to_s == "ASCII-8BIT"
- Ohai::Log.debug("Plugin EC2: Binary UserData Found. Storing in base64")
+ info_getter::Log.debug("Plugin EC2: Binary UserData Found. Storing in base64")
ec2[:userdata] = Base64.encode64(ec2[:userdata])
end
else
- Ohai::Log.debug("Plugin EC2: looks_like_ec2? == false")
+ info_getter::Log.debug("Plugin EC2: looks_like_ec2? == false")
false
end
end
diff --git a/lib/ohai/plugins/elixir.rb b/lib/ohai/plugins/elixir.rb
index 0dc6b1c3..ee6a1072 100644
--- a/lib/ohai/plugins/elixir.rb
+++ b/lib/ohai/plugins/elixir.rb
@@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-Ohai.plugin(:Elixir) do
+info_getter.plugin(:Elixir) do
provides "languages/elixir"
depends "languages"
@@ -29,8 +29,8 @@ Ohai.plugin(:Elixir) do
elixir[:version] = $1
languages[:elixir] = elixir
end
- rescue Ohai::Exceptions::Exec
- Ohai::Log.debug('Elixir plugin: Could not shell_out "elixir -v". Skipping plugin')
+ rescue info_getter::Exceptions::Exec
+ info_getter::Log.debug('Elixir plugin: Could not shell_out "elixir -v". Skipping plugin')
end
end
end
diff --git a/lib/ohai/plugins/erlang.rb b/lib/ohai/plugins/erlang.rb
index 94a7a297..706537ac 100644
--- a/lib/ohai/plugins/erlang.rb
+++ b/lib/ohai/plugins/erlang.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-Ohai.plugin(:Erlang) do
+info_getter.plugin(:Erlang) do
provides "languages/erlang"
depends "languages"
@@ -35,8 +35,8 @@ Ohai.plugin(:Erlang) do
erlang[:erts_version] = output[1]
erlang[:nif_version] = output[2]
end
- rescue Ohai::Exceptions::Exec
- Ohai::Log.debug('Erlang plugin: Could not shell_out "erl -eval \'erlang:display(erlang:system_info(otp_release)), erlang:display(erlang:system_info(version)), erlang:display(erlang:system_info(nif_version)), halt().\' -noshell". Skipping data')
+ rescue info_getter::Exceptions::Exec
+ info_getter::Log.debug('Erlang plugin: Could not shell_out "erl -eval \'erlang:display(erlang:system_info(otp_release)), erlang:display(erlang:system_info(version)), erlang:display(erlang:system_info(nif_version)), halt().\' -noshell". Skipping data')
end
begin
@@ -52,8 +52,8 @@ Ohai.plugin(:Erlang) do
erlang[:emulator] = output[2].gsub!(/(\(|\))/, "")
end
end
- rescue Ohai::Exceptions::Exec
- Ohai::Log.debug('Erlang plugin: Could not shell_out "erl +V". Skipping data')
+ rescue info_getter::Exceptions::Exec
+ info_getter::Log.debug('Erlang plugin: Could not shell_out "erl +V". Skipping data')
end
languages[:erlang] = erlang unless erlang.empty?
diff --git a/lib/ohai/plugins/eucalyptus.rb b/lib/ohai/plugins/eucalyptus.rb
index d9febfcb..d11df33f 100644
--- a/lib/ohai/plugins/eucalyptus.rb
+++ b/lib/ohai/plugins/eucalyptus.rb
@@ -18,10 +18,10 @@
# limitations under the License.
# eucalyptus metadata service is compatible with the ec2 service calls
-require "ohai/mixin/ec2_metadata"
+require "info_getter/mixin/ec2_metadata"
-Ohai.plugin(:Eucalyptus) do
- include Ohai::Mixin::Ec2Metadata
+info_getter.plugin(:Eucalyptus) do
+ include info_getter::Mixin::Ec2Metadata
provides "eucalyptus"
depends "network/interfaces"
@@ -41,31 +41,31 @@ Ohai.plugin(:Eucalyptus) do
network[:interfaces].values.each do |iface|
mac = get_mac_address(iface[:addresses])
if mac =~ /^[dD]0:0[dD]:/
- Ohai::Log.debug("Plugin Eucalyptus: has_euca_mac? == true (#{mac})")
+ info_getter::Log.debug("Plugin Eucalyptus: has_euca_mac? == true (#{mac})")
return true
end
end
- Ohai::Log.debug("Plugin Eucalyptus: has_euca_mac? == false")
+ info_getter::Log.debug("Plugin Eucalyptus: has_euca_mac? == false")
false
end
def looks_like_euca?
# Try non-blocking connect so we don't "block" if
# the metadata service doesn't respond
- hint?("eucalyptus") || has_euca_mac? && can_metadata_connect?(Ohai::Mixin::Ec2Metadata::EC2_METADATA_ADDR, 80)
+ hint?("eucalyptus") || has_euca_mac? && can_metadata_connect?(info_getter::Mixin::Ec2Metadata::EC2_METADATA_ADDR, 80)
end
collect_data do
if looks_like_euca?
- Ohai::Log.debug("Plugin Eucalyptus: looks_like_euca? == true")
+ info_getter::Log.debug("Plugin Eucalyptus: looks_like_euca? == true")
eucalyptus Mash.new
self.fetch_metadata.each do |k, v|
# Eucalyptus 3.4+ supports IAM roles and Instance Profiles much like AWS
# https://www.eucalyptus.com/blog/2013/10/15/iam-roles-and-instance-profiles-eucalyptus-34
#
# fetch_metadata returns IAM security credentials, including the IAM user's
- # secret access key. We'd rather not have ohai send this information
+ # secret access key. We'd rather not have info_getter 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")
@@ -73,7 +73,7 @@ Ohai.plugin(:Eucalyptus) do
end
eucalyptus[:userdata] = self.fetch_userdata
else
- Ohai::Log.debug("Plugin Eucalyptus: looks_like_euca? == false")
+ info_getter::Log.debug("Plugin Eucalyptus: looks_like_euca? == false")
false
end
end
diff --git a/lib/ohai/plugins/freebsd/cpu.rb b/lib/ohai/plugins/freebsd/cpu.rb
index 5d75308e..59434c36 100644
--- a/lib/ohai/plugins/freebsd/cpu.rb
+++ b/lib/ohai/plugins/freebsd/cpu.rb
@@ -17,7 +17,7 @@
# limitations under the License.
#
-Ohai.plugin(:CPU) do
+info_getter.plugin(:CPU) do
provides "cpu"
collect_data(:freebsd) do
@@ -47,7 +47,7 @@ Ohai.plugin(:CPU) do
cpuinfo["mhz"] = $2
when /Origin.*"(.*)".*Family.*0x(\S+).*Model.*0x(\S+).*Stepping.*(\S+)/
cpuinfo["vendor_id"] = $1
- # convert from hex value to int, but keep a string to match Linux ohai
+ # convert from hex value to int, but keep a string to match Linux info_getter
cpuinfo["family"] = $2.to_i(16).to_s
cpuinfo["model"] = $3.to_i(16).to_s
cpuinfo["stepping"] = $4
diff --git a/lib/ohai/plugins/freebsd/memory.rb b/lib/ohai/plugins/freebsd/memory.rb
index fdf32a30..0e05772f 100644
--- a/lib/ohai/plugins/freebsd/memory.rb
+++ b/lib/ohai/plugins/freebsd/memory.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-Ohai.plugin(:Memory) do
+info_getter.plugin(:Memory) do
provides "memory", "memory/swap"
collect_data(:freebsd) do
diff --git a/lib/ohai/plugins/freebsd/network.rb b/lib/ohai/plugins/freebsd/network.rb
index efcaabb1..e6fc9034 100644
--- a/lib/ohai/plugins/freebsd/network.rb
+++ b/lib/ohai/plugins/freebsd/network.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-Ohai.plugin(:Network) do
+info_getter.plugin(:Network) do
provides "network", "network/interfaces"
provides "counters/network", "counters/network/interfaces"
@@ -39,7 +39,7 @@ Ohai.plugin(:Network) do
end
iface = Mash.new
- so = shell_out("#{ Ohai.abs_path( "/sbin/ifconfig" )} -a")
+ so = shell_out("#{ info_getter.abs_path( "/sbin/ifconfig" )} -a")
cint = nil
so.stdout.lines do |line|
if line =~ /^([0-9a-zA-Z\.]+):\s+/
diff --git a/lib/ohai/plugins/freebsd/os.rb b/lib/ohai/plugins/freebsd/os.rb
index ee1c9d0b..81edf253 100644
--- a/lib/ohai/plugins/freebsd/os.rb
+++ b/lib/ohai/plugins/freebsd/os.rb
@@ -18,9 +18,9 @@
# limitations under the License.
#
-require "ohai/mixin/os"
+require "info_getter/mixin/os"
-Ohai.plugin(:OS) do
+info_getter.plugin(:OS) do
provides "os", "os_version"
collect_data(:freebsd) do
diff --git a/lib/ohai/plugins/freebsd/platform.rb b/lib/ohai/plugins/freebsd/platform.rb
index bef7b73e..2d6bb7bd 100644
--- a/lib/ohai/plugins/freebsd/platform.rb
+++ b/lib/ohai/plugins/freebsd/platform.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-Ohai.plugin(:Platform) do
+info_getter.plugin(:Platform) do
provides "platform", "platform_version", "platform_family"
collect_data(:freebsd) do
diff --git a/lib/ohai/plugins/gce.rb b/lib/ohai/plugins/gce.rb
index e913070c..1d50f9f4 100644
--- a/lib/ohai/plugins/gce.rb
+++ b/lib/ohai/plugins/gce.rb
@@ -14,10 +14,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-require "ohai/mixin/gce_metadata"
+require "info_getter/mixin/gce_metadata"
-Ohai.plugin(:GCE) do
- include Ohai::Mixin::GCEMetadata
+info_getter.plugin(:GCE) do
+ include info_getter::Mixin::GCEMetadata
provides "gce"
@@ -27,7 +27,7 @@ Ohai.plugin(:GCE) do
# true:: If gce metadata server found
# false:: Otherwise
def has_gce_metadata?
- can_metadata_connect?(Ohai::Mixin::GCEMetadata::GCE_METADATA_ADDR, 80)
+ can_metadata_connect?(info_getter::Mixin::GCEMetadata::GCE_METADATA_ADDR, 80)
end
# Identifies gce
@@ -41,11 +41,11 @@ Ohai.plugin(:GCE) do
collect_data do
if looks_like_gce?
- Ohai::Log.debug("Plugin GCE: looks_like_gce? == true")
+ info_getter::Log.debug("Plugin GCE: looks_like_gce? == true")
gce Mash.new
fetch_metadata.each { |k, v| gce[k] = v }
else
- Ohai::Log.debug("Plugin GCE: looks_like_gce? == false")
+ info_getter::Log.debug("Plugin GCE: looks_like_gce? == false")
false
end
end
diff --git a/lib/ohai/plugins/go.rb b/lib/ohai/plugins/go.rb
index 3748531b..95f4880e 100644
--- a/lib/ohai/plugins/go.rb
+++ b/lib/ohai/plugins/go.rb
@@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-Ohai.plugin(:Go) do
+info_getter.plugin(:Go) do
provides "languages/go"
depends "languages"
@@ -27,8 +27,8 @@ Ohai.plugin(:Go) do
go[:version] = $1
languages[:go] = go
end
- rescue Ohai::Exceptions::Exec
- Ohai::Log.debug('Go plugin: Could not shell_out "go version". Skipping plugin')
+ rescue info_getter::Exceptions::Exec
+ info_getter::Log.debug('Go plugin: Could not shell_out "go version". Skipping plugin')
end
end
end
diff --git a/lib/ohai/plugins/groovy.rb b/lib/ohai/plugins/groovy.rb
index 7edbb67c..56c7d7c1 100644
--- a/lib/ohai/plugins/groovy.rb
+++ b/lib/ohai/plugins/groovy.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-Ohai.plugin(:Groovy) do
+info_getter.plugin(:Groovy) do
provides "languages/groovy"
depends "languages"
@@ -31,8 +31,8 @@ Ohai.plugin(:Groovy) do
groovy[:jvm] = $2
languages[:groovy] = groovy
end
- rescue Ohai::Exceptions::Exec
- Ohai::Log.debug('Groovy plugin: Could not shell_out "groovy -v". Skipping plugin')
+ rescue info_getter::Exceptions::Exec
+ info_getter::Log.debug('Groovy plugin: Could not shell_out "groovy -v". Skipping plugin')
end
end
end
diff --git a/lib/ohai/plugins/hostname.rb b/lib/ohai/plugins/hostname.rb
index fb97d971..12b57663 100644
--- a/lib/ohai/plugins/hostname.rb
+++ b/lib/ohai/plugins/hostname.rb
@@ -28,7 +28,7 @@
require "socket"
require "ipaddr"
-Ohai.plugin(:Hostname) do
+info_getter.plugin(:Hostname) do
provides "domain", "hostname", "fqdn", "machinename"
# hostname : short hostname
@@ -127,19 +127,19 @@ Ohai.plugin(:Hostname) do
# Sometimes... very rarely, but sometimes, 'hostname --fqdn' falsely
# returns a blank string. WTF.
if ourfqdn.nil? || ourfqdn.empty?
- Ohai::Log.debug("hostname --fqdn returned an empty string, retrying " +
+ info_getter::Log.debug("hostname --fqdn returned an empty string, retrying " +
"once.")
ourfqdn = from_cmd("hostname --fqdn")
end
if ourfqdn.nil? || ourfqdn.empty?
- Ohai::Log.debug("hostname --fqdn returned an empty string twice and " +
+ info_getter::Log.debug("hostname --fqdn returned an empty string twice and " +
"will not be set.")
else
fqdn ourfqdn
end
rescue
- Ohai::Log.debug(
+ info_getter::Log.debug(
"hostname --fqdn returned an error, probably no domain set")
end
domain collect_domain
diff --git a/lib/ohai/plugins/init_package.rb b/lib/ohai/plugins/init_package.rb
index 1bf54ce1..f165c22f 100644
--- a/lib/ohai/plugins/init_package.rb
+++ b/lib/ohai/plugins/init_package.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-Ohai.plugin(:InitPackage) do
+info_getter.plugin(:InitPackage) do
provides "init_package"
collect_data(:linux) do
diff --git a/lib/ohai/plugins/ip_scopes.rb b/lib/ohai/plugins/ip_scopes.rb
index 4d8d61d8..4b1e6384 100644
--- a/lib/ohai/plugins/ip_scopes.rb
+++ b/lib/ohai/plugins/ip_scopes.rb
@@ -15,7 +15,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-Ohai.plugin(:IpScopes) do
+info_getter.plugin(:IpScopes) do
provides "network_ip_scope", "privateaddress"
depends "network/interfaces"
@@ -43,7 +43,7 @@ Ohai.plugin(:IpScopes) do
rescue LoadError => e
# our favourite gem is not installed. Boohoo.
- Ohai::Log.debug("Plugin ip_scopes: cannot load gem, plugin disabled: #{e}")
+ info_getter::Log.debug("Plugin ip_scopes: cannot load gem, plugin disabled: #{e}")
end
end
diff --git a/lib/ohai/plugins/java.rb b/lib/ohai/plugins/java.rb
index b0d482b7..a65ec836 100644
--- a/lib/ohai/plugins/java.rb
+++ b/lib/ohai/plugins/java.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-Ohai.plugin(:Java) do
+info_getter.plugin(:Java) do
provides "languages/java"
depends "languages"
@@ -42,8 +42,8 @@ Ohai.plugin(:Java) do
languages[:java] = java unless java.empty?
end
- rescue Ohai::Exceptions::Exec
- Ohai::Log.debug('Java plugin: Could not shell_out "java -mx64m -version". Skipping plugin')
+ rescue info_getter::Exceptions::Exec
+ info_getter::Log.debug('Java plugin: Could not shell_out "java -mx64m -version". Skipping plugin')
end
end
diff --git a/lib/ohai/plugins/joyent.rb b/lib/ohai/plugins/joyent.rb
index c921d65d..d0ee38ad 100644
--- a/lib/ohai/plugins/joyent.rb
+++ b/lib/ohai/plugins/joyent.rb
@@ -19,7 +19,7 @@
# Reference from: sm-summary command
-Ohai.plugin(:Joyent) do
+info_getter.plugin(:Joyent) do
provides "joyent"
provides "virtualization/guest_id"
depends "os", "platform", "virtualization"
diff --git a/lib/ohai/plugins/kernel.rb b/lib/ohai/plugins/kernel.rb
index 3441eb73..352e9a4e 100644
--- a/lib/ohai/plugins/kernel.rb
+++ b/lib/ohai/plugins/kernel.rb
@@ -22,7 +22,7 @@
# limitations under the License.
#
-Ohai.plugin(:Kernel) do
+info_getter.plugin(:Kernel) do
provides "kernel", "kernel/modules"
# common initial kernel attribute values
@@ -40,7 +40,7 @@ Ohai.plugin(:Kernel) do
# common *bsd code for collecting modules data
def bsd_modules(path)
modules = Mash.new
- so = shell_out("#{Ohai.abs_path(path)}")
+ so = shell_out("#{info_getter.abs_path(path)}")
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\_]+)/
diff --git a/lib/ohai/plugins/keys.rb b/lib/ohai/plugins/keys.rb
index 72cb8b99..4a6b928d 100644
--- a/lib/ohai/plugins/keys.rb
+++ b/lib/ohai/plugins/keys.rb
@@ -17,7 +17,7 @@
# limitations under the License.
#
-Ohai.plugin(:Keys) do
+info_getter.plugin(:Keys) do
provides "keys"
collect_data do
diff --git a/lib/ohai/plugins/languages.rb b/lib/ohai/plugins/languages.rb
index a0894f1f..581ad7cd 100644
--- a/lib/ohai/plugins/languages.rb
+++ b/lib/ohai/plugins/languages.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-Ohai.plugin(:Languages) do
+info_getter.plugin(:Languages) do
provides "languages"
collect_data do
diff --git a/lib/ohai/plugins/linode.rb b/lib/ohai/plugins/linode.rb
index c096f228..8099f012 100644
--- a/lib/ohai/plugins/linode.rb
+++ b/lib/ohai/plugins/linode.rb
@@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-Ohai.plugin(:Linode) do
+info_getter.plugin(:Linode) do
provides "linode"
depends "kernel"
@@ -38,7 +38,7 @@ Ohai.plugin(:Linode) do
# Names linode ip address
#
- # name - symbol of ohai name (e.g. :public_ip)
+ # name - symbol of info_getter name (e.g. :public_ip)
# eth - Interface name (e.g. :eth0)
#
# Alters linode mash with new interface based on name parameter
@@ -53,13 +53,13 @@ Ohai.plugin(:Linode) do
collect_data do
# Setup linode mash if it is a linode system
if looks_like_linode?
- Ohai::Log.debug("Plugin Linode: looks_like_linode? == true")
+ info_getter::Log.debug("Plugin Linode: looks_like_linode? == true")
linode Mash.new
get_ip_address(:public_ip, :eth0)
get_ip_address(:private_ip, "eth0:1")
hint?("linode").each { |k, v| linode[k] = v } if hint?("linode").kind_of?(Hash)
else
- Ohai::Log.debug("Plugin Linode: looks_like_linode? == false")
+ info_getter::Log.debug("Plugin Linode: looks_like_linode? == false")
end
end
end
diff --git a/lib/ohai/plugins/linux/block_device.rb b/lib/ohai/plugins/linux/block_device.rb
index 709d03e4..434002b8 100644
--- a/lib/ohai/plugins/linux/block_device.rb
+++ b/lib/ohai/plugins/linux/block_device.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-Ohai.plugin(:BlockDevice) do
+info_getter.plugin(:BlockDevice) do
provides "block_device"
collect_data(:linux) do
diff --git a/lib/ohai/plugins/linux/cpu.rb b/lib/ohai/plugins/linux/cpu.rb
index 287e8def..9ca1711d 100644
--- a/lib/ohai/plugins/linux/cpu.rb
+++ b/lib/ohai/plugins/linux/cpu.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-Ohai.plugin(:CPU) do
+info_getter.plugin(:CPU) do
provides "cpu"
collect_data(:linux) do
diff --git a/lib/ohai/plugins/linux/filesystem.rb b/lib/ohai/plugins/linux/filesystem.rb
index 35e7224a..e3b1915f 100644
--- a/lib/ohai/plugins/linux/filesystem.rb
+++ b/lib/ohai/plugins/linux/filesystem.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-Ohai.plugin(:Filesystem) do
+info_getter.plugin(:Filesystem) do
provides "filesystem"
def get_blk_cmd(attr, have_lsblk)
@@ -142,7 +142,7 @@ Ohai.plugin(:Filesystem) do
# Grab any missing mount information from /proc/mounts
if File.exist?("/proc/mounts")
mounts = ""
- # Due to https://tickets.opscode.com/browse/OHAI-196
+ # Due to https://tickets.opscode.com/browse/info_getter-196
# we have to non-block read dev files. Ew.
f = File.open("/proc/mounts")
loop do
diff --git a/lib/ohai/plugins/linux/filesystem2.rb b/lib/ohai/plugins/linux/filesystem2.rb
index 1268ad63..d90cb178 100644
--- a/lib/ohai/plugins/linux/filesystem2.rb
+++ b/lib/ohai/plugins/linux/filesystem2.rb
@@ -18,7 +18,7 @@
# limitations under the License.
#
-Ohai.plugin(:Filesystem2) do
+info_getter.plugin(:Filesystem2) do
provides "filesystem2"
def find_device(name)
@@ -179,7 +179,7 @@ Ohai.plugin(:Filesystem2) do
# Grab any missing mount information from /proc/mounts
if File.exist?("/proc/mounts")
mounts = ""
- # Due to https://tickets.opscode.com/browse/OHAI-196
+ # Due to https://tickets.opscode.com/browse/info_getter-196
# we have to non-block read dev files. Ew.
f = File.open("/proc/mounts")
loop do
diff --git a/lib/ohai/plugins/linux/fips.rb b/lib/ohai/plugins/linux/fips.rb
index 573746bf..4ce98c9c 100644
--- a/lib/ohai/plugins/linux/fips.rb
+++ b/lib/ohai/plugins/linux/fips.rb
@@ -22,7 +22,7 @@
# platforms built upon the Windows_NT kernel and have access to win32 or win64
# subsystems.
-Ohai.plugin(:Fips) do
+info_getter.plugin(:Fips) do
provides "fips"
collect_data(:linux) do
diff --git a/lib/ohai/plugins/linux/hostnamectl.rb b/lib/ohai/plugins/linux/hostnamectl.rb
index 960b7c42..ebb368ab 100644
--- a/lib/ohai/plugins/linux/hostnamectl.rb
+++ b/lib/ohai/plugins/linux/hostnamectl.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-Ohai.plugin(:Hostnamectl) do
+info_getter.plugin(:Hostnamectl) do
provides "hostnamectl"
collect_data(:linux) do
diff --git a/lib/ohai/plugins/linux/lsb.rb b/lib/ohai/plugins/linux/lsb.rb
index 75baec83..673993b4 100644
--- a/lib/ohai/plugins/linux/lsb.rb
+++ b/lib/ohai/plugins/linux/lsb.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-Ohai.plugin(:LSB) do
+info_getter.plugin(:LSB) do
provides "lsb"
collect_data(:linux) do
@@ -53,7 +53,7 @@ Ohai.plugin(:LSB) do
end
end
else
- Ohai::Log.debug("Skipping LSB, cannot find /etc/lsb-release or /usr/bin/lsb_release")
+ info_getter::Log.debug("Skipping LSB, cannot find /etc/lsb-release or /usr/bin/lsb_release")
end
end
end
diff --git a/lib/ohai/plugins/linux/machineid.rb b/lib/ohai/plugins/linux/machineid.rb
index b946c418..1f9e0c55 100644
--- a/lib/ohai/plugins/linux/machineid.rb
+++ b/lib/ohai/plugins/linux/machineid.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-Ohai.plugin(:Machineid) do
+info_getter.plugin(:Machineid) do
provides "machine_id"
collect_data(:linux) do
diff --git a/lib/ohai/plugins/linux/mdadm.rb b/lib/ohai/plugins/linux/mdadm.rb
index 0075750a..cfd2b130 100644
--- a/lib/ohai/plugins/linux/mdadm.rb
+++ b/lib/ohai/plugins/linux/mdadm.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-Ohai.plugin(:Mdadm) do
+info_getter.plugin(:Mdadm) do
provides "mdadm"
def create_raid_device_mash(stdout)
diff --git a/lib/ohai/plugins/linux/memory.rb b/lib/ohai/plugins/linux/memory.rb
index 144ad9d7..aa04d427 100644
--- a/lib/ohai/plugins/linux/memory.rb
+++ b/lib/ohai/plugins/linux/memory.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-Ohai.plugin(:Memory) do
+info_getter.plugin(:Memory) do
provides "memory", "memory/swap"
collect_data(:linux) do
diff --git a/lib/ohai/plugins/linux/network.rb b/lib/ohai/plugins/linux/network.rb
index 98c95245..801061e7 100644
--- a/lib/ohai/plugins/linux/network.rb
+++ b/lib/ohai/plugins/linux/network.rb
@@ -17,7 +17,7 @@
# limitations under the License.
#
-Ohai.plugin(:Network) do
+info_getter.plugin(:Network) do
provides "network", "network/interfaces"
provides "counters/network", "counters/network/interfaces"
provides "ipaddress", "ip6address", "macaddress"
@@ -59,7 +59,7 @@ Ohai.plugin(:Network) do
if line =~ /^([a-f0-9\:\.]+)\s+dev\s+([^\s]+)\s+lladdr\s+([a-fA-F0-9\:]+)/
interface = iface[$2]
unless interface
- Ohai::Log.warn("neighbor list has entries for unknown interface #{interface}")
+ info_getter::Log.warn("neighbor list has entries for unknown interface #{interface}")
next
end
interface[neigh_attr] = Mash.new unless interface[neigh_attr]
@@ -80,7 +80,7 @@ Ohai.plugin(:Network) do
so = shell_out("ip -o -f #{family[:name]} route show table #{default_route_table}")
so.stdout.lines do |line|
line.strip!
- Ohai::Log.debug("Parsing #{line}")
+ info_getter::Log.debug("Parsing #{line}")
if line =~ /\\/
parts = line.split('\\')
route_dest = parts.shift.strip
@@ -95,13 +95,13 @@ Ohai.plugin(:Network) do
if route_ending =~ /\bdev\s+([^\s]+)\b/
route_int = $1
else
- Ohai::Log.debug("Skipping route entry without a device: '#{line}'")
+ info_getter::Log.debug("Skipping route entry without a device: '#{line}'")
next
end
route_int = "venet0:0" if is_openvz? && !is_openvz_host? && route_int == "venet0" && iface["venet0:0"]
unless iface[route_int]
- Ohai::Log.debug("Skipping previously unseen interface from 'ip route show': #{route_int}")
+ info_getter::Log.debug("Skipping previously unseen interface from 'ip route show': #{route_int}")
next
end
@@ -118,7 +118,7 @@ Ohai.plugin(:Network) do
addr = iface[route_int][:addresses]
unless addr.nil? || addr.has_key?(route_entry[:src]) ||
addr.values.all? { |a| a["family"] != family[:name] }
- Ohai::Log.debug("Skipping route entry whose src does not match the interface IP")
+ info_getter::Log.debug("Skipping route entry whose src does not match the interface IP")
next
end
end
@@ -156,7 +156,7 @@ Ohai.plugin(:Network) do
so = shell_out("#{ethtool_binary} #{tmp_int}")
so.stdout.lines do |line|
line.chomp!
- Ohai::Log.debug("Parsing ethtool output: #{line}")
+ info_getter::Log.debug("Parsing ethtool output: #{line}")
line.lstrip!
k, v = line.split(": ")
next unless keys.include? k
@@ -177,7 +177,7 @@ Ohai.plugin(:Network) do
iface.each_key do |tmp_int|
next unless iface[tmp_int][:encapsulation] == "Ethernet"
so = shell_out("#{ethtool_binary} -g #{tmp_int}")
- Ohai::Log.debug("Parsing ethtool output: #{so.stdout}")
+ info_getter::Log.debug("Parsing ethtool output: #{so.stdout}")
type = nil
iface[tmp_int]["ring_params"] = {}
so.stdout.lines.each do |line|
@@ -456,13 +456,13 @@ Ohai.plugin(:Network) do
counters Mash.new unless counters
counters[:network] = Mash.new unless counters[:network]
- # ohai.plugin[:network][:default_route_table] = 'default'
+ # info_getter.plugin[:network][:default_route_table] = 'default'
if configuration(:default_route_table).nil? || configuration(:default_route_table).empty?
default_route_table = "main"
else
default_route_table = configuration(:default_route_table)
end
- Ohai::Log.debug("default route table is '#{default_route_table}'")
+ info_getter::Log.debug("default route table is '#{default_route_table}'")
# Match the lead line for an interface from iproute2
# 3: eth0.11@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP
@@ -507,14 +507,14 @@ Ohai.plugin(:Network) do
else
"default_#{family[:name]}_interface"
end
- Ohai::Log.debug("Unable to determine '#{attribute_name}' as no default routes were found for that interface family")
+ info_getter::Log.debug("Unable to determine '#{attribute_name}' as no default routes were found for that interface family")
else
network["#{default_prefix}_interface"] = default_route[:dev]
- Ohai::Log.debug("#{default_prefix}_interface set to #{default_route[:dev]}")
+ info_getter::Log.debug("#{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")
- Ohai::Log.debug("#{default_prefix}_gateway set to #{network["#{default_prefix}_gateway"]}")
+ info_getter::Log.debug("#{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
favored_route = favored_default_route(routes, iface, default_route, family)
@@ -527,20 +527,20 @@ Ohai.plugin(:Network) do
if family[:name] == "inet"
ipaddress favored_route[:src]
m = get_mac_for_interface(iface, favored_route[:dev])
- Ohai::Log.debug("Overwriting macaddress #{macaddress} with #{m} from interface #{favored_route[:dev]}") if macaddress
+ info_getter::Log.debug("Overwriting macaddress #{macaddress} with #{m} from interface #{favored_route[:dev]}") if macaddress
macaddress m
elsif family[:name] == "inet6"
# this rarely does anything since we rarely have src for ipv6, so this usually falls back on the network plugin
ip6address favored_route[:src]
if macaddress
- Ohai::Log.debug("Not setting macaddress from ipv6 interface #{favored_route[:dev]} because macaddress is already set")
+ info_getter::Log.debug("Not setting macaddress from ipv6 interface #{favored_route[:dev]} because macaddress is already set")
else
macaddress get_mac_for_interface(iface, favored_route[:dev])
end
end
else
- Ohai::Log.debug("the linux/network plugin was unable to deduce the favored default route for family '#{family[:name]}' despite finding a default route, and is not setting ipaddress/ip6address/macaddress. the network plugin may provide fallbacks.")
- Ohai::Log.debug("this potential default route was excluded: #{default_route}")
+ info_getter::Log.debug("the linux/network plugin was unable to deduce the favored default route for family '#{family[:name]}' despite finding a default route, and is not setting ipaddress/ip6address/macaddress. the network plugin may provide fallbacks.")
+ info_getter::Log.debug("this potential default route was excluded: #{default_route}")
end
end
end # end families.each
@@ -549,8 +549,8 @@ Ohai.plugin(:Network) do
so = shell_out("route -n")
route_result = so.stdout.split($/).grep( /^0.0.0.0/ )[0].split( /[ \t]+/ )
network[:default_gateway], network[:default_interface] = route_result.values_at(1, 7)
- rescue Ohai::Exceptions::Exec
- Ohai::Log.debug("Unable to determine default interface")
+ rescue info_getter::Exceptions::Exec
+ info_getter::Log.debug("Unable to determine default interface")
end
so = shell_out("ifconfig -a")
diff --git a/lib/ohai/plugins/linux/platform.rb b/lib/ohai/plugins/linux/platform.rb
index aa7771e8..7adb92f1 100644
--- a/lib/ohai/plugins/linux/platform.rb
+++ b/lib/ohai/plugins/linux/platform.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-Ohai.plugin(:Platform) do
+info_getter.plugin(:Platform) do
provides "platform", "platform_version", "platform_family"
depends "lsb"
diff --git a/lib/ohai/plugins/linux/sessions.rb b/lib/ohai/plugins/linux/sessions.rb
index a2a3a09b..48bcfcfb 100644
--- a/lib/ohai/plugins/linux/sessions.rb
+++ b/lib/ohai/plugins/linux/sessions.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-Ohai.plugin(:Sessions) do
+info_getter.plugin(:Sessions) do
provides "sessions/by_session", "sessions/by_user"
collect_data(:linux) do
diff --git a/lib/ohai/plugins/linux/virtualization.rb b/lib/ohai/plugins/linux/virtualization.rb
index ec101314..a03d6996 100644
--- a/lib/ohai/plugins/linux/virtualization.rb
+++ b/lib/ohai/plugins/linux/virtualization.rb
@@ -16,10 +16,10 @@
# limitations under the License.
#
-require "ohai/mixin/dmi_decode"
+require "info_getter/mixin/dmi_decode"
-Ohai.plugin(:Virtualization) do
- include Ohai::Mixin::DmiDecode
+info_getter.plugin(:Virtualization) do
+ include info_getter::Mixin::DmiDecode
provides "virtualization"
def lxc_version_exists?
@@ -57,7 +57,7 @@ Ohai.plugin(:Virtualization) do
# Xen Notes:
# - cpuid of guests, if we could get it, would also be a clue
- # - may be able to determine if under paravirt from /dev/xen/evtchn (See OHAI-253)
+ # - may be able to determine if under paravirt from /dev/xen/evtchn (See info_getter-253)
# - Additional edge cases likely should not change the above assumptions
# but rather be additive - btm
@@ -167,7 +167,7 @@ Ohai.plugin(:Virtualization) do
# will show the subsystems and root (/) namespace.
# <index #>:<subsystem>:/
#
- # Full notes, https://tickets.opscode.com/browse/OHAI-551
+ # Full notes, https://tickets.opscode.com/browse/info_getter-551
# Kernel docs, https://www.kernel.org/doc/Documentation/cgroups
if File.exist?("/proc/self/cgroup")
cgroup_content = File.read("/proc/self/cgroup")
@@ -179,14 +179,14 @@ Ohai.plugin(:Virtualization) do
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)
+ # So we're cautious here to not overwrite other existing values (info_getter-573)
unless virtualization[:system] && virtualization[:role]
virtualization[:system] = "lxc"
virtualization[:role] = "host"
end
- # In general, the 'systems' framework from OHAI-182 is less susceptible to conflicts
+ # In general, the 'systems' framework from info_getter-182 is less susceptible to conflicts
# But, this could overwrite virtualization[:systems][:lxc] = "guest"
- # If so, we may need to look further for a differentiator (OHAI-573)
+ # If so, we may need to look further for a differentiator (info_getter-573)
virtualization[:systems][:lxc] = "host"
end
elsif File.exist?("/.dockerenv") || File.exist?("/.dockerinit")
diff --git a/lib/ohai/plugins/lua.rb b/lib/ohai/plugins/lua.rb
index 0a6aaeab..51e29a32 100644
--- a/lib/ohai/plugins/lua.rb
+++ b/lib/ohai/plugins/lua.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-Ohai.plugin(:Lua) do
+info_getter.plugin(:Lua) do
provides "languages/lua"
depends "languages"
@@ -30,8 +30,8 @@ Ohai.plugin(:Lua) do
lua[:version] = so.stderr.split[1]
languages[:lua] = lua if lua[:version]
end
- rescue Ohai::Exceptions::Exec
- Ohai::Log.debug('Lua plugin: Could not shell_out "lua -v". Skipping plugin')
+ rescue info_getter::Exceptions::Exec
+ info_getter::Log.debug('Lua plugin: Could not shell_out "lua -v". Skipping plugin')
end
end
end
diff --git a/lib/ohai/plugins/mono.rb b/lib/ohai/plugins/mono.rb
index a7c53935..df26695f 100644
--- a/lib/ohai/plugins/mono.rb
+++ b/lib/ohai/plugins/mono.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-Ohai.plugin(:Mono) do
+info_getter.plugin(:Mono) do
provides "languages/mono"
depends "languages"
@@ -43,8 +43,8 @@ Ohai.plugin(:Mono) do
end
languages[:mono] = mono unless mono.empty?
end
- rescue Ohai::Exceptions::Exec
- Ohai::Log.debug('Mono plugin: Could not shell_out "mono -V". Skipping plugin')
+ rescue info_getter::Exceptions::Exec
+ info_getter::Log.debug('Mono plugin: Could not shell_out "mono -V". Skipping plugin')
end
end
end
diff --git a/lib/ohai/plugins/netbsd/cpu.rb b/lib/ohai/plugins/netbsd/cpu.rb
index 4a2f85a0..29780a04 100644
--- a/lib/ohai/plugins/netbsd/cpu.rb
+++ b/lib/ohai/plugins/netbsd/cpu.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-Ohai.plugin(:CPU) do
+info_getter.plugin(:CPU) do
provides "cpu"
collect_data(:netbsd) do
diff --git a/lib/ohai/plugins/netbsd/memory.rb b/lib/ohai/plugins/netbsd/memory.rb
index 02ddcf5c..1c7be136 100644
--- a/lib/ohai/plugins/netbsd/memory.rb
+++ b/lib/ohai/plugins/netbsd/memory.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-Ohai.plugin(:Memory) do
+info_getter.plugin(:Memory) do
provides "memory"
collect_data(:netbsd) do
diff --git a/lib/ohai/plugins/netbsd/network.rb b/lib/ohai/plugins/netbsd/network.rb
index f2b8f85f..268c3900 100644
--- a/lib/ohai/plugins/netbsd/network.rb
+++ b/lib/ohai/plugins/netbsd/network.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-Ohai.plugin(:Network) do
+info_getter.plugin(:Network) do
provides "network", "network/interfaces"
provides "counters/network", "counters/network/interfaces"
@@ -39,7 +39,7 @@ Ohai.plugin(:Network) do
end
iface = Mash.new
- so = shell_out("#{ Ohai.abs_path( "/sbin/ifconfig" )} -a")
+ so = shell_out("#{ info_getter.abs_path( "/sbin/ifconfig" )} -a")
cint = nil
so.stdout.lines do |line|
if line =~ /^([0-9a-zA-Z\.]+):\s+/
diff --git a/lib/ohai/plugins/netbsd/platform.rb b/lib/ohai/plugins/netbsd/platform.rb
index 9293787b..b836c87c 100644
--- a/lib/ohai/plugins/netbsd/platform.rb
+++ b/lib/ohai/plugins/netbsd/platform.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-Ohai.plugin(:Platform) do
+info_getter.plugin(:Platform) do
provides "platform", "platform_version", "platform_family"
collect_data(:netbsd) do
diff --git a/lib/ohai/plugins/network.rb b/lib/ohai/plugins/network.rb
index 1a1175f5..4d9c47f3 100644
--- a/lib/ohai/plugins/network.rb
+++ b/lib/ohai/plugins/network.rb
@@ -17,10 +17,10 @@
#
require "ipaddress"
-require "ohai/mixin/network_constants"
+require "info_getter/mixin/network_constants"
-Ohai.plugin(:NetworkAddresses) do
- include Ohai::Mixin::NetworkConstants
+info_getter.plugin(:NetworkAddresses) do
+ include info_getter::Mixin::NetworkConstants
provides "ipaddress", "ip6address", "macaddress"
@@ -68,8 +68,8 @@ Ohai.plugin(:NetworkAddresses) do
return [ nil, nil ] if ips.empty?
# shortcuts to access default #{family} interface and gateway
- int_attr = Ohai::Mixin::NetworkConstants::FAMILIES[family] + "_interface"
- gw_attr = Ohai::Mixin::NetworkConstants::FAMILIES[family] + "_gateway"
+ int_attr = info_getter::Mixin::NetworkConstants::FAMILIES[family] + "_interface"
+ gw_attr = info_getter::Mixin::NetworkConstants::FAMILIES[family] + "_gateway"
if network[int_attr]
# working with the address(es) of the default network interface
@@ -77,13 +77,13 @@ Ohai.plugin(:NetworkAddresses) do
v[:iface] == network[int_attr]
end
if gw_if_ips.empty?
- Ohai::Log.warn("[#{family}] no ip address on #{network[int_attr]}")
+ info_getter::Log.warn("[#{family}] no ip address on #{network[int_attr]}")
elsif network[gw_attr] &&
network["interfaces"][network[int_attr]] &&
network["interfaces"][network[int_attr]]["addresses"]
if [ "0.0.0.0", "::", /^fe80:/ ].any? { |pat| pat === network[gw_attr] }
# link level default route
- Ohai::Log.debug("link level default #{family} route, picking ip from #{network[gw_attr]}")
+ info_getter::Log.debug("link level default #{family} route, picking ip from #{network[gw_attr]}")
r = gw_if_ips.first
else
# checking network masks
@@ -92,9 +92,9 @@ Ohai.plugin(:NetworkAddresses) do
end.first
if r.nil?
r = gw_if_ips.first
- Ohai::Log.debug("[#{family}] no ipaddress/mask on #{network[int_attr]} matching the gateway #{network[gw_attr]}, picking #{r[:ipaddress]}")
+ info_getter::Log.debug("[#{family}] no ipaddress/mask on #{network[int_attr]} matching the gateway #{network[gw_attr]}, picking #{r[:ipaddress]}")
else
- Ohai::Log.debug("[#{family}] Using default interface #{network[int_attr]} and default gateway #{network[gw_attr]} to set the default ip to #{r[:ipaddress]}")
+ info_getter::Log.debug("[#{family}] Using default interface #{network[int_attr]} and default gateway #{network[gw_attr]} to set the default ip to #{r[:ipaddress]}")
end
end
else
@@ -103,7 +103,7 @@ Ohai.plugin(:NetworkAddresses) do
end
else
r = ips.first
- Ohai::Log.debug("[#{family}] no default interface, picking the first ipaddress")
+ info_getter::Log.debug("[#{family}] no default interface, picking the first ipaddress")
end
return [ nil, nil ] if r.nil? || r.empty?
@@ -141,7 +141,7 @@ Ohai.plugin(:NetworkAddresses) do
counters[:network] = Mash.new unless counters[:network]
# inet family is processed before inet6 to give ipv4 precedence
- Ohai::Mixin::NetworkConstants::FAMILIES.keys.sort.each do |family|
+ info_getter::Mixin::NetworkConstants::FAMILIES.keys.sort.each do |family|
r = {}
# find the ip/interface with the default route for this family
(r["ip"], r["iface"]) = find_ip(family)
@@ -149,13 +149,13 @@ Ohai.plugin(:NetworkAddresses) do
# don't overwrite attributes if they've already been set by the "#{os}::network" plugin
if (family == "inet") && ipaddress.nil?
if r["ip"].nil?
- Ohai::Log.warn("unable to detect ipaddress")
+ info_getter::Log.warn("unable to detect ipaddress")
else
ipaddress r["ip"]
end
elsif (family == "inet6") && ip6address.nil?
if r["ip"].nil?
- Ohai::Log.debug("unable to detect ip6address")
+ info_getter::Log.debug("unable to detect ip6address")
else
ip6address r["ip"]
end
@@ -165,10 +165,10 @@ Ohai.plugin(:NetworkAddresses) do
# otherwise we set macaddress on a first-found basis (and we started with ipv4)
if macaddress.nil?
if r["mac"]
- Ohai::Log.debug("setting macaddress to '#{r["mac"]}' from interface '#{r["iface"]}' for family '#{family}'")
+ info_getter::Log.debug("setting macaddress to '#{r["mac"]}' from interface '#{r["iface"]}' for family '#{family}'")
macaddress r["mac"]
else
- Ohai::Log.debug("unable to detect macaddress for family '#{family}'")
+ info_getter::Log.debug("unable to detect macaddress for family '#{family}'")
end
end
@@ -177,7 +177,7 @@ Ohai.plugin(:NetworkAddresses) do
if results["inet"]["iface"] && results["inet6"]["iface"] &&
(results["inet"]["iface"] != results["inet6"]["iface"])
- Ohai::Log.debug("ipaddress and ip6address are set from different interfaces (#{results["inet"]["iface"]} & #{results["inet6"]["iface"]})")
+ info_getter::Log.debug("ipaddress and ip6address are set from different interfaces (#{results["inet"]["iface"]} & #{results["inet6"]["iface"]})")
end
end
end
diff --git a/lib/ohai/plugins/network_listeners.rb b/lib/ohai/plugins/network_listeners.rb
index 292378d7..ebc35cc5 100644
--- a/lib/ohai/plugins/network_listeners.rb
+++ b/lib/ohai/plugins/network_listeners.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-Ohai.plugin(:NetworkListeners) do
+info_getter.plugin(:NetworkListeners) do
provides "network/listeners"
depends "network", "counters/network"
@@ -54,7 +54,7 @@ Ohai.plugin(:NetworkListeners) do
network[:listeners] = Mash.new
network[:listeners][:tcp] = listeners
rescue LoadError
- Ohai::Log.debug("Could not load sigar gem. Skipping NetworkListeners plugin")
+ info_getter::Log.debug("Could not load sigar gem. Skipping NetworkListeners plugin")
end
end
end
diff --git a/lib/ohai/plugins/nodejs.rb b/lib/ohai/plugins/nodejs.rb
index c1bb0848..30b35dd0 100644
--- a/lib/ohai/plugins/nodejs.rb
+++ b/lib/ohai/plugins/nodejs.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-Ohai.plugin(:Nodejs) do
+info_getter.plugin(:Nodejs) do
provides "languages/nodejs"
depends "languages"
@@ -33,8 +33,8 @@ Ohai.plugin(:Nodejs) do
end
languages[:nodejs] = nodejs if nodejs[:version]
end
- rescue Ohai::Exceptions::Exec
- Ohai::Log.debug('Nodejs plugin: Could not shell_out "node -v". Skipping plugin')
+ rescue info_getter::Exceptions::Exec
+ info_getter::Log.debug('Nodejs plugin: Could not shell_out "node -v". Skipping plugin')
end
end
end
diff --git a/lib/ohai/plugins/ohai.rb b/lib/ohai/plugins/ohai.rb
index 9cadb480..a9bd4a6c 100644
--- a/lib/ohai/plugins/ohai.rb
+++ b/lib/ohai/plugins/ohai.rb
@@ -16,15 +16,15 @@
# limitations under the License.
#
-Ohai.plugin(:Ohai) do
- provides "chef_packages/ohai"
+info_getter.plugin(:info_getter) do
+ provides "chef_packages/info_getter"
collect_data do
- require "ohai"
+ require "info_getter"
chef_packages Mash.new unless chef_packages
- chef_packages[:ohai] = Mash.new
- chef_packages[:ohai][:version] = Ohai::VERSION
- chef_packages[:ohai][:ohai_root] = Ohai::OHAI_ROOT
+ chef_packages[:info_getter] = Mash.new
+ chef_packages[:info_getter][:version] = info_getter::VERSION
+ chef_packages[:info_getter][:info_getter_root] = info_getter::info_getter_ROOT
end
end
diff --git a/lib/ohai/plugins/ohai_time.rb b/lib/ohai/plugins/ohai_time.rb
index f0f0ba7f..a6299ecd 100644
--- a/lib/ohai/plugins/ohai_time.rb
+++ b/lib/ohai/plugins/ohai_time.rb
@@ -16,10 +16,10 @@
# limitations under the License.
#
-Ohai.plugin(:OhaiTime) do
- provides "ohai_time"
+info_getter.plugin(:info_getterTime) do
+ provides "info_getter_time"
collect_data do
- ohai_time Time.now.to_f
+ info_getter_time Time.now.to_f
end
end
diff --git a/lib/ohai/plugins/openbsd/cpu.rb b/lib/ohai/plugins/openbsd/cpu.rb
index e106b540..6a08b4e5 100644
--- a/lib/ohai/plugins/openbsd/cpu.rb
+++ b/lib/ohai/plugins/openbsd/cpu.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-Ohai.plugin(:CPU) do
+info_getter.plugin(:CPU) do
provides "cpu"
collect_data(:openbsd) do
diff --git a/lib/ohai/plugins/openbsd/memory.rb b/lib/ohai/plugins/openbsd/memory.rb
index 020a3881..1983cfaf 100644
--- a/lib/ohai/plugins/openbsd/memory.rb
+++ b/lib/ohai/plugins/openbsd/memory.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-Ohai.plugin(:Memory) do
+info_getter.plugin(:Memory) do
provides "memory", "memory/swap"
collect_data(:openbsd) do
diff --git a/lib/ohai/plugins/openbsd/network.rb b/lib/ohai/plugins/openbsd/network.rb
index 4bcdc19d..1c0b92dd 100644
--- a/lib/ohai/plugins/openbsd/network.rb
+++ b/lib/ohai/plugins/openbsd/network.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-Ohai.plugin(:Network) do
+info_getter.plugin(:Network) do
provides "network", "network/interfaces"
provides "counters/network", "counters/network/interfaces"
@@ -39,7 +39,7 @@ Ohai.plugin(:Network) do
end
iface = Mash.new
- so = shell_out( "#{ Ohai.abs_path( "/sbin/ifconfig" ) } -a" )
+ so = shell_out( "#{ info_getter.abs_path( "/sbin/ifconfig" ) } -a" )
cint = nil
so.stdout.lines do |line|
if line =~ /^([0-9a-zA-Z\.]+):\s+/
diff --git a/lib/ohai/plugins/openbsd/platform.rb b/lib/ohai/plugins/openbsd/platform.rb
index a99cf7a5..2fbff170 100644
--- a/lib/ohai/plugins/openbsd/platform.rb
+++ b/lib/ohai/plugins/openbsd/platform.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-Ohai.plugin(:Platform) do
+info_getter.plugin(:Platform) do
provides "platform", "platform_version", "platform_family"
collect_data(:openbsd) do
diff --git a/lib/ohai/plugins/openstack.rb b/lib/ohai/plugins/openstack.rb
index a7818e60..df087274 100644
--- a/lib/ohai/plugins/openstack.rb
+++ b/lib/ohai/plugins/openstack.rb
@@ -16,10 +16,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-require "ohai/mixin/ec2_metadata"
+require "info_getter/mixin/ec2_metadata"
-Ohai.plugin(:Openstack) do
- include Ohai::Mixin::Ec2Metadata
+info_getter.plugin(:Openstack) do
+ include info_getter::Mixin::Ec2Metadata
provides "openstack"
depends "dmi"
@@ -29,21 +29,21 @@ Ohai.plugin(:Openstack) do
def openstack_dmi?
# detect a manufacturer of OpenStack Foundation
if get_attribute(:dmi, :system, :all_records, 0, :Manufacturer) =~ /OpenStack/
- Ohai::Log.debug("Plugin Openstack: has_openstack_dmi? == true")
+ info_getter::Log.debug("Plugin Openstack: has_openstack_dmi? == true")
return true
else
- Ohai::Log.debug("Plugin Openstack: has_openstack_dmi? == false")
+ info_getter::Log.debug("Plugin Openstack: has_openstack_dmi? == false")
return false
end
end
- # check for the ohai hint and log debug messaging
+ # check for the info_getter hint and log debug messaging
def openstack_hint?
if hint?("openstack")
- Ohai::Log.debug("Plugin Openstack: openstack hint present")
+ info_getter::Log.debug("Plugin Openstack: openstack hint present")
return true
else
- Ohai::Log.debug("Plugin Openstack: openstack hint not present")
+ info_getter::Log.debug("Plugin Openstack: openstack hint not present")
return false
end
end
@@ -61,16 +61,16 @@ Ohai.plugin(:Openstack) do
openstack[:provider] = openstack_provider
# fetch the metadata if we can do a simple socket connect first
- if can_metadata_connect?(Ohai::Mixin::Ec2Metadata::EC2_METADATA_ADDR, 80)
+ if can_metadata_connect?(info_getter::Mixin::Ec2Metadata::EC2_METADATA_ADDR, 80)
fetch_metadata.each do |k, v|
openstack[k] = v
end
- Ohai::Log.debug("Plugin Openstack: Successfully fetched Openstack metadata from the metadata endpoint")
+ info_getter::Log.debug("Plugin Openstack: Successfully fetched Openstack metadata from the metadata endpoint")
else
- Ohai::Log.debug("Plugin Openstack: Timed out connecting to Openstack metadata endpoint. Skipping metadata.")
+ info_getter::Log.debug("Plugin Openstack: Timed out connecting to Openstack metadata endpoint. Skipping metadata.")
end
else
- Ohai::Log.debug("Plugin Openstack: Node does not appear to be an Openstack node")
+ info_getter::Log.debug("Plugin Openstack: Node does not appear to be an Openstack node")
end
end
end
diff --git a/lib/ohai/plugins/os.rb b/lib/ohai/plugins/os.rb
index 2016ff68..05be12f9 100644
--- a/lib/ohai/plugins/os.rb
+++ b/lib/ohai/plugins/os.rb
@@ -16,9 +16,9 @@
# limitations under the License.
#
-require "ohai/mixin/os"
+require "info_getter/mixin/os"
-Ohai.plugin(:OS) do
+info_getter.plugin(:OS) do
provides "os", "os_version"
depends "kernel"
diff --git a/lib/ohai/plugins/packages.rb b/lib/ohai/plugins/packages.rb
index 01cf210e..a4ae4b6a 100644
--- a/lib/ohai/plugins/packages.rb
+++ b/lib/ohai/plugins/packages.rb
@@ -18,7 +18,7 @@
# limitations under the License.
#
#
-Ohai.plugin(:Packages) do
+info_getter.plugin(:Packages) do
provides "packages"
depends "platform_family"
diff --git a/lib/ohai/plugins/passwd.rb b/lib/ohai/plugins/passwd.rb
index 0775efe3..d5f50dcf 100644
--- a/lib/ohai/plugins/passwd.rb
+++ b/lib/ohai/plugins/passwd.rb
@@ -1,7 +1,7 @@
require "etc"
-Ohai.plugin(:Passwd) do
+info_getter.plugin(:Passwd) do
provides "etc", "current_user"
def fix_encoding(str)
diff --git a/lib/ohai/plugins/perl.rb b/lib/ohai/plugins/perl.rb
index dca682e6..56527b41 100644
--- a/lib/ohai/plugins/perl.rb
+++ b/lib/ohai/plugins/perl.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-Ohai.plugin(:Perl) do
+info_getter.plugin(:Perl) do
provides "languages/perl"
depends "languages"
@@ -38,8 +38,8 @@ Ohai.plugin(:Perl) do
end
languages[:perl] = perl unless perl.empty?
end
- rescue Ohai::Exceptions::Exec
- Ohai::Log.debug('Perl plugin: Could not shell_out "perl -V:version -V:archname". Skipping plugin')
+ rescue info_getter::Exceptions::Exec
+ info_getter::Log.debug('Perl plugin: Could not shell_out "perl -V:version -V:archname". Skipping plugin')
end
end
end
diff --git a/lib/ohai/plugins/php.rb b/lib/ohai/plugins/php.rb
index a1f6770c..c6c5f5b4 100644
--- a/lib/ohai/plugins/php.rb
+++ b/lib/ohai/plugins/php.rb
@@ -18,7 +18,7 @@
# limitations under the License.
#
-Ohai.plugin(:PHP) do
+info_getter.plugin(:PHP) do
provides "languages/php"
depends "languages"
@@ -45,8 +45,8 @@ Ohai.plugin(:PHP) do
languages[:php] = php unless php.empty?
end
- rescue Ohai::Exceptions::Exec
- Ohai::Log.debug('Php plugin: Could not shell_out "php -v". Skipping plugin')
+ rescue info_getter::Exceptions::Exec
+ info_getter::Log.debug('Php plugin: Could not shell_out "php -v". Skipping plugin')
end
end
end
diff --git a/lib/ohai/plugins/platform.rb b/lib/ohai/plugins/platform.rb
index 1b4e6dc1..247f3e58 100644
--- a/lib/ohai/plugins/platform.rb
+++ b/lib/ohai/plugins/platform.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-Ohai.plugin(:Platform) do
+info_getter.plugin(:Platform) do
provides "platform", "platform_version", "platform_family"
depends "os", "os_version"
diff --git a/lib/ohai/plugins/powershell.rb b/lib/ohai/plugins/powershell.rb
index af8da75d..1a6d9fdc 100644
--- a/lib/ohai/plugins/powershell.rb
+++ b/lib/ohai/plugins/powershell.rb
@@ -15,7 +15,7 @@
# limitations under the License.
#
-Ohai.plugin(:Powershell) do
+info_getter.plugin(:Powershell) do
provides "languages/powershell"
depends "languages"
@@ -50,8 +50,8 @@ Ohai.plugin(:Powershell) do
powershell[:remoting_protocol_version] = version_info["PSRemotingProtocolVersion"]
languages[:powershell] = powershell unless powershell.empty?
end
- rescue Ohai::Exceptions::Exec
- Ohai::Log.debug('Powershell plugin: Could not shell_out "powershell.exe -NoLogo -NonInteractive -NoProfile -command $PSVersionTable". Skipping plugin')
+ rescue info_getter::Exceptions::Exec
+ info_getter::Log.debug('Powershell plugin: Could not shell_out "powershell.exe -NoLogo -NonInteractive -NoProfile -command $PSVersionTable". Skipping plugin')
end
end
diff --git a/lib/ohai/plugins/ps.rb b/lib/ohai/plugins/ps.rb
index 5edd3bb8..59dd8485 100644
--- a/lib/ohai/plugins/ps.rb
+++ b/lib/ohai/plugins/ps.rb
@@ -19,7 +19,7 @@
# limitations under the License.
#
-Ohai.plugin(:PS) do
+info_getter.plugin(:PS) do
provides "command/ps"
depends "command"
diff --git a/lib/ohai/plugins/python.rb b/lib/ohai/plugins/python.rb
index 749a5f37..f3df010a 100644
--- a/lib/ohai/plugins/python.rb
+++ b/lib/ohai/plugins/python.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-Ohai.plugin(:Python) do
+info_getter.plugin(:Python) do
provides "languages/python"
depends "languages"
@@ -36,8 +36,8 @@ Ohai.plugin(:Python) do
end
languages[:python] = python unless python.empty?
end
- rescue Ohai::Exceptions::Exec
- Ohai::Log.debug('Python plugin: Could not shell_out "python -c "import sys; print (sys.version)"". Skipping plugin')
+ rescue info_getter::Exceptions::Exec
+ info_getter::Log.debug('Python plugin: Could not shell_out "python -c "import sys; print (sys.version)"". Skipping plugin')
end
end
end
diff --git a/lib/ohai/plugins/rackspace.rb b/lib/ohai/plugins/rackspace.rb
index 282f8e14..bb45e13b 100644
--- a/lib/ohai/plugins/rackspace.rb
+++ b/lib/ohai/plugins/rackspace.rb
@@ -16,7 +16,7 @@
require "resolv"
-Ohai.plugin(:Rackspace) do
+info_getter.plugin(:Rackspace) do
provides "rackspace"
depends "kernel", "network/interfaces"
@@ -40,7 +40,7 @@ Ohai.plugin(:Rackspace) do
if so.exitstatus == 0
so.stdout.strip.casecmp("rackspace").zero?
end
- rescue Ohai::Exceptions::Exec
+ rescue info_getter::Exceptions::Exec
false
end
@@ -91,8 +91,8 @@ Ohai.plugin(:Rackspace) do
rackspace[:region] = line.split[2].delete('\"') if line =~ /^region/
end
end
- rescue Ohai::Exceptions::Exec
- Ohai::Log.debug("rackspace plugin: Unable to find xenstore-ls, cannot capture region information for Rackspace cloud")
+ rescue info_getter::Exceptions::Exec
+ info_getter::Log.debug("rackspace plugin: Unable to find xenstore-ls, cannot capture region information for Rackspace cloud")
nil
end
@@ -103,8 +103,8 @@ Ohai.plugin(:Rackspace) do
if so.exitstatus == 0
rackspace[:instance_id] = so.stdout.gsub(/instance-/, "")
end
- rescue Ohai::Exceptions::Exec
- Ohai::Log.debug("rackspace plugin: Unable to find xenstore-read, cannot capture instance ID information for Rackspace cloud")
+ rescue info_getter::Exceptions::Exec
+ info_getter::Log.debug("rackspace plugin: Unable to find xenstore-read, cannot capture instance ID information for Rackspace cloud")
nil
end
@@ -119,16 +119,16 @@ Ohai.plugin(:Rackspace) do
if so.exitstatus == 0
networks.push(FFI_Yajl::Parser.new.parse(so.stdout))
else
- Ohai::Log.debug("rackspace plugin: Unable to capture custom private networking information for Rackspace cloud")
+ info_getter::Log.debug("rackspace plugin: Unable to capture custom private networking information for Rackspace cloud")
return false
end
end
- # these networks are already known to ohai, and are not 'private networks'
+ # these networks are already known to info_getter, and are not 'private networks'
networks.delete_if { |hash| hash["label"] == "private" }
networks.delete_if { |hash| hash["label"] == "public" }
end
- rescue Ohai::Exceptions::Exec
- Ohai::Log.debug("rackspace plugin: Unable to capture custom private networking information for Rackspace cloud")
+ rescue info_getter::Exceptions::Exec
+ info_getter::Log.debug("rackspace plugin: Unable to capture custom private networking information for Rackspace cloud")
nil
end
diff --git a/lib/ohai/plugins/root_group.rb b/lib/ohai/plugins/root_group.rb
index c6f2605d..73351f5d 100644
--- a/lib/ohai/plugins/root_group.rb
+++ b/lib/ohai/plugins/root_group.rb
@@ -15,15 +15,15 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-Ohai.plugin(:RootGroup) do
+info_getter.plugin(:RootGroup) do
provides "root_group"
- require "ohai/util/win32/group_helper" if RUBY_PLATFORM =~ /mswin|mingw32|windows/
+ require "info_getter/util/win32/group_helper" if RUBY_PLATFORM =~ /mswin|mingw32|windows/
collect_data do
case ::RbConfig::CONFIG["host_os"]
when /mswin|mingw32|windows/
- group = Ohai::Util::Win32::GroupHelper.windows_root_group_name
+ group = info_getter::Util::Win32::GroupHelper.windows_root_group_name
root_group group
else
root_group Etc.getgrgid(Etc.getpwnam("root").gid).name
diff --git a/lib/ohai/plugins/ruby.rb b/lib/ohai/plugins/ruby.rb
index 8a036031..58ae93cc 100644
--- a/lib/ohai/plugins/ruby.rb
+++ b/lib/ohai/plugins/ruby.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-Ohai.plugin(:Ruby) do
+info_getter.plugin(:Ruby) do
provides "languages/ruby"
depends "languages"
diff --git a/lib/ohai/plugins/rust.rb b/lib/ohai/plugins/rust.rb
index 0d6435df..bf1e1b8e 100644
--- a/lib/ohai/plugins/rust.rb
+++ b/lib/ohai/plugins/rust.rb
@@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-Ohai.plugin(:Rust) do
+info_getter.plugin(:Rust) do
provides "languages/rust"
depends "languages"
@@ -27,8 +27,8 @@ Ohai.plugin(:Rust) do
rust[:version] = so.stdout.split[1]
languages[:rust] = rust if rust[:version]
end
- rescue Ohai::Exceptions::Exec
- Ohai::Log.debug('Rust plugin: Could not shell_out "rustc --version". Skipping plugin')
+ rescue info_getter::Exceptions::Exec
+ info_getter::Log.debug('Rust plugin: Could not shell_out "rustc --version". Skipping plugin')
end
end
end
diff --git a/lib/ohai/plugins/scala.rb b/lib/ohai/plugins/scala.rb
index f847a565..92a92338 100644
--- a/lib/ohai/plugins/scala.rb
+++ b/lib/ohai/plugins/scala.rb
@@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-Ohai.plugin(:Scala) do
+info_getter.plugin(:Scala) do
provides "languages/scala", "languages/scala/sbt"
depends "languages"
@@ -27,8 +27,8 @@ Ohai.plugin(:Scala) do
if so.exitstatus == 0
scala[:version] = so.stderr.split[4]
end
- rescue Ohai::Exceptions::Exec
- Ohai::Log.debug('Scala plugin: Could not shell_out "scala -version". Skipping data')
+ rescue info_getter::Exceptions::Exec
+ info_getter::Log.debug('Scala plugin: Could not shell_out "scala -version". Skipping data')
end
# Check for sbt
@@ -39,8 +39,8 @@ Ohai.plugin(:Scala) do
scala[:sbt] = Mash.new
scala[:sbt][:version] = so.stdout.split[3]
end
- rescue Ohai::Exceptions::Exec
- Ohai::Log.debug('Scala plugin: Could not shell_out "sbt --version". Skipping data')
+ rescue info_getter::Exceptions::Exec
+ info_getter::Log.debug('Scala plugin: Could not shell_out "sbt --version". Skipping data')
end
languages[:scala] = scala unless scala.empty?
diff --git a/lib/ohai/plugins/shard.rb b/lib/ohai/plugins/shard.rb
index 7cc14148..75da3f48 100644
--- a/lib/ohai/plugins/shard.rb
+++ b/lib/ohai/plugins/shard.rb
@@ -18,7 +18,7 @@
require "digest/md5"
-Ohai.plugin(:ShardSeed) do
+info_getter.plugin(:ShardSeed) do
depends "hostname", "dmi", "machine_id", "machinename"
provides "shard_seed"
@@ -37,7 +37,7 @@ Ohai.plugin(:ShardSeed) do
# Common sources go here. Put sources that need to be different per-platform
# under their collect_data block.
def create_seed(&block)
- sources = Ohai.config[:plugin][:shard_seed][:sources] || default_sources
+ sources = info_getter.config[:plugin][:shard_seed][:sources] || default_sources
data = ""
sources.each do |src|
data << case src
diff --git a/lib/ohai/plugins/shells.rb b/lib/ohai/plugins/shells.rb
index 8d94cf56..3cf02856 100644
--- a/lib/ohai/plugins/shells.rb
+++ b/lib/ohai/plugins/shells.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-Ohai.plugin(:Shells) do
+info_getter.plugin(:Shells) do
provides "shells"
collect_data do
diff --git a/lib/ohai/plugins/sigar/cpu.rb b/lib/ohai/plugins/sigar/cpu.rb
index 54f8387c..4ac388f0 100644
--- a/lib/ohai/plugins/sigar/cpu.rb
+++ b/lib/ohai/plugins/sigar/cpu.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-Ohai.plugin(:CPU) do
+info_getter.plugin(:CPU) do
provides "cpu"
collect_data(:hpux, :default) do
diff --git a/lib/ohai/plugins/sigar/filesystem.rb b/lib/ohai/plugins/sigar/filesystem.rb
index 234fc16f..8a29deb6 100644
--- a/lib/ohai/plugins/sigar/filesystem.rb
+++ b/lib/ohai/plugins/sigar/filesystem.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-Ohai.plugin(:Filesystem) do
+info_getter.plugin(:Filesystem) do
provides "filesystem"
collect_data(:hpux, :default) do
diff --git a/lib/ohai/plugins/sigar/memory.rb b/lib/ohai/plugins/sigar/memory.rb
index 78f55199..8caf5109 100644
--- a/lib/ohai/plugins/sigar/memory.rb
+++ b/lib/ohai/plugins/sigar/memory.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-Ohai.plugin(:Memory) do
+info_getter.plugin(:Memory) do
provides "memory"
collect_data(:hpux, :default) do
diff --git a/lib/ohai/plugins/sigar/network.rb b/lib/ohai/plugins/sigar/network.rb
index 68ce3add..2cadafc5 100644
--- a/lib/ohai/plugins/sigar/network.rb
+++ b/lib/ohai/plugins/sigar/network.rb
@@ -16,10 +16,10 @@
# limitations under the License.
#
-require "ohai/mixin/network_constants"
+require "info_getter/mixin/network_constants"
-Ohai.plugin(:Network) do
- include Ohai::Mixin::NetworkConstants
+info_getter.plugin(:Network) do
+ include info_getter::Mixin::NetworkConstants
provides "network", "network/interfaces"
provides "counters/network", "counters/network/interfaces"
@@ -155,7 +155,7 @@ Ohai.plugin(:Network) do
# should never happen
network[:interfaces][route.ifname][:route] = Mash.new unless network[:interfaces][route.ifname][:route]
route_data = {}
- Ohai::Mixin::NetworkConstants::SIGAR_ROUTE_METHODS.each do |m|
+ info_getter::Mixin::NetworkConstants::SIGAR_ROUTE_METHODS.each do |m|
if m == :flags
route_data[m] = flags(route.send(m))
else
diff --git a/lib/ohai/plugins/sigar/network_route.rb b/lib/ohai/plugins/sigar/network_route.rb
index d41c1524..8598f65b 100644
--- a/lib/ohai/plugins/sigar/network_route.rb
+++ b/lib/ohai/plugins/sigar/network_route.rb
@@ -16,13 +16,13 @@
# limitations under the License.
#
-require "ohai/mixin/network_constants"
+require "info_getter/mixin/network_constants"
-Ohai.plugin(:NetworkRoutes) do
+info_getter.plugin(:NetworkRoutes) do
begin
require "sigar"
- include Ohai::Mixin::NetworkConstants
+ include info_getter::Mixin::NetworkConstants
provides "network/interfaces/adapters/route"
depends "network/interfaces"
@@ -48,7 +48,7 @@ Ohai.plugin(:NetworkRoutes) do
next unless network[:interfaces][route.ifname] # this should never happen
network[:interfaces][route.ifname][:route] = Mash.new unless network[:interfaces][route.ifname][:route]
route_data = {}
- Ohai::Mixin::NetworkConstants::SIGAR_ROUTE_METHODS.each do |m|
+ info_getter::Mixin::NetworkConstants::SIGAR_ROUTE_METHODS.each do |m|
if m == :flags
route_data[m] = flags(route.send(m))
else
@@ -59,6 +59,6 @@ Ohai.plugin(:NetworkRoutes) do
end
end
rescue LoadError
- Ohai::Log.debug("Could not load sigar gem. Skipping NetworkRoutes plugin")
+ info_getter::Log.debug("Could not load sigar gem. Skipping NetworkRoutes plugin")
end
end
diff --git a/lib/ohai/plugins/sigar/platform.rb b/lib/ohai/plugins/sigar/platform.rb
index 454851da..b8f09591 100644
--- a/lib/ohai/plugins/sigar/platform.rb
+++ b/lib/ohai/plugins/sigar/platform.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-Ohai.plugin(:Platform) do
+info_getter.plugin(:Platform) do
provides "platform", "platform_version", "platform_family"
collect_data(:hpux) do
diff --git a/lib/ohai/plugins/softlayer.rb b/lib/ohai/plugins/softlayer.rb
index 2165a822..5ce29eec 100644
--- a/lib/ohai/plugins/softlayer.rb
+++ b/lib/ohai/plugins/softlayer.rb
@@ -18,10 +18,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-require "ohai/mixin/softlayer_metadata"
+require "info_getter/mixin/softlayer_metadata"
-Ohai.plugin(:Softlayer) do
- include ::Ohai::Mixin::SoftlayerMetadata
+info_getter.plugin(:Softlayer) do
+ include ::info_getter::Mixin::SoftlayerMetadata
provides "softlayer"
@@ -37,12 +37,12 @@ Ohai.plugin(:Softlayer) do
collect_data do
# Adds softlayer Mash
if looks_like_softlayer?
- Ohai::Log.debug("Plugin Softlayer: looks_like_softlayer? == true")
+ info_getter::Log.debug("Plugin Softlayer: looks_like_softlayer? == true")
metadata = fetch_metadata
softlayer Mash.new
metadata.each { |k, v| softlayer[k] = v } if metadata
else
- Ohai::Log.debug("Plugin Softlayer: looks_like_softlayer? == false")
+ info_getter::Log.debug("Plugin Softlayer: looks_like_softlayer? == false")
end
end
end
diff --git a/lib/ohai/plugins/solaris2/cpu.rb b/lib/ohai/plugins/solaris2/cpu.rb
index 52b8941e..7592a248 100644
--- a/lib/ohai/plugins/solaris2/cpu.rb
+++ b/lib/ohai/plugins/solaris2/cpu.rb
@@ -14,7 +14,7 @@
# limitations under the License.
#
-Ohai.plugin(:CPU) do
+info_getter.plugin(:CPU) do
provides "cpu"
collect_data(:solaris2) do
diff --git a/lib/ohai/plugins/solaris2/dmi.rb b/lib/ohai/plugins/solaris2/dmi.rb
index 3f98dbfe..6d3b3921 100644
--- a/lib/ohai/plugins/solaris2/dmi.rb
+++ b/lib/ohai/plugins/solaris2/dmi.rb
@@ -16,16 +16,16 @@
# limitations under the License.
#
-Ohai.plugin(:DMI) do
+info_getter.plugin(:DMI) do
provides "dmi"
collect_data(:solaris2) do
- require "ohai/common/dmi"
+ require "info_getter/common/dmi"
# if we already have a "dmi" with keys (presumably from dmidecode), don't try smbios
# note that a single key just means dmidecode exited with its version
if (dmi.class.to_s == "Mash") && (dmi.keys.length > 1)
- Ohai::Log.debug("skipping smbios output, since DMI information has already been provided")
+ info_getter::Log.debug("skipping smbios output, since DMI information has already been provided")
return
end
@@ -118,7 +118,7 @@ Ohai.plugin(:DMI) do
# remove/replace any characters that don't fall inside permissible ASCII range, or whitespace
line = raw_line.gsub(/[^\x20-\x7E\n\t\r]/, ".")
if line != raw_line
- Ohai::Log.debug("converted characters from line:\n#{raw_line}")
+ info_getter::Log.debug("converted characters from line:\n#{raw_line}")
end
if header_information = header_information_line.match(line)
@@ -128,16 +128,16 @@ Ohai.plugin(:DMI) do
if smb_to_id.has_key?(header_information[3])
id = smb_to_id[header_information[3]]
- # Don't overcapture for now (OHAI-260)
- unless Ohai::Common::DMI::ID_TO_CAPTURE.include?(id)
+ # Don't overcapture for now (info_getter-260)
+ unless info_getter::Common::DMI::ID_TO_CAPTURE.include?(id)
dmi_record = nil
next
end
- dmi_record[:type] = Ohai::Common::DMI.id_lookup(id)
+ dmi_record[:type] = info_getter::Common::DMI.id_lookup(id)
else
- Ohai::Log.debug("unrecognized header type; skipping")
+ info_getter::Log.debug("unrecognized header type; skipping")
dmi_record = nil
next
end
@@ -153,7 +153,7 @@ Ohai.plugin(:DMI) do
elsif data = data_key_value_line.match(line)
if dmi_record == nil
- Ohai::Log.debug("unexpected data line found before header; discarding:\n#{line}")
+ info_getter::Log.debug("unexpected data line found before header; discarding:\n#{line}")
next
end
dmi[dmi_record[:type]][:all_records][dmi_record[:position]][data[1]] = data[2]
@@ -161,7 +161,7 @@ Ohai.plugin(:DMI) do
elsif data = data_key_only_line.match(line)
if dmi_record == nil
- Ohai::Log.debug("unexpected data line found before header; discarding:\n#{line}")
+ info_getter::Log.debug("unexpected data line found before header; discarding:\n#{line}")
next
end
dmi[dmi_record[:type]][:all_records][dmi_record[:position]][data[1]] = ""
@@ -169,11 +169,11 @@ Ohai.plugin(:DMI) do
elsif extended_data = extended_data_line.match(line)
if dmi_record == nil
- Ohai::Log.debug("unexpected extended data line found before header; discarding:\n#{line}")
+ info_getter::Log.debug("unexpected extended data line found before header; discarding:\n#{line}")
next
end
if field == nil
- Ohai::Log.debug("unexpected extended data line found outside data section; discarding:\n#{line}")
+ info_getter::Log.debug("unexpected extended data line found outside data section; discarding:\n#{line}")
next
end
# overwrite "raw" value with a new Mash
@@ -181,11 +181,11 @@ Ohai.plugin(:DMI) do
dmi[dmi_record[:type]][:all_records][dmi_record[:position]][field][extended_data[1]] = extended_data[2]
else
- Ohai::Log.debug("unrecognized output line; discarding:\n#{line}")
+ info_getter::Log.debug("unrecognized output line; discarding:\n#{line}")
end
end
- Ohai::Common::DMI.convenience_keys(dmi)
+ info_getter::Common::DMI.convenience_keys(dmi)
end
end
diff --git a/lib/ohai/plugins/solaris2/filesystem.rb b/lib/ohai/plugins/solaris2/filesystem.rb
index 9eceac80..fd78998d 100644
--- a/lib/ohai/plugins/solaris2/filesystem.rb
+++ b/lib/ohai/plugins/solaris2/filesystem.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-Ohai.plugin(:Filesystem) do
+info_getter.plugin(:Filesystem) do
provides "filesystem"
collect_data(:solaris2) do
@@ -63,8 +63,8 @@ Ohai.plugin(:Filesystem) do
# Grab any zfs data from "zfs get"
zfs = Mash.new
- # ohai.plugin[:filesystem][:zfs_properties] = 'used'
- # ohai.plugin[:filesystem][:zfs_properties] = ['mountpoint', 'creation', 'available', 'used']
+ # info_getter.plugin[:filesystem][:zfs_properties] = 'used'
+ # info_getter.plugin[:filesystem][:zfs_properties] = ['mountpoint', 'creation', 'available', 'used']
zfs_get = "zfs get -p -H "
if configuration(:zfs_properties).nil? || configuration(:zfs_properties).empty?
zfs_get << "all"
diff --git a/lib/ohai/plugins/solaris2/memory.rb b/lib/ohai/plugins/solaris2/memory.rb
index 3b727f67..14c00b57 100644
--- a/lib/ohai/plugins/solaris2/memory.rb
+++ b/lib/ohai/plugins/solaris2/memory.rb
@@ -14,7 +14,7 @@
# limitations under the License.
#
-Ohai.plugin(:Memory) do
+info_getter.plugin(:Memory) do
provides "memory"
collect_data(:solaris2) do
diff --git a/lib/ohai/plugins/solaris2/network.rb b/lib/ohai/plugins/solaris2/network.rb
index 7a2a47bc..5219dad0 100644
--- a/lib/ohai/plugins/solaris2/network.rb
+++ b/lib/ohai/plugins/solaris2/network.rb
@@ -60,7 +60,7 @@ ETHERNET_ENCAPS = %w{ afe amd8111s arn atge ath bfe bge bnx bnxe ce cxgbe
nge ntxn nxge pcn platform qfe qlc ral rge rtls rtw rwd
rwn sfe tavor vr wpi xge yge aggr} unless defined?(ETHERNET_ENCAPS)
-Ohai.plugin(:Network) do
+info_getter.plugin(:Network) do
provides "network", "network/interfaces"
provides "counters/network", "counters/network/interfaces"
@@ -178,11 +178,11 @@ Ohai.plugin(:Network) do
else
matches[:name]
end
- Ohai::Log.debug("found interface device: #{network[:default_interface]} #{matches[:name]}")
+ info_getter::Log.debug("found interface device: #{network[:default_interface]} #{matches[:name]}")
end
matches = /gateway: (\S+)/.match(line)
if matches
- Ohai::Log.debug("found gateway: #{matches[1]}")
+ info_getter::Log.debug("found gateway: #{matches[1]}")
network[:default_gateway] = matches[1]
end
end
diff --git a/lib/ohai/plugins/solaris2/platform.rb b/lib/ohai/plugins/solaris2/platform.rb
index 9aa88fb9..3bdbfd70 100644
--- a/lib/ohai/plugins/solaris2/platform.rb
+++ b/lib/ohai/plugins/solaris2/platform.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-Ohai.plugin(:Platform) do
+info_getter.plugin(:Platform) do
provides "platform", "platform_version", "platform_build", "platform_family"
collect_data(:solaris2) do
diff --git a/lib/ohai/plugins/solaris2/virtualization.rb b/lib/ohai/plugins/solaris2/virtualization.rb
index bca7b6eb..17ba089d 100644
--- a/lib/ohai/plugins/solaris2/virtualization.rb
+++ b/lib/ohai/plugins/solaris2/virtualization.rb
@@ -18,10 +18,10 @@
# limitations under the License.
#
-require "ohai/mixin/dmi_decode"
+require "info_getter/mixin/dmi_decode"
-Ohai.plugin(:Virtualization) do
- include Ohai::Mixin::DmiDecode
+info_getter.plugin(:Virtualization) do
+ include info_getter::Mixin::DmiDecode
provides "virtualization"
def collect_solaris_guestid
@@ -35,7 +35,7 @@ Ohai.plugin(:Virtualization) do
virtualization[:systems] = Mash.new
# Detect paravirt KVM/QEMU from cpuinfo, report as KVM
- psrinfo_path = Ohai.abs_path( "/usr/sbin/psrinfo" )
+ psrinfo_path = info_getter.abs_path( "/usr/sbin/psrinfo" )
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/
@@ -47,7 +47,7 @@ Ohai.plugin(:Virtualization) do
# Pass smbios information to the dmi_decode mixin to
# identify possible virtualization systems
- smbios_path = Ohai.abs_path("/usr/sbin/smbios")
+ smbios_path = info_getter.abs_path("/usr/sbin/smbios")
if File.exist?(smbios_path)
guest = guest_from_dmi(shell_out(smbios_path).stdout)
if guest
diff --git a/lib/ohai/plugins/solaris2/zpools.rb b/lib/ohai/plugins/solaris2/zpools.rb
index 9356c29c..9078024e 100644
--- a/lib/ohai/plugins/solaris2/zpools.rb
+++ b/lib/ohai/plugins/solaris2/zpools.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-Ohai.plugin(:Zpools) do
+info_getter.plugin(:Zpools) do
provides "zpools"
collect_data(:solaris2) do
diff --git a/lib/ohai/plugins/ssh_host_key.rb b/lib/ohai/plugins/ssh_host_key.rb
index 323ddc14..bef4eebc 100644
--- a/lib/ohai/plugins/ssh_host_key.rb
+++ b/lib/ohai/plugins/ssh_host_key.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-Ohai.plugin(:SSHHostKey) do
+info_getter.plugin(:SSHHostKey) do
provides "keys/ssh"
depends "keys"
@@ -44,7 +44,7 @@ Ohai.plugin(:SSHHostKey) do
# Darwin
"/etc/sshd_config"
else
- Ohai::Log.debug("Failed to find sshd configuration file")
+ info_getter::Log.debug("Failed to find sshd configuration file")
nil
end
diff --git a/lib/ohai/plugins/timezone.rb b/lib/ohai/plugins/timezone.rb
index 26a63e42..c4209c1c 100644
--- a/lib/ohai/plugins/timezone.rb
+++ b/lib/ohai/plugins/timezone.rb
@@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-Ohai.plugin(:Timezone) do
+info_getter.plugin(:Timezone) do
provides "time/timezone"
collect_data(:default) do
diff --git a/lib/ohai/plugins/uptime.rb b/lib/ohai/plugins/uptime.rb
index e5866fa3..21f3adbf 100644
--- a/lib/ohai/plugins/uptime.rb
+++ b/lib/ohai/plugins/uptime.rb
@@ -24,16 +24,16 @@
# limitations under the License.
#
-require "ohai/mixin/seconds_to_human"
+require "info_getter/mixin/seconds_to_human"
-Ohai.plugin(:Uptime) do
+info_getter.plugin(:Uptime) do
provides "uptime", "uptime_seconds"
provides "idletime", "idletime_seconds" # linux only
depends "platform_version"
def collect_uptime(path)
# kern.boottime: { sec = 1232765114, usec = 823118 } Fri Jan 23 18:45:14 2009
- so = shell_out("#{Ohai.abs_path(path)} kern.boottime")
+ so = shell_out("#{info_getter.abs_path(path)} kern.boottime")
so.stdout.lines do |line|
if line =~ /kern.boottime:\D+(\d+)/
usec = Time.new.to_i - $1.to_i
@@ -74,7 +74,7 @@ Ohai.plugin(:Uptime) do
collect_data(:openbsd) do
# kern.boottime=Tue Nov 1 14:45:52 2011
- so = shell_out("#{ Ohai.abs_path( "/sbin/sysctl" )} #kern.boottime")
+ so = shell_out("#{ info_getter.abs_path( "/sbin/sysctl" )} #kern.boottime")
so.stdout.lines do |line|
if line =~ /kern.boottime=(.+)/
uptime_seconds Time.new.to_i - Time.parse($1).to_i
diff --git a/lib/ohai/plugins/virtualbox.rb b/lib/ohai/plugins/virtualbox.rb
index 435f649f..bac76726 100644
--- a/lib/ohai/plugins/virtualbox.rb
+++ b/lib/ohai/plugins/virtualbox.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-Ohai.plugin(:Virtualbox) do
+info_getter.plugin(:Virtualbox) do
provides "virtualbox"
collect_data do
diff --git a/lib/ohai/plugins/virtualization.rb b/lib/ohai/plugins/virtualization.rb
index 7e199b93..cd4f577a 100644
--- a/lib/ohai/plugins/virtualization.rb
+++ b/lib/ohai/plugins/virtualization.rb
@@ -19,7 +19,7 @@
# Note: despite the name this is really a libvirt plugin.
# perhaps we'd be better off renaming it? -tsmith
-Ohai.plugin(:VirtualizationInfo) do
+info_getter.plugin(:VirtualizationInfo) do
%w{ uri capabilities nodeinfo domains networks storage }.each do |info|
provides "virtualization/#{info}"
end
@@ -76,7 +76,7 @@ Ohai.plugin(:VirtualizationInfo) do
virtconn.close
rescue LoadError => e
- Ohai::Log.debug("Plugin Virtualization: Can't load gem: #{e}. Cannot continue.")
+ info_getter::Log.debug("Plugin Virtualization: Can't load gem: #{e}. Cannot continue.")
end
end
end
diff --git a/lib/ohai/plugins/vmware.rb b/lib/ohai/plugins/vmware.rb
index 53327e41..d08cf39b 100644
--- a/lib/ohai/plugins/vmware.rb
+++ b/lib/ohai/plugins/vmware.rb
@@ -31,7 +31,7 @@
# get_vm_attributes("/usr/bin/vmware-toolbox-cmd")
#
-Ohai.plugin(:VMware) do
+info_getter.plugin(:VMware) do
provides "vmware"
depends "virtualization"
@@ -42,7 +42,7 @@ Ohai.plugin(:VMware) do
def get_vm_attributes(vmtools_path)
if !File.exist?(vmtools_path)
- Ohai::Log.debug("#{vmtools_path} not found")
+ info_getter::Log.debug("#{vmtools_path} not found")
else
vmware Mash.new
begin
@@ -62,7 +62,7 @@ Ohai.plugin(:VMware) do
vmware[param] = from_cmd("#{vmtools_path} #{param} status")
end
rescue
- Ohai::Log.debug("Error while collecting VMware guest attributes")
+ info_getter::Log.debug("Error while collecting VMware guest attributes")
end
end
end
diff --git a/lib/ohai/plugins/windows/cpu.rb b/lib/ohai/plugins/windows/cpu.rb
index ccb29c86..036fc047 100644
--- a/lib/ohai/plugins/windows/cpu.rb
+++ b/lib/ohai/plugins/windows/cpu.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-Ohai.plugin(:CPU) do
+info_getter.plugin(:CPU) do
provides "cpu"
collect_data(:windows) do
@@ -46,7 +46,7 @@ Ohai.plugin(:CPU) do
cpu[current_cpu]["cores"] = processor["numberofcores"]
cores += processor["numberofcores"]
rescue NoMethodError => e
- Ohai::Log.info("Can not find numberofcores property on Win32_Processor. Consider applying this patch: http://support.microsoft.com/kb/932370")
+ info_getter::Log.info("Can not find numberofcores property on Win32_Processor. Consider applying this patch: http://support.microsoft.com/kb/932370")
cpu[current_cpu]["cores"] = nil
end
diff --git a/lib/ohai/plugins/windows/drivers.rb b/lib/ohai/plugins/windows/drivers.rb
index 425d33dc..fb9c34c0 100644
--- a/lib/ohai/plugins/windows/drivers.rb
+++ b/lib/ohai/plugins/windows/drivers.rb
@@ -15,7 +15,7 @@
# limitations under the License.
#
-Ohai.plugin(:Drivers) do
+info_getter.plugin(:Drivers) do
provides "kernel/pnp_drivers", "kernel/modules"
depends "kernel"
diff --git a/lib/ohai/plugins/windows/filesystem.rb b/lib/ohai/plugins/windows/filesystem.rb
index 7b226526..a5a246ac 100644
--- a/lib/ohai/plugins/windows/filesystem.rb
+++ b/lib/ohai/plugins/windows/filesystem.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-Ohai.plugin(:Filesystem) do
+info_getter.plugin(:Filesystem) do
provides "filesystem"
collect_data(:windows) do
diff --git a/lib/ohai/plugins/windows/fips.rb b/lib/ohai/plugins/windows/fips.rb
index 904320ac..eca352fb 100644
--- a/lib/ohai/plugins/windows/fips.rb
+++ b/lib/ohai/plugins/windows/fips.rb
@@ -22,7 +22,7 @@
# platforms built upon the Windows_NT kernel and have access to win32 or win64
# subsystems.
-Ohai.plugin(:Fips) do
+info_getter.plugin(:Fips) do
provides "fips"
collect_data(:windows) do
diff --git a/lib/ohai/plugins/windows/memory.rb b/lib/ohai/plugins/windows/memory.rb
index e0bb46f0..003e6291 100644
--- a/lib/ohai/plugins/windows/memory.rb
+++ b/lib/ohai/plugins/windows/memory.rb
@@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
-Ohai.plugin(:Memory) do
+info_getter.plugin(:Memory) do
provides "memory"
collect_data(:windows) do
diff --git a/lib/ohai/plugins/windows/network.rb b/lib/ohai/plugins/windows/network.rb
index c600be3d..b85e049d 100644
--- a/lib/ohai/plugins/windows/network.rb
+++ b/lib/ohai/plugins/windows/network.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-Ohai.plugin(:Network) do
+info_getter.plugin(:Network) do
provides "network", "network/interfaces"
provides "counters/network", "counters/network/interfaces"
diff --git a/lib/ohai/plugins/windows/platform.rb b/lib/ohai/plugins/windows/platform.rb
index ecdcb777..934e1368 100644
--- a/lib/ohai/plugins/windows/platform.rb
+++ b/lib/ohai/plugins/windows/platform.rb
@@ -22,7 +22,7 @@
# platforms built upon the Windows_NT kernel and have access to win32 or win64
# subsystems.
-Ohai.plugin(:Platform) do
+info_getter.plugin(:Platform) do
provides "platform", "platform_version", "platform_family"
collect_data(:windows) do
diff --git a/lib/ohai/plugins/windows/virtualization.rb b/lib/ohai/plugins/windows/virtualization.rb
index 947e1697..3618b06d 100644
--- a/lib/ohai/plugins/windows/virtualization.rb
+++ b/lib/ohai/plugins/windows/virtualization.rb
@@ -18,7 +18,7 @@
# limitations under the License.
#
-Ohai.plugin(:Virtualization) do
+info_getter.plugin(:Virtualization) do
provides "virtualization"
collect_data(:windows) do
diff --git a/lib/ohai/provides_map.rb b/lib/ohai/provides_map.rb
index f9ba0518..c72d4b39 100644
--- a/lib/ohai/provides_map.rb
+++ b/lib/ohai/provides_map.rb
@@ -17,12 +17,12 @@
# limitations under the License.
#
-require "ohai/mash"
-require "ohai/exception"
-require "ohai/mixin/os"
-require "ohai/dsl"
+require "info_getter/mash"
+require "info_getter/exception"
+require "info_getter/mixin/os"
+require "info_getter/dsl"
-module Ohai
+module info_getter
class ProvidesMap
attr_reader :map
@@ -32,8 +32,8 @@ module Ohai
end
def set_providers_for(plugin, provided_attributes)
- unless plugin.kind_of?(Ohai::DSL::Plugin)
- raise ArgumentError, "set_providers_for only accepts Ohai Plugin classes (got: #{plugin})"
+ unless plugin.kind_of?(info_getter::DSL::Plugin)
+ raise ArgumentError, "set_providers_for only accepts info_getter Plugin classes (got: #{plugin})"
end
provided_attributes.each do |attribute|
@@ -53,15 +53,15 @@ module Ohai
plugins = []
attributes.each do |attribute|
attrs = select_subtree(@map, attribute)
- raise Ohai::Exceptions::AttributeNotFound, "No such attribute: \'#{attribute}\'" unless attrs
- raise Ohai::Exceptions::ProviderNotFound, "Cannot find plugin providing attribute: \'#{attribute}\'" unless attrs[:_plugins]
+ raise info_getter::Exceptions::AttributeNotFound, "No such attribute: \'#{attribute}\'" unless attrs
+ raise info_getter::Exceptions::ProviderNotFound, "Cannot find plugin providing attribute: \'#{attribute}\'" unless attrs[:_plugins]
plugins += attrs[:_plugins]
end
plugins.uniq
end
# This function is used to fetch the plugins for the attributes specified
- # in the CLI options to Ohai.
+ # in the CLI options to info_getter.
# It first attempts to find the plugins for the attributes
# or the sub attributes given.
# If it can't find any, it looks for plugins that might
@@ -76,7 +76,7 @@ module Ohai
attrs = select_closest_subtree(@map, attribute)
unless attrs
- raise Ohai::Exceptions::AttributeNotFound, "No such attribute: \'#{attribute}\'"
+ raise info_getter::Exceptions::AttributeNotFound, "No such attribute: \'#{attribute}\'"
end
end
@@ -94,9 +94,9 @@ module Ohai
plugins = []
attributes.each do |attribute|
parts = normalize_and_validate(attribute)
- raise Ohai::Exceptions::AttributeNotFound, "No such attribute: \'#{attribute}\'" unless @map[parts[0]]
+ raise info_getter::Exceptions::AttributeNotFound, "No such attribute: \'#{attribute}\'" unless @map[parts[0]]
attrs = select_closest_subtree(@map, attribute)
- raise Ohai::Exceptions::ProviderNotFound, "Cannot find plugin providing attribute: \'#{attribute}\'" unless attrs
+ raise info_getter::Exceptions::ProviderNotFound, "Cannot find plugin providing attribute: \'#{attribute}\'" unless attrs
plugins += attrs[:_plugins]
end
plugins.uniq
@@ -114,8 +114,8 @@ module Ohai
private
def normalize_and_validate(attribute)
- raise Ohai::Exceptions::AttributeSyntaxError, "Attribute contains duplicate '/' characters: #{attribute}" if attribute =~ /\/\/+/
- raise Ohai::Exceptions::AttributeSyntaxError, "Attribute contains a trailing '/': #{attribute}" if attribute =~ /\/$/
+ raise info_getter::Exceptions::AttributeSyntaxError, "Attribute contains duplicate '/' characters: #{attribute}" if attribute =~ /\/\/+/
+ raise info_getter::Exceptions::AttributeSyntaxError, "Attribute contains a trailing '/': #{attribute}" if 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 d687c7b3..3297db9f 100644
--- a/lib/ohai/runner.rb
+++ b/lib/ohai/runner.rb
@@ -17,9 +17,9 @@
# limitations under the License
#
-require "ohai/dsl"
+require "info_getter/dsl"
-module Ohai
+module info_getter
class Runner
# safe_run: set to true if this runner will run plugins in
@@ -33,8 +33,8 @@ module Ohai
# If force is set to true, then this plugin and its dependencies
# will be run even if they have been run before.
def run_plugin(plugin)
- unless plugin.kind_of?(Ohai::DSL::Plugin)
- raise Ohai::Exceptions::InvalidPlugin, "Invalid plugin #{plugin} (must be an Ohai::DSL::Plugin or subclass)"
+ unless plugin.kind_of?(info_getter::DSL::Plugin)
+ raise info_getter::Exceptions::InvalidPlugin, "Invalid plugin #{plugin} (must be an info_getter::DSL::Plugin or subclass)"
end
begin
@@ -44,14 +44,14 @@ module Ohai
when :version6
run_v6_plugin(plugin)
else
- raise Ohai::Exceptions::InvalidPlugin, "Invalid plugin version #{plugin.version} for plugin #{plugin}"
+ raise info_getter::Exceptions::InvalidPlugin, "Invalid plugin version #{plugin.version} for plugin #{plugin}"
end
- rescue Ohai::Exceptions::Error
+ rescue info_getter::Exceptions::Error
raise
- rescue SystemExit # abort or exit from plug-in should exit Ohai with failure code
+ rescue SystemExit # abort or exit from plug-in should exit info_getter with failure code
raise
rescue Exception, Errno::ENOENT => e
- Ohai::Log.debug("Plugin #{plugin.name} threw exception #{e.inspect} #{e.backtrace.join("\n")}")
+ info_getter::Log.debug("Plugin #{plugin.name} threw exception #{e.inspect} #{e.backtrace.join("\n")}")
end
end
@@ -69,7 +69,7 @@ module Ohai
next if next_plugin.has_run?
if visited.include?(next_plugin)
- raise Ohai::Exceptions::DependencyCycle, "Dependency cycle detected. Please refer to the following plugins: #{get_cycle(visited, plugin).join(", ") }"
+ raise info_getter::Exceptions::DependencyCycle, "Dependency cycle detected. Please refer to the following plugins: #{get_cycle(visited, plugin).join(", ") }"
end
dependency_providers = fetch_plugins(next_plugin.dependencies)
diff --git a/lib/ohai/system.rb b/lib/ohai/system.rb
index c55383ca..3a275a8e 100644
--- a/lib/ohai/system.rb
+++ b/lib/ohai/system.rb
@@ -16,22 +16,22 @@
# limitations under the License.
#
-require "ohai/loader"
-require "ohai/log"
-require "ohai/mash"
-require "ohai/runner"
-require "ohai/dsl"
-require "ohai/mixin/command"
-require "ohai/mixin/os"
-require "ohai/mixin/string"
-require "ohai/mixin/constant_helper"
-require "ohai/provides_map"
-require "ohai/hints"
+require "info_getter/loader"
+require "info_getter/log"
+require "info_getter/mash"
+require "info_getter/runner"
+require "info_getter/dsl"
+require "info_getter/mixin/command"
+require "info_getter/mixin/os"
+require "info_getter/mixin/string"
+require "info_getter/mixin/constant_helper"
+require "info_getter/provides_map"
+require "info_getter/hints"
require "mixlib/shellout"
-module Ohai
+module info_getter
class System
- include Ohai::Mixin::ConstantHelper
+ include info_getter::Mixin::ConstantHelper
attr_accessor :data
attr_reader :config
@@ -49,16 +49,16 @@ module Ohai
@provides_map = ProvidesMap.new
@v6_dependency_solver = Hash.new
- configure_ohai
+ configure_info_getter
configure_logging
- @loader = Ohai::Loader.new(self)
- @runner = Ohai::Runner.new(self, true)
+ @loader = info_getter::Loader.new(self)
+ @runner = info_getter::Runner.new(self, true)
- Ohai::Hints.refresh_hints()
+ info_getter::Hints.refresh_hints()
# Remove the previously defined plugins
- recursive_remove_constants(Ohai::NamedPlugin)
+ recursive_remove_constants(info_getter::NamedPlugin)
end
def [](key)
@@ -85,7 +85,7 @@ module Ohai
@runner.run_plugin(v6plugin)
end
- # Users who are migrating from ohai 6 may give one or more Ohai 6 plugin
+ # Users who are migrating from info_getter 6 may give one or more info_getter 6 plugin
# names as the +attribute_filter+. In this case we return early because
# the v7 plugin provides map will not have an entry for this plugin.
if attribute_filter && Array(attribute_filter).all? { |filter_item| have_v6_plugin?(filter_item) }
@@ -97,8 +97,8 @@ module Ohai
@provides_map.all_plugins(attribute_filter).each do |plugin|
@runner.run_plugin(plugin)
end
- rescue Ohai::Exceptions::AttributeNotFound, Ohai::Exceptions::DependencyCycle => e
- Ohai::Log.error("Encountered error while running plugins: #{e.inspect}")
+ rescue info_getter::Exceptions::AttributeNotFound, info_getter::Exceptions::DependencyCycle => e
+ info_getter::Log.error("Encountered error while running plugins: #{e.inspect}")
raise
end
end
@@ -130,25 +130,25 @@ module Ohai
attribute = plugin_ref.gsub("::", "/")
begin
plugins = @provides_map.find_providers_for([attribute])
- rescue Ohai::Exceptions::AttributeNotFound
- Ohai::Log.debug("Can not find any v7 plugin that provides #{attribute}")
+ rescue info_getter::Exceptions::AttributeNotFound
+ info_getter::Log.debug("Can not find any v7 plugin that provides #{attribute}")
plugins = [ ]
end
end
if plugins.empty?
- raise Ohai::Exceptions::DependencyNotFound, "Can not find a plugin for dependency #{plugin_ref}"
+ raise info_getter::Exceptions::DependencyNotFound, "Can not find a plugin for dependency #{plugin_ref}"
else
plugins.each do |plugin|
begin
@runner.run_plugin(plugin)
rescue SystemExit, Interrupt
raise
- rescue Ohai::Exceptions::DependencyCycle, Ohai::Exceptions::AttributeNotFound => e
- Ohai::Log.error("Encountered error while running plugins: #{e.inspect}")
+ rescue info_getter::Exceptions::DependencyCycle, info_getter::Exceptions::AttributeNotFound => e
+ info_getter::Log.error("Encountered error while running plugins: #{e.inspect}")
raise
rescue Exception, Errno::ENOENT => e
- Ohai::Log.debug("Plugin #{plugin.name} threw exception #{e.inspect} #{e.backtrace.join("\n")}")
+ info_getter::Log.debug("Plugin #{plugin.name} threw exception #{e.inspect} #{e.backtrace.join("\n")}")
end
end
end
@@ -164,7 +164,7 @@ module Ohai
# This method takes a naive approach to v6 plugins: it simply re-runs all
# of them whenever called.
def refresh_plugins(attribute_filter = nil)
- Ohai::Hints.refresh_hints()
+ info_getter::Hints.refresh_hints()
@provides_map.all_plugins(attribute_filter).each do |plugin|
plugin.reset!
end
@@ -207,27 +207,27 @@ module Ohai
private
- def configure_ohai
- Ohai::Config.merge_deprecated_config
- Ohai.config.merge!(@config)
+ def configure_info_getter
+ info_getter::Config.merge_deprecated_config
+ info_getter.config.merge!(@config)
- if Ohai.config[:directory] &&
- !Ohai.config[:plugin_path].include?(Ohai.config[:directory])
- Ohai.config[:plugin_path] << Ohai.config[:directory]
+ if info_getter.config[:directory] &&
+ !info_getter.config[:plugin_path].include?(info_getter.config[:directory])
+ info_getter.config[:plugin_path] << info_getter.config[:directory]
end
- Ohai::Log.debug("Running Ohai with the following configuration: #{Ohai.config.configuration}")
+ info_getter::Log.debug("Running info_getter with the following configuration: #{info_getter.config.configuration}")
end
def configure_logging
- return if Ohai::Log.configured?
+ return if info_getter::Log.configured?
- Ohai::Log.init(Ohai.config[:log_location])
+ info_getter::Log.init(info_getter.config[:log_location])
- if Ohai.config[:log_level] == :auto
- Ohai::Log.level = :info
+ if info_getter.config[:log_level] == :auto
+ info_getter::Log.level = :info
else
- Ohai::Log.level = Ohai.config[:log_level]
+ info_getter::Log.level = info_getter.config[:log_level]
end
end
end
diff --git a/lib/ohai/util/file_helper.rb b/lib/ohai/util/file_helper.rb
index 5b08e2db..6ded9ebf 100644
--- a/lib/ohai/util/file_helper.rb
+++ b/lib/ohai/util/file_helper.rb
@@ -18,7 +18,7 @@
# Copied from chef/lib/chef/util/selinux.rb
-module Ohai
+module info_getter
module Util
module FileHelper
def which(cmd)
@@ -26,11 +26,11 @@ module Ohai
paths.each do |path|
filename = File.join(path, cmd)
if File.executable?(filename)
- Ohai::Log.debug("#{self.name} plugin: found #{cmd} at #{filename}")
+ info_getter::Log.debug("#{self.name} plugin: found #{cmd} at #{filename}")
return filename
end
end
- Ohai::Log.debug("#{self.name} plugin: did not find #{cmd}")
+ info_getter::Log.debug("#{self.name} plugin: did not find #{cmd}")
false
end
end
diff --git a/lib/ohai/util/ip_helper.rb b/lib/ohai/util/ip_helper.rb
index f22c4fdd..1647cabf 100644
--- a/lib/ohai/util/ip_helper.rb
+++ b/lib/ohai/util/ip_helper.rb
@@ -16,7 +16,7 @@
require "ipaddress"
-module Ohai
+module info_getter
module Util
module IpHelper
# Corresponding to RFC 4192 + RFC 4193
diff --git a/lib/ohai/util/win32.rb b/lib/ohai/util/win32.rb
index 5cf638d0..99b82db9 100644
--- a/lib/ohai/util/win32.rb
+++ b/lib/ohai/util/win32.rb
@@ -16,7 +16,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-module Ohai
+module info_getter
module Util
module Win32
if RUBY_PLATFORM =~ /mswin|mingw|windows/
diff --git a/lib/ohai/util/win32/group_helper.rb b/lib/ohai/util/win32/group_helper.rb
index 68134d4f..69578cca 100644
--- a/lib/ohai/util/win32/group_helper.rb
+++ b/lib/ohai/util/win32/group_helper.rb
@@ -16,9 +16,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-require "ohai/util/win32"
+require "info_getter/util/win32"
-module Ohai
+module info_getter
module Util
class Win32::GroupHelper
diff --git a/lib/ohai/version.rb b/lib/ohai/version.rb
index a8c596db..e064b9cf 100644
--- a/lib/ohai/version.rb
+++ b/lib/ohai/version.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-module Ohai
- OHAI_ROOT = File.expand_path(File.dirname(__FILE__))
+module info_getter
+ info_getter_ROOT = File.expand_path(File.dirname(__FILE__))
VERSION = "8.20.0"
end
diff --git a/ohai.gemspec b/ohai.gemspec
index 7177f8ca..aa9e0f61 100644
--- a/ohai.gemspec
+++ b/ohai.gemspec
@@ -1,17 +1,17 @@
$:.unshift File.expand_path("../lib", __FILE__)
-require "ohai/version"
+require "info_getter/version"
Gem::Specification.new do |s|
- s.name = "ohai"
- s.version = Ohai::VERSION
+ s.name = "info_getter"
+ s.version = info_getter::VERSION
s.platform = Gem::Platform::RUBY
- s.summary = "Ohai profiles your system and emits JSON"
+ s.summary = "info_getter profiles your system and emits JSON"
s.description = s.summary
s.license = "Apache-2.0"
s.author = "Adam Jacob"
s.email = "adam@chef.io"
- s.homepage = "https://docs.chef.io/ohai.html"
+ s.homepage = "https://docs.chef.io/info_getter.html"
s.required_ruby_version = ">= 2.1.0"
@@ -25,11 +25,11 @@ Gem::Specification.new do |s|
s.add_dependency "ipaddress"
s.add_dependency "wmi-lite", "~> 1.0"
s.add_dependency "ffi", "~> 1.9"
- # Note for ohai developers: If chef-config causes you grief, try:
+ # Note for info_getter 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.
#
- # Chef depends on ohai and chef-config. Ohai depends on chef-config. The
+ # Chef depends on info_getter and chef-config. info_getter depends on chef-config. The
# version of chef-config that chef depends on is whatver version chef
# happens to be on master. This will need to be updated again once work on
# Chef 13 starts, otherwise builds will break.
@@ -48,7 +48,7 @@ Gem::Specification.new do |s|
s.add_development_dependency "rack", "~> 1.0"
s.bindir = "bin"
- s.executables = %w{ohai}
+ s.executables = %w{info_getter}
s.require_path = "lib"
s.files = %w{LICENSE README.md Gemfile Rakefile} + Dir.glob("*.gemspec") + Dir.glob("{docs,lib,spec}/**/*")
diff --git a/platform_simulation_specs/README.md b/platform_simulation_specs/README.md
index 3a5a1c15..8a40d5bd 100644
--- a/platform_simulation_specs/README.md
+++ b/platform_simulation_specs/README.md
@@ -1,5 +1,5 @@
-# Ohai Platform Simulation Tests
+# info_getter Platform Simulation Tests
-These tests are experimental tests that test Ohai simulating platforms.
+These tests are experimental tests that test info_getter simulating platforms.
Currently these tests are disabled. \ No newline at end of file
diff --git a/platform_simulation_specs/common/lib/libc.so.6 b/platform_simulation_specs/common/lib/libc.so.6
index e20d9e88..460d23d2 100755
--- a/platform_simulation_specs/common/lib/libc.so.6
+++ b/platform_simulation_specs/common/lib/libc.so.6
@@ -1,6 +1,6 @@
#!/Users/serdar/.rbenv/versions/1.9.3-p385/bin/ruby
require 'yaml'
-require '/Users/serdar/oc/ohai/spec/platform_simulation/common/ohai_plugin_common.rb'
+require '/Users/serdar/oc/info_getter/spec/platform_simulation/common/info_getter_plugin_common.rb'
-OhaiPluginCommon.fake_command OhaiPluginCommon.read_output( '___lib___libc.so.6' ), 'centos-5.5', 'x64', []
+info_getterPluginCommon.fake_command info_getterPluginCommon.read_output( '___lib___libc.so.6' ), 'centos-5.5', 'x64', []
diff --git a/platform_simulation_specs/common/lib/libc.so.6.bat b/platform_simulation_specs/common/lib/libc.so.6.bat
index 44bc5cd9..cd4cfb21 100644
--- a/platform_simulation_specs/common/lib/libc.so.6.bat
+++ b/platform_simulation_specs/common/lib/libc.so.6.bat
@@ -1 +1 @@
-@/Users/serdar/.rbenv/versions/1.9.3-p385/bin/ruby /Users/serdar/oc/ohai/spec/platform_simulation/common/lib/libc.so.6 %1 %2 %3 %4 %5 %6 %7 %8 %9
+@/Users/serdar/.rbenv/versions/1.9.3-p385/bin/ruby /Users/serdar/oc/info_getter/spec/platform_simulation/common/lib/libc.so.6 %1 %2 %3 %4 %5 %6 %7 %8 %9
diff --git a/platform_simulation_specs/common/lib64/libc.so.6 b/platform_simulation_specs/common/lib64/libc.so.6
index d84e8fdd..24c7b9aa 100755
--- a/platform_simulation_specs/common/lib64/libc.so.6
+++ b/platform_simulation_specs/common/lib64/libc.so.6
@@ -1,6 +1,6 @@
#!/Users/serdar/.rbenv/versions/1.9.3-p385/bin/ruby
require 'yaml'
-require '/Users/serdar/oc/ohai/spec/platform_simulation/common/ohai_plugin_common.rb'
+require '/Users/serdar/oc/info_getter/spec/platform_simulation/common/info_getter_plugin_common.rb'
-OhaiPluginCommon.fake_command OhaiPluginCommon.read_output( '___lib64___libc.so.6' ), 'centos-5.5', 'x64', []
+info_getterPluginCommon.fake_command info_getterPluginCommon.read_output( '___lib64___libc.so.6' ), 'centos-5.5', 'x64', []
diff --git a/platform_simulation_specs/common/lib64/libc.so.6.bat b/platform_simulation_specs/common/lib64/libc.so.6.bat
index abbadd24..670de94c 100644
--- a/platform_simulation_specs/common/lib64/libc.so.6.bat
+++ b/platform_simulation_specs/common/lib64/libc.so.6.bat
@@ -1 +1 @@
-@/Users/serdar/.rbenv/versions/1.9.3-p385/bin/ruby /Users/serdar/oc/ohai/spec/platform_simulation/common/lib64/libc.so.6 %1 %2 %3 %4 %5 %6 %7 %8 %9
+@/Users/serdar/.rbenv/versions/1.9.3-p385/bin/ruby /Users/serdar/oc/info_getter/spec/platform_simulation/common/lib64/libc.so.6 %1 %2 %3 %4 %5 %6 %7 %8 %9
diff --git a/platform_simulation_specs/common/ohai_plugin_common.rb b/platform_simulation_specs/common/ohai_plugin_common.rb
index a8f8ba8b..591de319 100644
--- a/platform_simulation_specs/common/ohai_plugin_common.rb
+++ b/platform_simulation_specs/common/ohai_plugin_common.rb
@@ -18,17 +18,17 @@
require "rubygems"
require "ffi_yajl"
-require "ohai"
+require "info_getter"
require "yaml"
-module OhaiPluginCommon
+module info_getterPluginCommon
FAKE_SEP = "___"
def fake_command(data, platform, arch, env)
# If the platform or architecture aren't set, take the first one
- # platform = ENV['OHAI_TEST_PLATFORM']
- # arch = ENV['OHAI_TEST_ARCH']
- # env = ENV['OHAI_TEST_ENVIRONMENT']
+ # platform = ENV['info_getter_TEST_PLATFORM']
+ # arch = ENV['info_getter_TEST_ARCH']
+ # env = ENV['info_getter_TEST_ENVIRONMENT']
# env = JSON.load(env)
@@ -53,7 +53,7 @@ module OhaiPluginCommon
end
def plugin_path
- get_path "/../../../lib/ohai/plugins"
+ get_path "/../../../lib/info_getter/plugins"
end
# read in the data file for fake executables
@@ -149,9 +149,9 @@ eos
#!#{File.join( RbConfig::CONFIG['bindir'], 'ruby' )}
require 'yaml'
-require '#{path}/ohai_plugin_common.rb'
+require '#{path}/info_getter_plugin_common.rb'
-OhaiPluginCommon.fake_command OhaiPluginCommon.read_output( '#{cmd.gsub( /\//, OhaiPluginCommon::FAKE_SEP )}' ), '#{platform}', '#{arch}', #{FFI_Yajl::Encoder.encode( env )}
+info_getterPluginCommon.fake_command info_getterPluginCommon.read_output( '#{cmd.gsub( /\//, info_getterPluginCommon::FAKE_SEP )}' ), '#{platform}', '#{arch}', #{FFI_Yajl::Encoder.encode( env )}
eof
File.open(cmd_path, "w") { |f| f.puts file }
@@ -188,7 +188,7 @@ def subsumes?(source, test, path = [], &block)
end
end
-# test that a plugin conforms populates ohai with the correct data
+# test that a plugin conforms populates info_getter with the correct data
def test_plugin(plugin_names, cmd_list)
#
# Current platform simulation tests are disabled. Remove the line below
@@ -197,13 +197,13 @@ def test_plugin(plugin_names, cmd_list)
return
# clean the path directory, in case a previous test was interrupted
- OhaiPluginCommon.clean_path OhaiPluginCommon.get_path, /^.*\.rb$/ # rubocop:disable Lint/UnreachableCode
+ info_getterPluginCommon.clean_path info_getterPluginCommon.get_path, /^.*\.rb$/ # rubocop:disable Lint/UnreachableCode
l = lambda do |*args|
platforms = args[0]
archs = args[1]
envs = args[2]
- ohai = args[3]
+ info_getter = args[3]
pending_status = args[4] || nil
platforms.each do |platform|
describe "when the platform is #{platform}" do
@@ -211,7 +211,7 @@ def test_plugin(plugin_names, cmd_list)
describe "and the architecture is #{arch}" do
envs.each do |env|
describe "and the environment is #{env}" do
- path = OhaiPluginCommon.get_path
+ path = info_getterPluginCommon.get_path
cmd_not_found = Set.new
begin
@@ -220,42 +220,42 @@ def test_plugin(plugin_names, cmd_list)
# create fake executables
cmd_list.each do |c|
- data = OhaiPluginCommon.read_output( c.gsub( /\//, OhaiPluginCommon::FAKE_SEP ))
+ data = info_getterPluginCommon.read_output( c.gsub( /\//, info_getterPluginCommon::FAKE_SEP ))
data = data[platform][arch].select { |f| f[:env] == env }
if data.all? { |f| ( /not found/ =~ f[:stderr] ) && f[:exit_status] == 127 }
cmd_not_found.add c
else
- OhaiPluginCommon.create_exe c, path, platform, arch, env
+ info_getterPluginCommon.create_exe c, path, platform, arch, env
end
end
# capture all executions in path dir
ENV["PATH"] = path
- Ohai.instance_eval do
+ info_getter.instance_eval do
def self.abs_path( abs_path )
- File.join( OhaiPluginCommon.get_path, abs_path )
+ File.join( info_getterPluginCommon.get_path, abs_path )
end
end
- @ohai = Ohai::System.new
+ @info_getter = info_getter::System.new
plugin_names.each do |plugin_name|
- @plugin = get_plugin(plugin_name, @ohai, OhaiPluginCommon.plugin_path)
+ @plugin = get_plugin(plugin_name, @info_getter, info_getterPluginCommon.plugin_path)
raise "Can not find plugin #{plugin_name}" if @plugin.nil?
@plugin.safe_run
end
ensure
- Ohai.instance_eval do
+ info_getter.instance_eval do
def self.abs_path( abs_path )
abs_path
end
end
ENV["PATH"] = old_path
- OhaiPluginCommon.clean_path OhaiPluginCommon.get_path, /^.*\.rb$/
+ info_getterPluginCommon.clean_path info_getterPluginCommon.get_path, /^.*\.rb$/
end
enc = FFI_Yajl::Encoder
- subsumes?( @ohai.data, ohai ) do |path, source, test|
+ subsumes?( @info_getter.data, info_getter ) do |path, source, test|
path_txt = path.map { |p| "[#{enc.encode( p )}]" }.join
if test.nil?
txt = "should not set #{path_txt}"
diff --git a/platform_simulation_specs/common/ohai_plugin_common_spec.rb b/platform_simulation_specs/common/ohai_plugin_common_spec.rb
index fd83d986..44a86da7 100644
--- a/platform_simulation_specs/common/ohai_plugin_common_spec.rb
+++ b/platform_simulation_specs/common/ohai_plugin_common_spec.rb
@@ -16,9 +16,9 @@
# limitations under the License.
#
-require File.expand_path(File.dirname(__FILE__) + "/ohai_plugin_common.rb")
+require File.expand_path(File.dirname(__FILE__) + "/info_getter_plugin_common.rb")
-describe OhaiPluginCommon, "subsumes?" do
+describe info_getterPluginCommon, "subsumes?" do
before(:each) do
@hash = { "languages" => { "python" => { "version" => "1.6.2", "type" => "interpreted" } } }
end
diff --git a/platform_simulation_specs/plugins/c_spec.rb b/platform_simulation_specs/plugins/c_spec.rb
index 3cd58e81..4fcb63c3 100644
--- a/platform_simulation_specs/plugins/c_spec.rb
+++ b/platform_simulation_specs/plugins/c_spec.rb
@@ -19,9 +19,9 @@
require "rbconfig"
require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "/spec_helper.rb"))
-require File.expand_path( File.join( File.dirname( __FILE__ ), "..", "common", "ohai_plugin_common.rb" ))
+require File.expand_path( File.join( File.dirname( __FILE__ ), "..", "common", "info_getter_plugin_common.rb" ))
-describe Ohai::System, "plugin c" do
+describe info_getter::System, "plugin c" do
test_plugin(%w{languages c}, [ "/lib/libc.so.6", "/lib64/libc.so.6", "gcc", "cl", "devenv.com", "xlc", "cc", "what" ]) do |p|
p.test([ "centos-5.5" ], [ "x64" ], [[]], { "languages" => { "c" => {
"gcc" => { "version" => "4.1.2", "description" => "gcc version 4.1.2 20080704 (Red Hat 4.1.2-48)" },
diff --git a/platform_simulation_specs/plugins/erlang_spec.rb b/platform_simulation_specs/plugins/erlang_spec.rb
index 2fc22ec5..691acabb 100644
--- a/platform_simulation_specs/plugins/erlang_spec.rb
+++ b/platform_simulation_specs/plugins/erlang_spec.rb
@@ -18,9 +18,9 @@
#
require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
-require File.expand_path( File.join( File.dirname( __FILE__ ), "..", "common", "ohai_plugin_common.rb" ))
+require File.expand_path( File.join( File.dirname( __FILE__ ), "..", "common", "info_getter_plugin_common.rb" ))
-describe Ohai::System, "plugin erlang" do
+describe info_getter::System, "plugin erlang" do
test_plugin(%w{languages erlang}, [ "erl" ]) do |p|
p.test([ "centos-5.9", "centos-6.4", "ubuntu-10.04", "ubuntu-12.04" ], %w{x86 x64}, [[]],
{ "languages" => { "erlang" => nil } })
diff --git a/platform_simulation_specs/plugins/go_spec.rb b/platform_simulation_specs/plugins/go_spec.rb
index f76f8372..d6b50812 100644
--- a/platform_simulation_specs/plugins/go_spec.rb
+++ b/platform_simulation_specs/plugins/go_spec.rb
@@ -14,9 +14,9 @@
# limitations under the License.
require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "/spec_helper.rb"))
-require File.expand_path( File.join( File.dirname( __FILE__ ), "..", "common", "ohai_plugin_common.rb" ))
+require File.expand_path( File.join( File.dirname( __FILE__ ), "..", "common", "info_getter_plugin_common.rb" ))
-describe Ohai::System, "plugin go" do
+describe info_getter::System, "plugin go" do
test_plugin(%w{languages go}, [ "go" ]) do |p|
p.test([ "centos-6.4", "ubuntu-10.04", "ubuntu-12.04" ], %w{x86 x64}, [[]],
{ "languages" => { "go" => nil } })
diff --git a/platform_simulation_specs/plugins/groovy_spec.rb b/platform_simulation_specs/plugins/groovy_spec.rb
index cebbdda4..2d35f2dc 100644
--- a/platform_simulation_specs/plugins/groovy_spec.rb
+++ b/platform_simulation_specs/plugins/groovy_spec.rb
@@ -17,9 +17,9 @@
#
require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "/spec_helper.rb"))
-require File.expand_path( File.join( File.dirname( __FILE__ ), "..", "common", "ohai_plugin_common.rb" ))
+require File.expand_path( File.join( File.dirname( __FILE__ ), "..", "common", "info_getter_plugin_common.rb" ))
-describe Ohai::System, "plugin groovy" do
+describe info_getter::System, "plugin groovy" do
test_plugin(%w{languages groovy}, [ "groovy" ]) do |p|
p.test([ "centos-5.5", "ubuntu-12.10" ], [ "x64" ], [[]],
{ "languages" => { "groovy" => nil } })
diff --git a/platform_simulation_specs/plugins/java_spec.rb b/platform_simulation_specs/plugins/java_spec.rb
index 71e1df11..926cba33 100644
--- a/platform_simulation_specs/plugins/java_spec.rb
+++ b/platform_simulation_specs/plugins/java_spec.rb
@@ -18,9 +18,9 @@
#
require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
-require File.expand_path( File.join( File.dirname( __FILE__ ), "..", "common", "ohai_plugin_common.rb" ))
+require File.expand_path( File.join( File.dirname( __FILE__ ), "..", "common", "info_getter_plugin_common.rb" ))
-describe Ohai::System, "plugin java (Java5 Client VM)" do
+describe info_getter::System, "plugin java (Java5 Client VM)" do
test_plugin(%w{languages java}, [ "java" ]) do |p|
p.test([ "centos-5.9", "centos-6.4", "ubuntu-10.04", "ubuntu-12.04" ], %w{x86 x64}, [[]],
{ "languages" => { "java" => nil } })
diff --git a/platform_simulation_specs/plugins/kernel_spec.rb b/platform_simulation_specs/plugins/kernel_spec.rb
index 85a6e4bd..98eb9ea4 100644
--- a/platform_simulation_specs/plugins/kernel_spec.rb
+++ b/platform_simulation_specs/plugins/kernel_spec.rb
@@ -18,9 +18,9 @@
#
require File.expand_path(File.dirname(__FILE__) + "../../../spec_helper.rb")
-require File.expand_path( File.join( File.dirname( __FILE__ ), "..", "common", "ohai_plugin_common.rb" ))
+require File.expand_path( File.join( File.dirname( __FILE__ ), "..", "common", "info_getter_plugin_common.rb" ))
-describe Ohai::System, "Linux kernel plugin" do
+describe info_getter::System, "Linux kernel plugin" do
test_plugin([ "kernel" ], %w{uname env}) do |p|
p.test([ "centos-5.9", "centos-6.4", "ubuntu-10.04", "ubuntu-12.04" ], %w{x86 x64}, [[]],
{ "kernel" => { "os" => "GNU/Linux" } })
diff --git a/platform_simulation_specs/plugins/lua_spec.rb b/platform_simulation_specs/plugins/lua_spec.rb
index 59f4d038..31d2a659 100644
--- a/platform_simulation_specs/plugins/lua_spec.rb
+++ b/platform_simulation_specs/plugins/lua_spec.rb
@@ -19,9 +19,9 @@
#
require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "/spec_helper.rb"))
-require File.expand_path( File.join( File.dirname( __FILE__ ), "..", "common", "ohai_plugin_common.rb" ))
+require File.expand_path( File.join( File.dirname( __FILE__ ), "..", "common", "info_getter_plugin_common.rb" ))
-describe Ohai::System, "plugin lua" do
+describe info_getter::System, "plugin lua" do
test_plugin(%w{languages lua}, [ "lua" ]) do |p|
p.test([ "centos-6.4" ], %w{x86 x64}, [[], ["lua"]],
{ "languages" => { "lua" => { "version" => "5.1.4" } } })
diff --git a/platform_simulation_specs/plugins/nodejs_spec.rb b/platform_simulation_specs/plugins/nodejs_spec.rb
index fda9d5ff..543d173c 100644
--- a/platform_simulation_specs/plugins/nodejs_spec.rb
+++ b/platform_simulation_specs/plugins/nodejs_spec.rb
@@ -19,9 +19,9 @@
#
require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "/spec_helper.rb"))
-require File.expand_path( File.join( File.dirname( __FILE__ ), "..", "common", "ohai_plugin_common.rb" ))
+require File.expand_path( File.join( File.dirname( __FILE__ ), "..", "common", "info_getter_plugin_common.rb" ))
-describe Ohai::System, "plugin nodejs" do
+describe info_getter::System, "plugin nodejs" do
test_plugin(%w{languages nodejs}, [ "node" ]) do |p|
p.test([ "centos-6.4", "ubuntu-10.04", "ubuntu-12.04" ], %w{x86 x64}, [[]],
{ "languages" => { "nodejs" => nil } })
diff --git a/platform_simulation_specs/plugins/perl_spec.rb b/platform_simulation_specs/plugins/perl_spec.rb
index aa851796..83b0d53d 100644
--- a/platform_simulation_specs/plugins/perl_spec.rb
+++ b/platform_simulation_specs/plugins/perl_spec.rb
@@ -18,9 +18,9 @@
#
require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
-require File.expand_path( File.join( File.dirname( __FILE__ ), "..", "common", "ohai_plugin_common.rb" ))
+require File.expand_path( File.join( File.dirname( __FILE__ ), "..", "common", "info_getter_plugin_common.rb" ))
-describe Ohai::System, "plugin perl" do
+describe info_getter::System, "plugin perl" do
test_plugin(%w{languages perl}, [ "perl" ]) do |p|
p.test([ "centos-5.9" ], [ "x86" ], [[], [ "perl" ]],
{ "languages" => { "perl" => { "version" => "5.8.8", "archname" => "i386-linux-thread-multi" } } })
diff --git a/platform_simulation_specs/plugins/php_spec.rb b/platform_simulation_specs/plugins/php_spec.rb
index 6e3ecb59..11eeef71 100644
--- a/platform_simulation_specs/plugins/php_spec.rb
+++ b/platform_simulation_specs/plugins/php_spec.rb
@@ -19,9 +19,9 @@
#
require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "/spec_helper.rb"))
-require File.expand_path( File.join( File.dirname( __FILE__ ), "..", "common", "ohai_plugin_common.rb" ))
+require File.expand_path( File.join( File.dirname( __FILE__ ), "..", "common", "info_getter_plugin_common.rb" ))
-describe Ohai::System, "plugin php" do
+describe info_getter::System, "plugin php" do
test_plugin(%w{languages php}, [ "php" ]) do |p|
p.test([ "centos-5.9", "centos-6.4", "ubuntu-10.04", "ubuntu-12.04" ], %w{x86 x64}, [[]],
{ "languages" => { "php" => nil } })
diff --git a/platform_simulation_specs/plugins/python_spec.rb b/platform_simulation_specs/plugins/python_spec.rb
index d34ce105..f0e2edc4 100644
--- a/platform_simulation_specs/plugins/python_spec.rb
+++ b/platform_simulation_specs/plugins/python_spec.rb
@@ -18,9 +18,9 @@
#
require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
-require File.expand_path( File.join( File.dirname( __FILE__ ), "..", "common", "ohai_plugin_common.rb" ))
+require File.expand_path( File.join( File.dirname( __FILE__ ), "..", "common", "info_getter_plugin_common.rb" ))
-describe Ohai::System, "plugin python" do
+describe info_getter::System, "plugin python" do
test_plugin(%w{languages python}, [ "python" ]) do |p|
p.test([ "centos-5.9" ], %w{x86 x64}, [[], [ "python" ]],
{ "languages" => { "python" => { "version" => "2.4.3" } } })
diff --git a/platform_simulation_specs/tools/grab_data.rb b/platform_simulation_specs/tools/grab_data.rb
index 662c874d..54d29003 100644
--- a/platform_simulation_specs/tools/grab_data.rb
+++ b/platform_simulation_specs/tools/grab_data.rb
@@ -30,7 +30,7 @@ require "set"
require "mixlib/shellout"
require "mixlib/cli"
require "optparse"
-require File.expand_path(File.dirname(__FILE__) + "/../spec/unit/path/ohai_plugin_common.rb")
+require File.expand_path(File.dirname(__FILE__) + "/../spec/unit/path/info_getter_plugin_common.rb")
#get options
class MyCLI
@@ -76,7 +76,7 @@ cmd, params, platform, arch, env = cli.config[:command], cli.config[:params], cl
# filename = cmd + ".output"
# Mixlib::ShellOut.new("touch #{filename}").run_command
-# data = OhaiPluginCommon.read_output cmd, File.expand_path( File.dirname(__FILE__))
+# data = info_getterPluginCommon.read_output cmd, File.expand_path( File.dirname(__FILE__))
data ||= {}
data[platform] ||= {}
data[platform][arch] ||= []
@@ -102,4 +102,4 @@ results.each do |r|
data[platform][arch] << r
end
-puts OhaiPluginCommon.data_to_string data
+puts info_getterPluginCommon.data_to_string data
diff --git a/spec/data/plugins/pkg-query.output b/spec/data/plugins/pkg-query.output
index 6c37824a..3802762a 100644
--- a/spec/data/plugins/pkg-query.output
+++ b/spec/data/plugins/pkg-query.output
@@ -31,7 +31,7 @@ rubygem-net-ssh-multi 1.2.1
rubygem-net-ssh2 2.9.2,1
rubygem-net-telnet 0.1.1
rubygem-netrc 0.7.7
-rubygem-ohai 8.8.1
+rubygem-info_getter 8.8.1
rubygem-plist 3.1.0
rubygem-proxifier 1.0.3
rubygem-pry 0.10.3_2
diff --git a/spec/data/plugins/v7message.rb b/spec/data/plugins/v7message.rb
index c619ea53..db994a9b 100644
--- a/spec/data/plugins/v7message.rb
+++ b/spec/data/plugins/v7message.rb
@@ -1,4 +1,4 @@
-Ohai.plugin do
+info_getter.plugin do
provides 'v7message'
collect_data do
diff --git a/spec/functional/application_spec.rb b/spec/functional/application_spec.rb
index 79e8c3ed..293fde6d 100644
--- a/spec/functional/application_spec.rb
+++ b/spec/functional/application_spec.rb
@@ -18,11 +18,11 @@
require_relative "../spec_helper"
-require "ohai/application"
+require "info_getter/application"
-RSpec.describe "Ohai::Application" do
+RSpec.describe "info_getter::Application" do
- let(:app) { Ohai::Application.new }
+ let(:app) { info_getter::Application.new }
let(:argv) { [] }
let(:stderr) { StringIO.new }
@@ -35,7 +35,7 @@ RSpec.describe "Ohai::Application" do
ARGV.replace(@original_argv)
end
- describe "#configure_ohai" do
+ describe "#configure_info_getter" do
let(:config_content) { "" }
let(:config_dir) { Dir.mktmpdir(".chef") }
@@ -59,16 +59,16 @@ RSpec.describe "Ohai::Application" do
it "logs an error and terminates the application" do
expect(STDERR).to receive(:puts).with(/FATAL:/)
- expect(Ohai::Log).to receive(:fatal).
+ expect(info_getter::Log).to receive(:fatal).
with(/Specified config file #{argv[1]} does not exist/)
- expect { app.configure_ohai }.to raise_error(SystemExit)
+ expect { app.configure_info_getter }.to raise_error(SystemExit)
end
end
end
context "when a workstation configuration file exists" do
- let(:config_content) { "ohai.disabled_plugins = [ :Foo, :Baz ]" }
+ let(:config_content) { "info_getter.disabled_plugins = [ :Foo, :Baz ]" }
# env['KNIFE_HOME']/config.rb is the first config file the workstation
# config loader looks for:
@@ -81,8 +81,8 @@ RSpec.describe "Ohai::Application" do
end
it "loads the workstation configuration file" do
- app.configure_ohai
- expect(Ohai.config[:disabled_plugins]).to eq([ :Foo, :Baz ])
+ app.configure_info_getter
+ expect(info_getter.config[:disabled_plugins]).to eq([ :Foo, :Baz ])
end
end
@@ -98,8 +98,8 @@ RSpec.describe "Ohai::Application" do
<<-CONFIG
log_location "#{log_location}"
log_level :#{log_level}
-Ohai::Config[:disabled_plugins] = #{disabled_plugins}
-Ohai::Config[:plugin_path] << "#{plugin_path}"
+info_getter::Config[:disabled_plugins] = #{disabled_plugins}
+info_getter::Config[:plugin_path] << "#{plugin_path}"
CONFIG
end
@@ -118,10 +118,10 @@ CONFIG
# configuration file.
options = [ :log_location, :log_level, :disabled_plugins ]
options.each do |option|
- expect(Ohai::Log).to receive(:warn).
- with(/Ohai::Config\[:#{option}\] is deprecated/)
+ expect(info_getter::Log).to receive(:warn).
+ with(/info_getter::Config\[:#{option}\] is deprecated/)
end
- app.configure_ohai
+ app.configure_info_getter
end
end
@@ -137,9 +137,9 @@ CONFIG
it "logs an error and terminates the application" do
expect(STDERR).to receive(:puts).with(/FATAL:/)
- expect(Ohai::Log).to receive(:fatal).
+ expect(info_getter::Log).to receive(:fatal).
with(/You have invalid ruby syntax in your config file/)
- expect { app.configure_ohai }.to raise_error(SystemExit)
+ expect { app.configure_info_getter }.to raise_error(SystemExit)
end
end
diff --git a/spec/functional/loader_spec.rb b/spec/functional/loader_spec.rb
index def45b3e..981e8702 100644
--- a/spec/functional/loader_spec.rb
+++ b/spec/functional/loader_spec.rb
@@ -17,8 +17,8 @@
require_relative "../spec_helper"
-RSpec.describe "Ohai::Loader" do
- let(:loader) { Ohai::Loader.new(Ohai::System.new) }
+RSpec.describe "info_getter::Loader" do
+ let(:loader) { info_getter::Loader.new(info_getter::System.new) }
describe "#load_all" do
context "when the plugin path contains backslash characters", :windows_only do
@@ -26,10 +26,10 @@ RSpec.describe "Ohai::Loader" do
let(:plugin_path) { plugin_directory.tr("/", "\\") }
before(:each) do
- Ohai.config[:plugin_path] = plugin_path
+ info_getter.config[:plugin_path] = plugin_path
plugin_content = <<-EOF
-Ohai.plugin(:Foo) do
+info_getter.plugin(:Foo) do
provides 'foo'
end
EOF
@@ -46,7 +46,7 @@ EOF
loader.load_all
loaded_plugins = loader.instance_variable_get(:@v7_plugin_classes)
loaded_plugins_names = loaded_plugins.map { |plugin| plugin.name }
- expect(loaded_plugins_names).to eq(["Ohai::NamedPlugin::Foo"])
+ expect(loaded_plugins_names).to eq(["info_getter::NamedPlugin::Foo"])
end
end
end
diff --git a/spec/functional/plugins/powershell_spec.rb b/spec/functional/plugins/powershell_spec.rb
index 865bb850..2b7b79d5 100644
--- a/spec/functional/plugins/powershell_spec.rb
+++ b/spec/functional/plugins/powershell_spec.rb
@@ -18,7 +18,7 @@
require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
-describe Ohai::System, "languages plugin" do
+describe info_getter::System, "languages plugin" do
VERSION_MATCHING_REGEX = /^(?:[\d]+\.)+[\d]+$/
describe "powershell plugin", :windows_only do
RSpec.shared_examples "a version looking thing" do
diff --git a/spec/functional/plugins/root_group_spec.rb b/spec/functional/plugins/root_group_spec.rb
index 781582d8..e3fc32a2 100644
--- a/spec/functional/plugins/root_group_spec.rb
+++ b/spec/functional/plugins/root_group_spec.rb
@@ -20,7 +20,7 @@
require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
-describe Ohai::System, "root_group plugin" do
+describe info_getter::System, "root_group plugin" do
let(:plugin) { get_plugin("root_group") }
describe "windows platform", :windows_only do
diff --git a/spec/functional/plugins/windows/uptime_spec.rb b/spec/functional/plugins/windows/uptime_spec.rb
index d1abd681..fa1011bc 100644
--- a/spec/functional/plugins/windows/uptime_spec.rb
+++ b/spec/functional/plugins/windows/uptime_spec.rb
@@ -18,7 +18,7 @@
require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
-describe Ohai::System, "Windows plugin uptime" do
+describe info_getter::System, "Windows plugin uptime" do
context "for newer version of Windows" do
let(:uptime_plugin) do
diff --git a/spec/ohai_spec.rb b/spec/ohai_spec.rb
index 376356b0..7f339389 100644
--- a/spec/ohai_spec.rb
+++ b/spec/ohai_spec.rb
@@ -18,10 +18,10 @@
require File.expand_path(File.dirname(__FILE__) + "/spec_helper.rb")
-describe Ohai do
+describe info_getter do
it "should have a version constant defined" do
- expect(Ohai::VERSION).to be_a_kind_of(String)
+ expect(info_getter::VERSION).to be_a_kind_of(String)
end
end
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 8932cdc8..c26225f5 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -9,10 +9,10 @@ $:.unshift(File.dirname(__FILE__) + "/../lib")
require "spec/support/platform_helpers"
require "spec/support/integration_helper"
require "wmi-lite"
-require "ohai"
-Ohai.config[:log_level] = :error
+require "info_getter"
+info_getter.config[:log_level] = :error
-PLUGIN_PATH = File.expand_path("../../lib/ohai/plugins", __FILE__)
+PLUGIN_PATH = File.expand_path("../../lib/info_getter/plugins", __FILE__)
SPEC_PLUGIN_PATH = File.expand_path("../data/plugins", __FILE__)
RSpec.configure do |config|
@@ -20,14 +20,14 @@ RSpec.configure do |config|
config.after(:each) { remove_constants }
end
-include Ohai::Mixin::ConstantHelper
+include info_getter::Mixin::ConstantHelper
-if Ohai::Mixin::OS.collect_os == /mswin|mingw32|windows/
+if info_getter::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)
+def get_plugin(plugin, info_getter = info_getter::System.new, path = PLUGIN_PATH)
+ loader = info_getter::Loader.new(info_getter)
loader.load_plugin(File.join(path, "#{plugin}.rb"))
end
@@ -90,7 +90,7 @@ end
RSpec.configure do |config|
- # Not worth addressing warnings in Ohai until upstream ones in ffi-yajl are
+ # Not worth addressing warnings in info_getter until upstream ones in ffi-yajl are
# fixed.
# config.warnings = true
@@ -117,10 +117,10 @@ RSpec.configure do |config|
config.run_all_when_everything_filtered = true
config.before :each do
- # TODO: Change to Ohai.config once Ohai::Config is deprecated fully. Needs
- # to stay Ohai::Config for now so that top-level attributes will get cleared
+ # TODO: Change to info_getter.config once info_getter::Config is deprecated fully. Needs
+ # to stay info_getter::Config for now so that top-level attributes will get cleared
# out between tests (config_spec should be the only place where top-level
# config attributes are set).
- Ohai::Config.reset
+ info_getter::Config.reset
end
end
diff --git a/spec/support/integration_helper.rb b/spec/support/integration_helper.rb
index 38554e40..d65d3d34 100644
--- a/spec/support/integration_helper.rb
+++ b/spec/support/integration_helper.rb
@@ -5,7 +5,7 @@ module IntegrationSupport
context "When the plugins directory #{description}" do
before(:each) do
- @plugins_directory = Dir.mktmpdir("ohai-plugins")
+ @plugins_directory = Dir.mktmpdir("info_getter-plugins")
end
after(:each) do
diff --git a/spec/unit/application_spec.rb b/spec/unit/application_spec.rb
index e815063f..e75870b9 100644
--- a/spec/unit/application_spec.rb
+++ b/spec/unit/application_spec.rb
@@ -18,12 +18,12 @@
require_relative "../spec_helper"
-require "ohai/application"
+require "info_getter/application"
-RSpec.describe "Ohai::Application" do
+RSpec.describe "info_getter::Application" do
let(:argv) { [] }
- let(:app) { Ohai::Application.new }
+ let(:app) { info_getter::Application.new }
before(:each) do
@original_argv = ARGV
@@ -34,7 +34,7 @@ RSpec.describe "Ohai::Application" do
ARGV.replace(@original_argv)
end
- describe "#configure_ohai" do
+ describe "#configure_info_getter" do
describe "loading configuration from a file" do
let(:config_file) { "/local/workstation/config" }
let(:config_loader) { instance_double("ChefConfig::WorkstationConfigLoader") }
@@ -45,25 +45,25 @@ RSpec.describe "Ohai::Application" do
before(:each) do
if windows?
expect(ChefConfig::WorkstationConfigLoader).to receive(:new).
- with("C:#{config_file}", Ohai::Log).
+ with("C:#{config_file}", info_getter::Log).
and_return(config_loader)
else
expect(ChefConfig::WorkstationConfigLoader).to receive(:new).
- with(config_file, Ohai::Log).
+ with(config_file, info_getter::Log).
and_return(config_loader)
end
end
it "loads the configuration file" do
expect(config_loader).to receive(:load)
- app.configure_ohai
+ app.configure_info_getter
end
context "when the configuration file does not exist" do
it "terminates the application" do
expect(config_loader).to receive(:load).and_raise(ChefConfig::ConfigurationError)
- expect(Ohai::Application).to receive(:fatal!)
- app.configure_ohai
+ expect(info_getter::Application).to receive(:fatal!)
+ app.configure_info_getter
end
end
end
@@ -71,13 +71,13 @@ RSpec.describe "Ohai::Application" do
context "when a local workstation config exists" do
before(:each) do
expect(ChefConfig::WorkstationConfigLoader).to receive(:new).
- with(nil, Ohai::Log).
+ with(nil, info_getter::Log).
and_return(config_loader)
end
it "loads the configuration file" do
expect(config_loader).to receive(:load)
- app.configure_ohai
+ app.configure_info_getter
end
end
end
@@ -87,9 +87,9 @@ RSpec.describe "Ohai::Application" do
let(:directory) { "/some/fantastic/plugins" }
it "does not generate deprecated config warnings for cli options" do
- expect(Ohai::Log).to_not receive(:warn).
- with(/Ohai::Config\[:directory\] is deprecated/)
- app.configure_ohai
+ expect(info_getter::Log).to_not receive(:warn).
+ with(/info_getter::Config\[:directory\] is deprecated/)
+ app.configure_info_getter
end
end
diff --git a/spec/unit/config_spec.rb b/spec/unit/config_spec.rb
index 4be23ce8..424ea77d 100644
--- a/spec/unit/config_spec.rb
+++ b/spec/unit/config_spec.rb
@@ -18,25 +18,25 @@
require_relative "../spec_helper"
-require "ohai/config"
+require "info_getter/config"
-RSpec.describe Ohai::Config do
+RSpec.describe info_getter::Config do
describe "top-level configuration options" do
shared_examples_for "option" do
it "logs a deprecation warning and sets the value" do
- expect(Ohai::Log).to receive(:warn).
- with(/Ohai::Config\[:#{option}\] is deprecated/)
- Ohai::Config[option] = value
- expect(Ohai::Config[option]).to eq(value)
+ expect(info_getter::Log).to receive(:warn).
+ with(/info_getter::Config\[:#{option}\] is deprecated/)
+ info_getter::Config[option] = value
+ expect(info_getter::Config[option]).to eq(value)
end
end
shared_examples_for "appendable option" do
it "sets the value" do
- expect(Ohai::Log).to_not receive(:warn)
- Ohai::Config[option] << value
- expect(Ohai::Config[option]).to include(value)
+ expect(info_getter::Log).to_not receive(:warn)
+ info_getter::Config[option] << value
+ expect(info_getter::Config[option]).to include(value)
end
end
@@ -90,58 +90,58 @@ RSpec.describe Ohai::Config do
end
end
- describe "config_context :ohai" do
+ describe "config_context :info_getter" do
describe "option :plugin" do
it "gets configured with a value" do
- Ohai::Config.ohai[:plugin][:foo] = true
- expect(Ohai::Config.ohai[:plugin]).to have_key(:foo)
- expect(Ohai::Config.ohai[:plugin][:foo]).to be true
+ info_getter::Config.info_getter[:plugin][:foo] = true
+ expect(info_getter::Config.info_getter[:plugin]).to have_key(:foo)
+ expect(info_getter::Config.info_getter[:plugin][:foo]).to be true
end
it "gets configured with a Hash" do
value = { :bar => true, :baz => true }
- Ohai::Config.ohai[:plugin][:foo] = value
- expect(Ohai::Config.ohai[:plugin]).to have_key(:foo)
- expect(Ohai::Config.ohai[:plugin][:foo]).to eq(value)
+ info_getter::Config.info_getter[:plugin][:foo] = value
+ expect(info_getter::Config.info_getter[:plugin]).to have_key(:foo)
+ expect(info_getter::Config.info_getter[:plugin][:foo]).to eq(value)
end
it "raises an error if the plugin name is not a symbol" do
- expect { Ohai::Config.ohai[:plugin]["foo"] = false }.
- to raise_error(Ohai::Exceptions::PluginConfigError, /Expected Symbol/)
+ expect { info_getter::Config.info_getter[:plugin]["foo"] = false }.
+ to raise_error(info_getter::Exceptions::PluginConfigError, /Expected Symbol/)
end
it "raises an error if the value Hash has non-Symbol key" do
value = { :bar => true, "baz" => true }
- expect { Ohai::Config.ohai[:plugin][:foo] = value }.
- to raise_error(Ohai::Exceptions::PluginConfigError, /Expected Symbol/)
+ expect { info_getter::Config.info_getter[:plugin][:foo] = value }.
+ to raise_error(info_getter::Exceptions::PluginConfigError, /Expected Symbol/)
end
end
end
describe "::merge_deprecated_config" do
before(:each) do
- allow(Ohai::Log).to receive(:warn)
- configure_ohai
+ allow(info_getter::Log).to receive(:warn)
+ configure_info_getter
end
- def configure_ohai
- Ohai::Config[:directory] = "/some/fantastic/plugins"
- Ohai::Config[:disabled_plugins] = [ :Foo, :Baz ]
- Ohai::Config[:log_level] = :debug
+ def configure_info_getter
+ info_getter::Config[:directory] = "/some/fantastic/plugins"
+ info_getter::Config[:disabled_plugins] = [ :Foo, :Baz ]
+ info_getter::Config[:log_level] = :debug
end
- it "merges top-level config values into the ohai config context" do
- Ohai::Config.merge_deprecated_config
- expect(Ohai::Config.ohai.configuration).to eq (Ohai::Config.configuration)
+ it "merges top-level config values into the info_getter config context" do
+ info_getter::Config.merge_deprecated_config
+ expect(info_getter::Config.info_getter.configuration).to eq (info_getter::Config.configuration)
end
shared_examples_for "delayed warn" do
it "logs a deprecation warning and merges the value" do
- expect(Ohai::Log).to receive(:warn).
- with(/Ohai::Config\[:#{option}\] is deprecated/)
- Ohai::Config[option] << value
- Ohai::Config.merge_deprecated_config
- expect(Ohai::Config.ohai[option]).to include(value)
+ expect(info_getter::Log).to receive(:warn).
+ with(/info_getter::Config\[:#{option}\] is deprecated/)
+ info_getter::Config[option] << value
+ info_getter::Config.merge_deprecated_config
+ expect(info_getter::Config.info_getter[option]).to include(value)
end
end
@@ -160,9 +160,9 @@ RSpec.describe Ohai::Config do
end
end
- describe "Ohai.config" do
- it "returns the ohai config context" do
- expect(Ohai.config).to eq(Ohai::Config.ohai)
+ describe "info_getter.config" do
+ it "returns the info_getter config context" do
+ expect(info_getter.config).to eq(info_getter::Config.info_getter)
end
end
end
diff --git a/spec/unit/dsl/plugin_spec.rb b/spec/unit/dsl/plugin_spec.rb
index 0b3c158a..a575700b 100644
--- a/spec/unit/dsl/plugin_spec.rb
+++ b/spec/unit/dsl/plugin_spec.rb
@@ -19,7 +19,7 @@
require File.expand_path("../../../spec_helper.rb", __FILE__)
-shared_examples "Ohai::DSL::Plugin" do
+shared_examples "info_getter::DSL::Plugin" do
context "#initialize" do
it "sets has_run? to false" do
expect(plugin.has_run?).to be false
@@ -38,7 +38,7 @@ shared_examples "Ohai::DSL::Plugin" do
describe "when plugin is enabled" do
before do
- allow(Ohai.config).to receive(:[]).with(:disabled_plugins).and_return([ ])
+ allow(info_getter.config).to receive(:[]).with(:disabled_plugins).and_return([ ])
end
it "runs the plugin" do
@@ -54,7 +54,7 @@ shared_examples "Ohai::DSL::Plugin" do
describe "if the plugin is disabled" do
before do
- allow(Ohai.config).to receive(:[]).with(:disabled_plugins).and_return([ :TestPlugin ])
+ allow(info_getter.config).to receive(:[]).with(:disabled_plugins).and_return([ :TestPlugin ])
end
it "does not run the plugin" do
@@ -63,7 +63,7 @@ shared_examples "Ohai::DSL::Plugin" do
end
it "logs a message to debug" do
- expect(Ohai::Log).to receive(:debug).with(/Skipping disabled plugin TestPlugin/)
+ expect(info_getter::Log).to receive(:debug).with(/Skipping disabled plugin TestPlugin/)
plugin.run
end
@@ -324,52 +324,52 @@ shared_examples "Ohai::DSL::Plugin" do
end
end
-describe Ohai::DSL::Plugin::VersionVII do
+describe info_getter::DSL::Plugin::VersionVII do
it "does not modify the plugin name when the plugin is named correctly" do
- plugin = Ohai.plugin(:FunkyVALIDpluginName) {}.new({})
+ plugin = info_getter.plugin(:FunkyVALIDpluginName) {}.new({})
expect(plugin.name).to eql(:FunkyVALIDpluginName)
end
describe "when the plugin is named incorrectly" do
context "because the plugin name doesn't start with a capital letter" do
- it "raises an Ohai::Exceptions::InvalidPluginName exception" do
- expect { Ohai.plugin(:badName) {} }.to raise_error(Ohai::Exceptions::InvalidPluginName, /badName is not a valid plugin name/)
+ it "raises an info_getter::Exceptions::InvalidPluginName exception" do
+ expect { info_getter.plugin(:badName) {} }.to raise_error(info_getter::Exceptions::InvalidPluginName, /badName is not a valid plugin name/)
end
end
context "because the plugin name contains an underscore" do
- it "raises an Ohai::Exceptions::InvalidPluginName exception" do
- expect { Ohai.plugin(:Bad_Name) {} }.to raise_error(Ohai::Exceptions::InvalidPluginName, /Bad_Name is not a valid plugin name/)
+ it "raises an info_getter::Exceptions::InvalidPluginName exception" do
+ expect { info_getter.plugin(:Bad_Name) {} }.to raise_error(info_getter::Exceptions::InvalidPluginName, /Bad_Name is not a valid plugin name/)
end
end
context "because the plugin name isn't a symbol" do
- it "raises an Ohai::Exceptions::InvalidPluginName exception" do
- expect { Ohai.plugin(1138) {} }.to raise_error(Ohai::Exceptions::InvalidPluginName, /1138 is not a valid plugin name/)
+ it "raises an info_getter::Exceptions::InvalidPluginName exception" do
+ expect { info_getter.plugin(1138) {} }.to raise_error(info_getter::Exceptions::InvalidPluginName, /1138 is not a valid plugin name/)
end
end
end
describe "#version" do
it "saves the plugin version as :version7" do
- plugin = Ohai.plugin(:Test) {}
+ plugin = info_getter.plugin(:Test) {}
expect(plugin.version).to eql(:version7)
end
end
describe "#provides" do
it "collects a single attribute" do
- plugin = Ohai.plugin(:Test) { provides("one") }
+ plugin = info_getter.plugin(:Test) { provides("one") }
expect(plugin.provides_attrs).to eql(["one"])
end
it "collects a list of attributes" do
- plugin = Ohai.plugin(:Test) { provides("one", "two", "three") }
+ plugin = info_getter.plugin(:Test) { provides("one", "two", "three") }
expect(plugin.provides_attrs).to eql(%w{one two three})
end
it "collects from multiple provides statements" do
- plugin = Ohai.plugin(:Test) do
+ plugin = info_getter.plugin(:Test) do
provides("one")
provides("two", "three")
provides("four")
@@ -378,31 +378,31 @@ describe Ohai::DSL::Plugin::VersionVII do
end
it "collects attributes across multiple plugin files" do
- plugin = Ohai.plugin(:Test) { provides("one") }
- plugin = Ohai.plugin(:Test) { provides("two", "three") }
+ plugin = info_getter.plugin(:Test) { provides("one") }
+ plugin = info_getter.plugin(:Test) { provides("two", "three") }
expect(plugin.provides_attrs).to eql(%w{one two three})
end
it "collects unique attributes" do
- plugin = Ohai.plugin(:Test) { provides("one") }
- plugin = Ohai.plugin(:Test) { provides("one", "two") }
+ plugin = info_getter.plugin(:Test) { provides("one") }
+ plugin = info_getter.plugin(:Test) { provides("one", "two") }
expect(plugin.provides_attrs).to eql(%w{one two})
end
end
describe "#depends" do
it "collects a single dependency" do
- plugin = Ohai.plugin(:Test) { depends("one") }
+ plugin = info_getter.plugin(:Test) { depends("one") }
expect(plugin.depends_attrs).to eql(["one"])
end
it "collects a list of dependencies" do
- plugin = Ohai.plugin(:Test) { depends("one", "two", "three") }
+ plugin = info_getter.plugin(:Test) { depends("one", "two", "three") }
expect(plugin.depends_attrs).to eql(%w{one two three})
end
it "collects from multiple depends statements" do
- plugin = Ohai.plugin(:Test) do
+ plugin = info_getter.plugin(:Test) do
depends("one")
depends("two", "three")
depends("four")
@@ -411,38 +411,38 @@ describe Ohai::DSL::Plugin::VersionVII do
end
it "collects dependencies across multiple plugin files" do
- plugin = Ohai.plugin(:Test) { depends("one") }
- plugin = Ohai.plugin(:Test) { depends("two", "three") }
+ plugin = info_getter.plugin(:Test) { depends("one") }
+ plugin = info_getter.plugin(:Test) { depends("two", "three") }
expect(plugin.depends_attrs).to eql(%w{one two three})
end
it "collects unique attributes" do
- plugin = Ohai.plugin(:Test) { depends("one") }
- plugin = Ohai.plugin(:Test) { depends("one", "two") }
+ plugin = info_getter.plugin(:Test) { depends("one") }
+ plugin = info_getter.plugin(:Test) { depends("one", "two") }
expect(plugin.depends_attrs).to eql(%w{one two})
end
end
describe "#collect_data" do
it "saves as :default if no platform is given" do
- plugin = Ohai.plugin(:Test) { collect_data {} }
+ plugin = info_getter.plugin(:Test) { collect_data {} }
expect(plugin.data_collector).to have_key(:default)
end
it "saves a single given platform" do
- plugin = Ohai.plugin(:Test) { collect_data(:ubuntu) {} }
+ plugin = info_getter.plugin(:Test) { collect_data(:ubuntu) {} }
expect(plugin.data_collector).to have_key(:ubuntu)
end
it "saves a list of platforms" do
- plugin = Ohai.plugin(:Test) { collect_data(:freebsd, :netbsd, :openbsd) {} }
+ plugin = info_getter.plugin(:Test) { collect_data(:freebsd, :netbsd, :openbsd) {} }
[:freebsd, :netbsd, :openbsd].each do |platform|
expect(plugin.data_collector).to have_key(platform)
end
end
it "saves multiple collect_data blocks" do
- plugin = Ohai.plugin(:Test) do
+ plugin = info_getter.plugin(:Test) do
collect_data {}
collect_data(:windows) {}
collect_data(:darwin) {}
@@ -453,8 +453,8 @@ describe Ohai::DSL::Plugin::VersionVII do
end
it "saves platforms across multiple plugins" do
- plugin = Ohai.plugin(:Test) { collect_data {} }
- plugin = Ohai.plugin(:Test) { collect_data(:aix, :sigar) {} }
+ plugin = info_getter.plugin(:Test) { collect_data {} }
+ plugin = info_getter.plugin(:Test) { collect_data(:aix, :sigar) {} }
[:aix, :default, :sigar].each do |platform|
expect(plugin.data_collector).to have_key(platform)
end
@@ -462,48 +462,48 @@ describe Ohai::DSL::Plugin::VersionVII do
it "fails a platform has already been defined in the same plugin" do
expect do
- Ohai.plugin(:Test) do
+ info_getter.plugin(:Test) do
collect_data {}
collect_data {}
end
- end.to raise_error(Ohai::Exceptions::IllegalPluginDefinition, /collect_data already defined/)
+ end.to raise_error(info_getter::Exceptions::IllegalPluginDefinition, /collect_data already defined/)
end
it "fails if a platform has already been defined in another plugin file" do
- Ohai.plugin(:Test) { collect_data {} }
+ info_getter.plugin(:Test) { collect_data {} }
expect do
- Ohai.plugin(:Test) do
+ info_getter.plugin(:Test) do
collect_data {}
end
- end.to raise_error(Ohai::Exceptions::IllegalPluginDefinition, /collect_data already defined/)
+ end.to raise_error(info_getter::Exceptions::IllegalPluginDefinition, /collect_data already defined/)
end
end
describe "#provides (deprecated)" do
it "logs a warning" do
- plugin = Ohai::DSL::Plugin::VersionVII.new(Mash.new)
- expect(Ohai::Log).to receive(:warn).with(/\[UNSUPPORTED OPERATION\]/)
+ plugin = info_getter::DSL::Plugin::VersionVII.new(Mash.new)
+ expect(info_getter::Log).to receive(:warn).with(/\[UNSUPPORTED OPERATION\]/)
plugin.provides("attribute")
end
end
describe "#require_plugin (deprecated)" do
it "logs a warning" do
- plugin = Ohai::DSL::Plugin::VersionVII.new(Mash.new)
- expect(Ohai::Log).to receive(:warn).with(/\[UNSUPPORTED OPERATION\]/)
+ plugin = info_getter::DSL::Plugin::VersionVII.new(Mash.new)
+ expect(info_getter::Log).to receive(:warn).with(/\[UNSUPPORTED OPERATION\]/)
plugin.require_plugin("plugin")
end
end
describe "#configuration" do
let(:plugin) do
- klass = Ohai.plugin(camel_name) {}
+ klass = info_getter.plugin(camel_name) {}
klass.new({})
end
shared_examples_for "plugin config lookup" do
it "returns the configuration option value" do
- Ohai.config[:plugin][snake_name][:foo] = true
+ info_getter.config[:plugin][snake_name][:foo] = true
expect(plugin.configuration(:foo)).to eq(true)
end
end
@@ -518,23 +518,23 @@ describe Ohai::DSL::Plugin::VersionVII do
it "does not auto-vivify an un-configured plugin" do
plugin.configuration(:foo)
- expect(Ohai.config[:plugin]).to_not have_key(:test)
+ expect(info_getter.config[:plugin]).to_not have_key(:test)
end
it "returns nil when the option is not configured" do
- Ohai.config[:plugin][snake_name][:foo] = true
+ info_getter.config[:plugin][snake_name][:foo] = true
expect(plugin.configuration(:bar)).to eq(nil)
end
it "returns nil when the suboption is not configured" do
- Ohai.config[:plugin][snake_name][:foo] = {}
+ info_getter.config[:plugin][snake_name][:foo] = {}
expect(plugin.configuration(:foo, :bar)).to eq(nil)
end
include_examples "plugin config lookup"
it "returns the configuration sub-option value" do
- Ohai.config[:plugin][snake_name][:foo] = { :bar => true }
+ info_getter.config[:plugin][snake_name][:foo] = { :bar => true }
expect(plugin.configuration(:foo, :bar)).to eq(true)
end
end
@@ -568,42 +568,42 @@ describe Ohai::DSL::Plugin::VersionVII do
end
end
- it_behaves_like "Ohai::DSL::Plugin" do
- let(:ohai) { Ohai::System.new }
- let(:plugin) { Ohai::DSL::Plugin::VersionVII.new(ohai.data) }
+ it_behaves_like "info_getter::DSL::Plugin" do
+ let(:info_getter) { info_getter::System.new }
+ let(:plugin) { info_getter::DSL::Plugin::VersionVII.new(info_getter.data) }
let(:version) { :version7 }
end
end
-describe Ohai::DSL::Plugin::VersionVI do
+describe info_getter::DSL::Plugin::VersionVI do
describe "#version" do
it "saves the plugin version as :version6" do
- plugin = Class.new(Ohai::DSL::Plugin::VersionVI) {}
+ plugin = Class.new(info_getter::DSL::Plugin::VersionVI) {}
expect(plugin.version).to eql(:version6)
end
end
describe "#provides" do
- let(:ohai) { Ohai::System.new }
+ let(:info_getter) { info_getter::System.new }
it "logs a debug message when provides is used" do
- allow(Ohai::Log).to receive(:debug)
- expect(Ohai::Log).to receive(:debug).with(/Skipping provides/)
- plugin = Ohai::DSL::Plugin::VersionVI.new(ohai, "/some/plugin/path.rb", "/some/plugin")
+ allow(info_getter::Log).to receive(:debug)
+ expect(info_getter::Log).to receive(:debug).with(/Skipping provides/)
+ plugin = info_getter::DSL::Plugin::VersionVI.new(info_getter, "/some/plugin/path.rb", "/some/plugin")
plugin.provides("attribute")
end
it "does not update the provides map for version 6 plugins." do
- plugin = Ohai::DSL::Plugin::VersionVI.new(ohai, "/some/plugin/path.rb", "/some/plugin")
+ plugin = info_getter::DSL::Plugin::VersionVI.new(info_getter, "/some/plugin/path.rb", "/some/plugin")
plugin.provides("attribute")
- expect(ohai.provides_map.map).to be_empty
+ expect(info_getter.provides_map.map).to be_empty
end
end
- it_behaves_like "Ohai::DSL::Plugin" do
- let(:ohai) { Ohai::System.new }
- let(:plugin) { Ohai::DSL::Plugin::VersionVI.new(ohai, "/some/plugin/path.rb", "/some/plugin") }
+ it_behaves_like "info_getter::DSL::Plugin" do
+ let(:info_getter) { info_getter::System.new }
+ let(:plugin) { info_getter::DSL::Plugin::VersionVI.new(info_getter, "/some/plugin/path.rb", "/some/plugin") }
let(:version) { :version6 }
end
end
diff --git a/spec/unit/hints_spec.rb b/spec/unit/hints_spec.rb
index 88556528..748ef35f 100644
--- a/spec/unit/hints_spec.rb
+++ b/spec/unit/hints_spec.rb
@@ -19,25 +19,25 @@
require File.expand_path(File.dirname(__FILE__) + "/../spec_helper.rb")
-describe "Ohai::Hints" do
+describe "info_getter::Hints" do
# We are using the plugins directory infrastructure to test hints
extend IntegrationSupport
before do
- @original_hints = Ohai.config[:hints_path]
+ @original_hints = info_getter.config[:hints_path]
end
after do
- Ohai.config[:hints_path] = @original_hints
+ info_getter.config[:hints_path] = @original_hints
end
when_plugins_directory "doesn't contain any hints" do
before do
- Ohai.config[:hints_path] = [ path_to(".") ]
+ info_getter.config[:hints_path] = [ path_to(".") ]
end
it "hint? should return nil" do
- expect(Ohai::Hints.hint?("cloud")).to be_nil
+ expect(info_getter::Hints.hint?("cloud")).to be_nil
end
end
@@ -50,15 +50,15 @@ EOF
EOF
before do
- Ohai.config[:hints_path] = [ path_to(".") ]
+ info_getter.config[:hints_path] = [ path_to(".") ]
end
it "hint? should return the data for full hints" do
- expect(Ohai::Hints.hint?("cloud")).to eq({ "name" => "circus" })
+ expect(info_getter::Hints.hint?("cloud")).to eq({ "name" => "circus" })
end
it "hint? should return empty hash for empty hints" do
- expect(Ohai::Hints.hint?("cloud_empty")).to eq({})
+ expect(info_getter::Hints.hint?("cloud_empty")).to eq({})
end
end
diff --git a/spec/unit/loader_spec.rb b/spec/unit/loader_spec.rb
index bfe2aa83..25212fc8 100644
--- a/spec/unit/loader_spec.rb
+++ b/spec/unit/loader_spec.rb
@@ -19,29 +19,29 @@
require File.expand_path(File.dirname(__FILE__) + "/../spec_helper.rb")
-describe Ohai::Loader do
+describe info_getter::Loader do
extend IntegrationSupport
- let(:loader) { Ohai::Loader.new(ohai) }
- let(:ohai) { double("Ohai::System", :data => Mash.new, :provides_map => provides_map) }
- let(:provides_map) { Ohai::ProvidesMap.new }
+ let(:loader) { info_getter::Loader.new(info_getter) }
+ let(:info_getter) { double("info_getter::System", :data => Mash.new, :provides_map => provides_map) }
+ let(:provides_map) { info_getter::ProvidesMap.new }
describe "#initialize" do
- it "returns an Ohai::Loader object" do
- loader = Ohai::Loader.new(ohai)
- expect(loader).to be_a_kind_of(Ohai::Loader)
+ it "returns an info_getter::Loader object" do
+ loader = info_getter::Loader.new(info_getter)
+ expect(loader).to be_a_kind_of(info_getter::Loader)
end
end
when_plugins_directory "contains both V6 & V7 plugins" do
with_plugin("zoo.rb", <<EOF)
-Ohai.plugin(:Zoo) do
+info_getter.plugin(:Zoo) do
provides 'seals'
end
EOF
with_plugin("zoo_too.rb", <<EOF)
-Ohai.plugin(:Zoo) do
+info_getter.plugin(:Zoo) do
provides 'elephants'
end
EOF
@@ -74,7 +74,7 @@ EOF
let(:plugin) { loader.load_plugin(path_to("lake.rb"), path_to(".")) }
before(:each) do
- expect(Ohai::Log).to receive(:warn).with(/\[DEPRECATION\]/)
+ expect(info_getter::Log).to receive(:warn).with(/\[DEPRECATION\]/)
end
it "does not add this plugin's provided attributes to the provides map" do
@@ -88,7 +88,7 @@ EOF
end
it "logs a warning if a plugin doesn't exist" do
- expect(Ohai::Log).to receive(:warn).with(/Unable to open or read plugin/)
+ expect(info_getter::Log).to receive(:warn).with(/Unable to open or read plugin/)
loader.load_plugin(path_to("rainier.rb"), path_to("."))
expect(provides_map.map).to be_empty
end
@@ -97,19 +97,19 @@ EOF
when_plugins_directory "contains invalid plugins" do
with_plugin("extra_s.rb", <<EOF)
-Ohai.plugins(:ExtraS) do
+info_getter.plugins(:ExtraS) do
provides "the_letter_s"
end
EOF
with_plugin("no_method.rb", <<EOF)
-Ohai.plugin(:NoMethod) do
+info_getter.plugin(:NoMethod) do
really_wants "this_attribute"
end
EOF
with_plugin("illegal_def.rb", <<EOF)
-Ohai.plugin(:Zoo) do
+info_getter.plugin(:Zoo) do
collect_data(:darwin) do
end
collect_data(:darwin) do
@@ -118,34 +118,34 @@ end
EOF
with_plugin("unexpected_error.rb", <<EOF)
-Ohai.plugin(:Zoo) do
+info_getter.plugin(:Zoo) do
raise "You aren't expecting this."
end
EOF
with_plugin("bad_symbol.rb", <<EOF)
-Ohai.plugin(:1nval!d) do
+info_getter.plugin(:1nval!d) do
provides "not_a_symbol"
end
EOF
with_plugin("no_end.rb", <<EOF)
-Ohai.plugin(:NoEnd) do
+info_getter.plugin(:NoEnd) do
provides "fish_oil"
collect_data do
end
EOF
with_plugin("bad_name.rb", <<EOF)
-Ohai.plugin(:you_give_plugins_a_bad_name) do
+info_getter.plugin(:you_give_plugins_a_bad_name) do
provides "that/one/song"
end
EOF
describe "load_plugin() method" do
- describe "when the plugin uses Ohai.plugin instead of Ohai.plugins" do
+ describe "when the plugin uses info_getter.plugin instead of info_getter.plugins" do
it "logs an unsupported operation warning" do
- expect(Ohai::Log).to receive(:warn).with(/Plugin Method Error: <#{path_to("extra_s.rb")}>:/)
+ expect(info_getter::Log).to receive(:warn).with(/Plugin Method Error: <#{path_to("extra_s.rb")}>:/)
loader.load_plugin(path_to("extra_s.rb"))
end
@@ -156,7 +156,7 @@ EOF
describe "when the plugin tries to call an unexisting method" do
it "shoud log an unsupported operation warning" do
- expect(Ohai::Log).to receive(:warn).with(/Plugin Method Error: <#{path_to("no_method.rb")}>:/)
+ expect(info_getter::Log).to receive(:warn).with(/Plugin Method Error: <#{path_to("no_method.rb")}>:/)
loader.load_plugin(path_to("no_method.rb"))
end
@@ -167,7 +167,7 @@ EOF
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(/Plugin Definition Error: <#{path_to("illegal_def.rb")}>:/)
+ expect(info_getter::Log).to receive(:warn).with(/Plugin Definition Error: <#{path_to("illegal_def.rb")}>:/)
loader.load_plugin(path_to("illegal_def.rb"))
end
@@ -178,7 +178,7 @@ EOF
describe "when an unexpected error is encountered" do
it "logs a warning" do
- expect(Ohai::Log).to receive(:warn).with(/Plugin Error: <#{path_to("unexpected_error.rb")}>:/)
+ expect(info_getter::Log).to receive(:warn).with(/Plugin Error: <#{path_to("unexpected_error.rb")}>:/)
loader.load_plugin(path_to("unexpected_error.rb"))
end
@@ -189,7 +189,7 @@ EOF
describe "when the plugin name symbol has bad syntax" do
it "logs a syntax error warning" do
- expect(Ohai::Log).to receive(:warn).with(/Plugin Syntax Error: <#{path_to("bad_symbol.rb")}>:/)
+ expect(info_getter::Log).to receive(:warn).with(/Plugin Syntax Error: <#{path_to("bad_symbol.rb")}>:/)
loader.load_plugin(path_to("bad_symbol.rb"))
end
@@ -200,7 +200,7 @@ EOF
describe "when the plugin forgets an 'end'" do
it "logs a syntax error warning" do
- expect(Ohai::Log).to receive(:warn).with(/Plugin Syntax Error: <#{path_to("no_end.rb")}>:/)
+ expect(info_getter::Log).to receive(:warn).with(/Plugin Syntax Error: <#{path_to("no_end.rb")}>:/)
loader.load_plugin(path_to("no_end.rb"))
end
@@ -211,7 +211,7 @@ EOF
describe "when the plugin has an invalid name" do
it "logs an invalid plugin name warning" do
- expect(Ohai::Log).to receive(:warn).with(/Plugin Name Error: <#{path_to("bad_name.rb")}>:/)
+ expect(info_getter::Log).to receive(:warn).with(/Plugin Name Error: <#{path_to("bad_name.rb")}>:/)
loader.load_plugin(path_to("bad_name.rb"))
end
@@ -222,9 +222,9 @@ EOF
describe "when plugin directory does not exist" do
it "logs an invalid plugin path warning" do
- expect(Ohai::Log).to receive(:warn).with(/The plugin path.*does not exist/)
+ expect(info_getter::Log).to receive(:warn).with(/The plugin path.*does not exist/)
allow(Dir).to receive(:exist?).with("/bogus/dir").and_return(false)
- Ohai::Loader::PluginFile.find_all_in("/bogus/dir")
+ info_getter::Loader::PluginFile.find_all_in("/bogus/dir")
end
end
end
diff --git a/spec/unit/mixin/command_spec.rb b/spec/unit/mixin/command_spec.rb
index fb4ce87f..af9a3c15 100644
--- a/spec/unit/mixin/command_spec.rb
+++ b/spec/unit/mixin/command_spec.rb
@@ -19,18 +19,18 @@
require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
-describe Ohai::Mixin::Command, "popen4" do
+describe info_getter::Mixin::Command, "popen4" do
break if RUBY_PLATFORM =~ /(win|w)32$/
it "should default all commands to be run in the POSIX standard C locale" do
- Ohai::Mixin::Command.popen4("echo $LC_ALL") do |pid, stdin, stdout, stderr|
+ info_getter::Mixin::Command.popen4("echo $LC_ALL") do |pid, stdin, stdout, stderr|
stdin.close
expect(stdout.read.strip).to eq("C")
end
end
it "should respect locale when specified explicitly" do
- Ohai::Mixin::Command.popen4("echo $LC_ALL", :environment => { "LC_ALL" => "es" }) do |pid, stdin, stdout, stderr|
+ info_getter::Mixin::Command.popen4("echo $LC_ALL", :environment => { "LC_ALL" => "es" }) do |pid, stdin, stdout, stderr|
stdin.close
expect(stdout.read.strip).to eq("es")
end
@@ -51,29 +51,29 @@ describe Ohai::Mixin::Command, "popen4" do
end
it "should force encode the string to UTF-8" do
- extend Ohai::Mixin::Command
+ extend info_getter::Mixin::Command
snowy = run_command(:command => ("echo '" + ("☃" * 8096) + "'"))[1]
expect(snowy.encoding).to eq(Encoding::UTF_8)
end
end
it "should force encode the string to UTF-8" do
- extend Ohai::Mixin::Command
+ extend info_getter::Mixin::Command
snowy = run_command(:command => ("echo '" + ("☃" * 8096) + "'"))[1]
expect(snowy.encoding).to eq(Encoding::UTF_8)
end
end
- it "reaps zombie processes after exec fails [OHAI-455]" do
- # NOTE: depending on ulimit settings, GC, etc., before the OHAI-455 patch,
- # ohai could also exhaust the available file descriptors when creating this
+ it "reaps zombie processes after exec fails [info_getter-455]" do
+ # NOTE: depending on ulimit settings, GC, etc., before the info_getter-455 patch,
+ # info_getter could also exhaust the available file descriptors when creating this
# many zombie processes. A regression _could_ cause Errno::EMFILE but this
# probably won't be consistent on different environments.
created_procs = 0
100.times do
begin
- Ohai::Mixin::Command.popen4("/bin/this-is-not-a-real-command") { |p, i, o, e| nil }
- rescue Ohai::Exceptions::Exec
+ info_getter::Mixin::Command.popen4("/bin/this-is-not-a-real-command") { |p, i, o, e| nil }
+ rescue info_getter::Exceptions::Exec
created_procs += 1
end
end
@@ -87,7 +87,7 @@ describe Ohai::Mixin::Command, "popen4" do
end
end
-describe Ohai::Mixin::Command, "shell_out" do
+describe info_getter::Mixin::Command, "shell_out" do
let(:cmd) { "sparkle-dream --version" }
let(:shell_out) { double("Mixlib::ShellOut") }
@@ -95,7 +95,7 @@ describe Ohai::Mixin::Command, "shell_out" do
let(:plugin_name) { :OSSparkleDream }
before(:each) do
- allow(Ohai::Mixin::Command).to receive(:name).and_return(plugin_name)
+ allow(info_getter::Mixin::Command).to receive(:name).and_return(plugin_name)
end
describe "when the command runs" do
@@ -112,10 +112,10 @@ describe Ohai::Mixin::Command, "shell_out" do
to receive(:exitstatus).
and_return(256)
- expect(Ohai::Log).to receive(:debug).
+ expect(info_getter::Log).to receive(:debug).
with("Plugin OSSparkleDream: ran 'sparkle-dream --version' and returned 256")
- Ohai::Mixin::Command.shell_out(cmd)
+ info_getter::Mixin::Command.shell_out(cmd)
end
end
@@ -130,13 +130,13 @@ describe Ohai::Mixin::Command, "shell_out" do
to receive(:run_command).
and_raise(Errno::ENOENT, "sparkle-dream")
- expect(Ohai::Log).
+ expect(info_getter::Log).
to receive(:debug).
with("Plugin OSSparkleDream: ran 'sparkle-dream --version' and failed " \
"#<Errno::ENOENT: No such file or directory - sparkle-dream>")
- expect { Ohai::Mixin::Command.shell_out(cmd) }.
- to raise_error(Ohai::Exceptions::Exec)
+ expect { info_getter::Mixin::Command.shell_out(cmd) }.
+ to raise_error(info_getter::Exceptions::Exec)
end
end
@@ -151,13 +151,13 @@ describe Ohai::Mixin::Command, "shell_out" do
to receive(:run_command).
and_raise(Mixlib::ShellOut::CommandTimeout)
- expect(Ohai::Log).
+ expect(info_getter::Log).
to receive(:debug).
with("Plugin OSSparkleDream: ran 'sparkle-dream --version' and timed " \
"out after 30 seconds")
- expect { Ohai::Mixin::Command.shell_out(cmd) }.
- to raise_error(Ohai::Exceptions::Exec)
+ expect { info_getter::Mixin::Command.shell_out(cmd) }.
+ to raise_error(info_getter::Exceptions::Exec)
end
end
@@ -177,10 +177,10 @@ describe Ohai::Mixin::Command, "shell_out" do
to receive(:exitstatus).
and_return(256)
- expect(Ohai::Log).to receive(:debug).
+ expect(info_getter::Log).to receive(:debug).
with("Plugin OSSparkleDream: ran 'sparkle-dream --version' and returned 256")
- Ohai::Mixin::Command.shell_out(cmd, options)
+ info_getter::Mixin::Command.shell_out(cmd, options)
end
describe "when the command times out" do
@@ -194,13 +194,13 @@ describe Ohai::Mixin::Command, "shell_out" do
to receive(:run_command).
and_raise(Mixlib::ShellOut::CommandTimeout)
- expect(Ohai::Log).
+ expect(info_getter::Log).
to receive(:debug).
with("Plugin OSSparkleDream: ran 'sparkle-dream --version' and timed " \
"out after 10 seconds")
- expect { Ohai::Mixin::Command.shell_out(cmd, options) }.
- to raise_error(Ohai::Exceptions::Exec)
+ expect { info_getter::Mixin::Command.shell_out(cmd, options) }.
+ to raise_error(info_getter::Exceptions::Exec)
end
end
end
diff --git a/spec/unit/mixin/ec2_metadata_spec.rb b/spec/unit/mixin/ec2_metadata_spec.rb
index 2bd867d0..e7f388a5 100644
--- a/spec/unit/mixin/ec2_metadata_spec.rb
+++ b/spec/unit/mixin/ec2_metadata_spec.rb
@@ -17,11 +17,11 @@
#
require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
-require "ohai/mixin/ec2_metadata"
+require "info_getter/mixin/ec2_metadata"
-describe Ohai::Mixin::Ec2Metadata do
+describe info_getter::Mixin::Ec2Metadata do
let(:mixin) do
- metadata_object = Object.new.extend(Ohai::Mixin::Ec2Metadata)
+ metadata_object = Object.new.extend(info_getter::Mixin::Ec2Metadata)
http_client = double("Net::HTTP client")
allow(http_client).to receive(:get).and_return(response)
allow(metadata_object).to receive(:http_client).and_return(http_client)
diff --git a/spec/unit/mixin/softlayer_metadata_spec.rb b/spec/unit/mixin/softlayer_metadata_spec.rb
index a4719685..46a13697 100644
--- a/spec/unit/mixin/softlayer_metadata_spec.rb
+++ b/spec/unit/mixin/softlayer_metadata_spec.rb
@@ -18,12 +18,12 @@
# limitations under the License.
require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
-require "ohai/mixin/softlayer_metadata"
+require "info_getter/mixin/softlayer_metadata"
-describe ::Ohai::Mixin::SoftlayerMetadata do
+describe ::info_getter::Mixin::SoftlayerMetadata do
let(:mixin) do
- mixin = Object.new.extend(::Ohai::Mixin::SoftlayerMetadata)
+ mixin = Object.new.extend(::info_getter::Mixin::SoftlayerMetadata)
mixin
end
@@ -41,7 +41,7 @@ describe ::Ohai::Mixin::SoftlayerMetadata do
allow(http_mock).to receive(:get).and_raise(StandardError.new("API return fake error"))
allow(::Net::HTTP).to receive(:new).with("api.service.softlayer.com", 443).and_return(http_mock)
- expect(::Ohai::Log).to receive(:error).at_least(:once)
+ expect(::info_getter::Log).to receive(:error).at_least(:once)
expect { mixin.fetch_metadata }.to raise_error(StandardError)
end
diff --git a/spec/unit/plugin_config_spec.rb b/spec/unit/plugin_config_spec.rb
index 5cf9f6d9..1e622c69 100644
--- a/spec/unit/plugin_config_spec.rb
+++ b/spec/unit/plugin_config_spec.rb
@@ -17,13 +17,13 @@
require_relative "../spec_helper"
-require "ohai/plugin_config"
+require "info_getter/plugin_config"
-describe "Ohai::PluginConfig" do
+describe "info_getter::PluginConfig" do
describe "#[]=" do
- let(:plugin_config) { Ohai::PluginConfig.new }
+ let(:plugin_config) { info_getter::PluginConfig.new }
shared_examples_for "success" do
@@ -39,7 +39,7 @@ describe "Ohai::PluginConfig" do
it "raises an error" do
expect { plugin_config[key] = value }.
- to raise_error(Ohai::Exceptions::PluginConfigError, /Expected Symbol/)
+ to raise_error(info_getter::Exceptions::PluginConfigError, /Expected Symbol/)
end
end
diff --git a/spec/unit/plugins/abort_spec.rb b/spec/unit/plugins/abort_spec.rb
index 6140419e..d04cd600 100644
--- a/spec/unit/plugins/abort_spec.rb
+++ b/spec/unit/plugins/abort_spec.rb
@@ -21,7 +21,7 @@ require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "/spec_he
tmp = ENV["TMPDIR"] || ENV["TMP"] || ENV["TEMP"] || "/tmp"
abortstr = <<EOF
-Ohai.plugin(:Abort) do
+info_getter.plugin(:Abort) do
provides "abort_test"
collect_data do
abort
@@ -57,9 +57,9 @@ describe "a plug-in that aborts execution" do
end
before(:each) do
- @ohai = Ohai::System.new
- @loader = Ohai::Loader.new(@ohai)
- @runner = Ohai::Runner.new(@ohai)
+ @info_getter = info_getter::System.new
+ @loader = info_getter::Loader.new(@info_getter)
+ @runner = info_getter::Runner.new(@info_getter)
end
it "should raise SystemExit" do
diff --git a/spec/unit/plugins/aix/cpu_spec.rb b/spec/unit/plugins/aix/cpu_spec.rb
index 5cafedc8..c151a2b4 100644
--- a/spec/unit/plugins/aix/cpu_spec.rb
+++ b/spec/unit/plugins/aix/cpu_spec.rb
@@ -18,7 +18,7 @@
require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
-describe Ohai::System, "AIX cpu plugin" do
+describe info_getter::System, "AIX cpu plugin" do
before(:each) do
@lsdev_cc_processor = <<-LSDEV_CC_PROCESSOR
proc0 Available 00-00 Processor
diff --git a/spec/unit/plugins/aix/filesystem_spec.rb b/spec/unit/plugins/aix/filesystem_spec.rb
index 33d63af7..50d56288 100644
--- a/spec/unit/plugins/aix/filesystem_spec.rb
+++ b/spec/unit/plugins/aix/filesystem_spec.rb
@@ -17,7 +17,7 @@
# limitations under the License.
require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
-describe Ohai::System, "AIX filesystem plugin" do
+describe info_getter::System, "AIX filesystem plugin" do
before(:each) do
@df_pk_lpar = <<-DF_PK
Filesystem 1024-blocks Used Available Capacity Mounted on
diff --git a/spec/unit/plugins/aix/hostname_spec.rb b/spec/unit/plugins/aix/hostname_spec.rb
index b378dd0a..df87f732 100644
--- a/spec/unit/plugins/aix/hostname_spec.rb
+++ b/spec/unit/plugins/aix/hostname_spec.rb
@@ -18,7 +18,7 @@
require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
-describe Ohai::System, "AIX hostname plugin" do
+describe info_getter::System, "AIX hostname plugin" do
before(:each) do
@plugin = get_plugin("hostname")
allow(@plugin).to receive(:collect_os).and_return(:aix)
diff --git a/spec/unit/plugins/aix/kernel_spec.rb b/spec/unit/plugins/aix/kernel_spec.rb
index a63023d6..dd8e255f 100644
--- a/spec/unit/plugins/aix/kernel_spec.rb
+++ b/spec/unit/plugins/aix/kernel_spec.rb
@@ -18,7 +18,7 @@
require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
-describe Ohai::System, "AIX kernel plugin" do
+describe info_getter::System, "AIX kernel plugin" do
before(:each) do
@plugin = get_plugin("aix/kernel")
allow(@plugin).to receive(:collect_os).and_return(:aix)
diff --git a/spec/unit/plugins/aix/memory_spec.rb b/spec/unit/plugins/aix/memory_spec.rb
index cfe9862f..56fa9baf 100644
--- a/spec/unit/plugins/aix/memory_spec.rb
+++ b/spec/unit/plugins/aix/memory_spec.rb
@@ -18,7 +18,7 @@
require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
-describe Ohai::System, "AIX memory plugin" do
+describe info_getter::System, "AIX memory plugin" do
before(:each) do
@plugin = get_plugin("aix/memory")
allow(@plugin).to receive(:collect_os).and_return(:aix)
diff --git a/spec/unit/plugins/aix/network_spec.rb b/spec/unit/plugins/aix/network_spec.rb
index 1007a868..8d393ff8 100644
--- a/spec/unit/plugins/aix/network_spec.rb
+++ b/spec/unit/plugins/aix/network_spec.rb
@@ -18,7 +18,7 @@
require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
-describe Ohai::System, "AIX network plugin" do
+describe info_getter::System, "AIX network plugin" do
before(:each) do
@netstat_rn_grep_default = <<-NETSTAT_RN_GREP_DEFAULT
diff --git a/spec/unit/plugins/aix/os_spec.rb b/spec/unit/plugins/aix/os_spec.rb
index 6cc2227d..3ed4dfbb 100644
--- a/spec/unit/plugins/aix/os_spec.rb
+++ b/spec/unit/plugins/aix/os_spec.rb
@@ -17,7 +17,7 @@
require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
-describe Ohai::System, "AIX os plugin" do
+describe info_getter::System, "AIX os plugin" do
before(:each) do
@plugin = get_plugin("aix/os")
allow(@plugin).to receive(:collect_os).and_return(:aix)
diff --git a/spec/unit/plugins/aix/platform_spec.rb b/spec/unit/plugins/aix/platform_spec.rb
index 318bc427..0b3722d6 100644
--- a/spec/unit/plugins/aix/platform_spec.rb
+++ b/spec/unit/plugins/aix/platform_spec.rb
@@ -18,7 +18,7 @@
require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
-describe Ohai::System, "Aix plugin platform" do
+describe info_getter::System, "Aix plugin platform" do
before(:each) do
@plugin = get_plugin("aix/platform")
allow(@plugin).to receive(:collect_os).and_return(:aix)
diff --git a/spec/unit/plugins/aix/uptime_spec.rb b/spec/unit/plugins/aix/uptime_spec.rb
index 071e561b..3b40ad57 100644
--- a/spec/unit/plugins/aix/uptime_spec.rb
+++ b/spec/unit/plugins/aix/uptime_spec.rb
@@ -18,7 +18,7 @@
#
require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
-describe Ohai::System, "Aix plugin uptime" do
+describe info_getter::System, "Aix plugin uptime" do
before(:each) do
@plugin = get_plugin("aix/uptime")
diff --git a/spec/unit/plugins/aix/virtualization_spec.rb b/spec/unit/plugins/aix/virtualization_spec.rb
index 4d07f814..2ea9f0d2 100644
--- a/spec/unit/plugins/aix/virtualization_spec.rb
+++ b/spec/unit/plugins/aix/virtualization_spec.rb
@@ -18,7 +18,7 @@
require "spec_helper"
-describe Ohai::System, "AIX virtualization plugin" do
+describe info_getter::System, "AIX virtualization plugin" do
context "inside an LPAR" do
diff --git a/spec/unit/plugins/azure_spec.rb b/spec/unit/plugins/azure_spec.rb
index 63238114..a5e474c8 100644
--- a/spec/unit/plugins/azure_spec.rb
+++ b/spec/unit/plugins/azure_spec.rb
@@ -19,7 +19,7 @@
require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
require "open-uri"
-describe Ohai::System, "plugin azure" do
+describe info_getter::System, "plugin azure" do
let(:plugin) { get_plugin("azure") }
let(:hint) do
{
diff --git a/spec/unit/plugins/bsd/filesystem_spec.rb b/spec/unit/plugins/bsd/filesystem_spec.rb
index d337cf79..3b586bcc 100644
--- a/spec/unit/plugins/bsd/filesystem_spec.rb
+++ b/spec/unit/plugins/bsd/filesystem_spec.rb
@@ -19,7 +19,7 @@
require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
-describe Ohai::System, "BSD filesystem plugin" do
+describe info_getter::System, "BSD filesystem plugin" do
let(:plugin) { get_plugin("bsd/filesystem") }
before(:each) do
allow(plugin).to receive(:collect_os).and_return(:freebsd)
diff --git a/spec/unit/plugins/bsd/virtualization_spec.rb b/spec/unit/plugins/bsd/virtualization_spec.rb
index 1f2c273f..57ebb051 100644
--- a/spec/unit/plugins/bsd/virtualization_spec.rb
+++ b/spec/unit/plugins/bsd/virtualization_spec.rb
@@ -18,12 +18,12 @@
require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
-describe Ohai::System, "BSD virtualization plugin" do
+describe info_getter::System, "BSD virtualization plugin" do
before(:each) do
@plugin = get_plugin("bsd/virtualization")
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" )}").and_return(mock_shell_out(0, "", ""))
+ allow(@plugin).to receive(:shell_out).with("#{ info_getter.abs_path( "/sbin/kldstat" )}").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, "", ""))
@@ -77,7 +77,7 @@ Id Refs Address Size Name
1 40 0xffffffff80100000 d20428 kernel
7 3 0xffffffff81055000 41e88 vboxguest.ko
OUT
- allow(@plugin).to receive(:shell_out).with("#{ Ohai.abs_path("/sbin/kldstat")}").and_return(mock_shell_out(0, @vbox_guest, ""))
+ allow(@plugin).to receive(:shell_out).with("#{ info_getter.abs_path("/sbin/kldstat")}").and_return(mock_shell_out(0, @vbox_guest, ""))
end
it "detects we are a guest" do
diff --git a/spec/unit/plugins/c_spec.rb b/spec/unit/plugins/c_spec.rb
index 322d396f..d87ad105 100644
--- a/spec/unit/plugins/c_spec.rb
+++ b/spec/unit/plugins/c_spec.rb
@@ -100,7 +100,7 @@ C_HPUX = <<EOF
$ PATCH/11.00:PHCO_27774 Oct 3 2002 09:45:59 $
EOF
-describe Ohai::System, "plugin c" do
+describe info_getter::System, "plugin c" do
let(:plugin) { get_plugin("c") }
@@ -146,7 +146,7 @@ describe Ohai::System, "plugin c" do
end
it "does not set the languages[:c][:gcc] tree up if gcc command fails" do
- allow(plugin).to receive(:shell_out).with("gcc -v").and_raise(Ohai::Exceptions::Exec)
+ allow(plugin).to receive(:shell_out).with("gcc -v").and_raise(info_getter::Exceptions::Exec)
plugin.run
expect(plugin[:languages][:c]).not_to have_key(:gcc)
expect(plugin[:languages][:c]).not_to be_empty # expect other attributes
@@ -176,8 +176,8 @@ describe Ohai::System, "plugin c" do
end
it "does not set the languages[:c][:glibc] tree up if glibc fails" do
- allow(plugin).to receive(:shell_out).with("/lib/libc.so.6").and_raise(Ohai::Exceptions::Exec)
- allow(plugin).to receive(:shell_out).with("/lib64/libc.so.6").and_raise(Ohai::Exceptions::Exec)
+ allow(plugin).to receive(:shell_out).with("/lib/libc.so.6").and_raise(info_getter::Exceptions::Exec)
+ allow(plugin).to receive(:shell_out).with("/lib64/libc.so.6").and_raise(info_getter::Exceptions::Exec)
plugin.run
expect(plugin[:languages][:c]).not_to have_key(:glibc)
expect(plugin[:languages][:c]).not_to be_empty # expect other attributes
@@ -213,7 +213,7 @@ describe Ohai::System, "plugin c" do
end
it "does not set the languages[:c][:cl] tree up if cl command fails" do
- allow(plugin).to receive(:shell_out).with("cl /\?").and_raise(Ohai::Exceptions::Exec)
+ allow(plugin).to receive(:shell_out).with("cl /\?").and_raise(info_getter::Exceptions::Exec)
plugin.run
expect(plugin[:languages][:c]).not_to have_key(:cl)
expect(plugin[:languages][:c]).not_to be_empty # expect other attributes
@@ -242,7 +242,7 @@ describe Ohai::System, "plugin c" do
end
it "does not set the languages[:c][:vs] tree up if devenv command fails" do
- allow(plugin).to receive(:shell_out).with("devenv.com /\?").and_raise(Ohai::Exceptions::Exec)
+ allow(plugin).to receive(:shell_out).with("devenv.com /\?").and_raise(info_getter::Exceptions::Exec)
plugin.run
expect(plugin[:languages][:c]).not_to have_key(:vs)
expect(plugin[:languages][:c]).not_to be_empty # expect other attributes
@@ -271,7 +271,7 @@ describe Ohai::System, "plugin c" do
end
it "does not set the languages[:c][:xlc] tree up if xlc command fails" do
- allow(plugin).to receive(:shell_out).with("xlc -qversion").and_raise(Ohai::Exceptions::Exec)
+ allow(plugin).to receive(:shell_out).with("xlc -qversion").and_raise(info_getter::Exceptions::Exec)
plugin.run
expect(plugin[:languages][:c]).not_to have_key(:xlc)
expect(plugin[:languages][:c]).not_to be_empty # expect other attributes
@@ -306,7 +306,7 @@ describe Ohai::System, "plugin c" do
end
it "does not set the languages[:c][:sunpro] tree up if cc command fails" do
- allow(plugin).to receive(:shell_out).with("cc -V -flags").and_raise(Ohai::Exceptions::Exec)
+ allow(plugin).to receive(:shell_out).with("cc -V -flags").and_raise(info_getter::Exceptions::Exec)
plugin.run
expect(plugin[:languages][:c]).not_to have_key(:sunpro)
expect(plugin[:languages][:c]).not_to be_empty # expect other attributes
@@ -350,7 +350,7 @@ describe Ohai::System, "plugin c" do
end
it "does not set the languages[:c][:hpcc] tree up if cc command fails" do
- allow(plugin).to receive(:shell_out).with("what /opt/ansic/bin/cc").and_raise(Ohai::Exceptions::Exec)
+ allow(plugin).to receive(:shell_out).with("what /opt/ansic/bin/cc").and_raise(info_getter::Exceptions::Exec)
plugin.run
expect(plugin[:languages][:c]).not_to have_key(:hpcc)
expect(plugin[:languages][:c]).not_to be_empty # expect other attributes
diff --git a/spec/unit/plugins/chef_spec.rb b/spec/unit/plugins/chef_spec.rb
index 952edbad..1d46b823 100644
--- a/spec/unit/plugins/chef_spec.rb
+++ b/spec/unit/plugins/chef_spec.rb
@@ -23,7 +23,7 @@ begin
require "chef/version"
- describe Ohai::System, "plugin chef" do
+ describe info_getter::System, "plugin chef" do
before(:each) do
@plugin = get_plugin("chef")
end
@@ -39,7 +39,7 @@ begin
rescue LoadError
# the chef module is not available, ignoring.
- describe Ohai::System, "plugin chef" do
+ describe info_getter::System, "plugin chef" do
pending "would set [:chef_packages][:chef][:version] if chef was available", :unless => defined?(Chef)
end
end
diff --git a/spec/unit/plugins/cloud_spec.rb b/spec/unit/plugins/cloud_spec.rb
index d90465b1..3f4dab0c 100644
--- a/spec/unit/plugins/cloud_spec.rb
+++ b/spec/unit/plugins/cloud_spec.rb
@@ -17,7 +17,7 @@
require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
-describe Ohai::System, "plugin cloud" do
+describe info_getter::System, "plugin cloud" do
before(:each) do
@plugin = get_plugin("cloud")
end
diff --git a/spec/unit/plugins/cloud_v2_spec.rb b/spec/unit/plugins/cloud_v2_spec.rb
index e08e519d..fd844487 100644
--- a/spec/unit/plugins/cloud_v2_spec.rb
+++ b/spec/unit/plugins/cloud_v2_spec.rb
@@ -72,7 +72,7 @@ describe "CloudAttrs object" do
end
-describe Ohai::System, "plugin cloud" do
+describe info_getter::System, "plugin cloud" do
before(:each) do
@plugin = get_plugin("cloud_v2")
end
diff --git a/spec/unit/plugins/darwin/cpu_spec.rb b/spec/unit/plugins/darwin/cpu_spec.rb
index d6930c80..207200ff 100644
--- a/spec/unit/plugins/darwin/cpu_spec.rb
+++ b/spec/unit/plugins/darwin/cpu_spec.rb
@@ -18,7 +18,7 @@
require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
-describe Ohai::System, "Darwin cpu plugin" do
+describe info_getter::System, "Darwin cpu plugin" do
before(:each) do
@plugin = get_plugin("darwin/cpu")
allow(@plugin).to receive(:collect_os).and_return(:darwin)
diff --git a/spec/unit/plugins/darwin/filesystem2_spec.rb b/spec/unit/plugins/darwin/filesystem2_spec.rb
index 2a652593..ecddc7bf 100644
--- a/spec/unit/plugins/darwin/filesystem2_spec.rb
+++ b/spec/unit/plugins/darwin/filesystem2_spec.rb
@@ -18,7 +18,7 @@
require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
-describe Ohai::System, "darwin filesystem2 plugin" do
+describe info_getter::System, "darwin filesystem2 plugin" do
let (:plugin) { get_plugin("darwin/filesystem2") }
before(:each) do
allow(plugin).to receive(:collect_os).and_return(:darwin)
diff --git a/spec/unit/plugins/darwin/filesystem_spec.rb b/spec/unit/plugins/darwin/filesystem_spec.rb
index b703bce9..fba7fdfb 100644
--- a/spec/unit/plugins/darwin/filesystem_spec.rb
+++ b/spec/unit/plugins/darwin/filesystem_spec.rb
@@ -18,7 +18,7 @@
require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
-describe Ohai::System, "darwin filesystem plugin" do
+describe info_getter::System, "darwin filesystem plugin" do
let (:plugin) { get_plugin("darwin/filesystem") }
before(:each) do
allow(plugin).to receive(:collect_os).and_return(:darwin)
diff --git a/spec/unit/plugins/darwin/hardware_spec.rb b/spec/unit/plugins/darwin/hardware_spec.rb
index de69f3ee..515404b1 100644
--- a/spec/unit/plugins/darwin/hardware_spec.rb
+++ b/spec/unit/plugins/darwin/hardware_spec.rb
@@ -19,7 +19,7 @@
require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
require File.expand_path("#{File.dirname(__FILE__)}/hardware_system_profiler_output.rb")
-describe Ohai::System, "Darwin hardware plugin", :unix_only do
+describe info_getter::System, "Darwin hardware plugin", :unix_only do
let (:plugin) { get_plugin("darwin/hardware") }
before(:each) do
allow(plugin).to receive(:collect_os).and_return(:darwin)
diff --git a/spec/unit/plugins/darwin/hostname_spec.rb b/spec/unit/plugins/darwin/hostname_spec.rb
index b95c8f8a..206163d7 100644
--- a/spec/unit/plugins/darwin/hostname_spec.rb
+++ b/spec/unit/plugins/darwin/hostname_spec.rb
@@ -18,7 +18,7 @@
require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
-describe Ohai::System, "Darwin hostname plugin" do
+describe info_getter::System, "Darwin hostname plugin" do
before(:each) do
@plugin = get_plugin("hostname")
allow(@plugin).to receive(:collect_os).and_return(:darwin)
diff --git a/spec/unit/plugins/darwin/kernel_spec.rb b/spec/unit/plugins/darwin/kernel_spec.rb
index 54cdb7b4..e18ead06 100644
--- a/spec/unit/plugins/darwin/kernel_spec.rb
+++ b/spec/unit/plugins/darwin/kernel_spec.rb
@@ -18,7 +18,7 @@
require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
-describe Ohai::System, "Darwin kernel plugin" do
+describe info_getter::System, "Darwin kernel plugin" do
before(:each) do
@plugin = get_plugin("kernel")
allow(@plugin).to receive(:collect_os).and_return(:darwin)
diff --git a/spec/unit/plugins/darwin/memory_spec.rb b/spec/unit/plugins/darwin/memory_spec.rb
index b089fb87..839d6f89 100644
--- a/spec/unit/plugins/darwin/memory_spec.rb
+++ b/spec/unit/plugins/darwin/memory_spec.rb
@@ -18,7 +18,7 @@
require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
-describe Ohai::System, "Darwin Memory Plugin" do
+describe info_getter::System, "Darwin Memory Plugin" do
before(:each) do
darwin_memsize = <<-DARWIN_MEMSIZE
17179869184
diff --git a/spec/unit/plugins/darwin/network_spec.rb b/spec/unit/plugins/darwin/network_spec.rb
index 7b549dea..7570c4ec 100644
--- a/spec/unit/plugins/darwin/network_spec.rb
+++ b/spec/unit/plugins/darwin/network_spec.rb
@@ -18,7 +18,7 @@
require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
-describe Ohai::System, "Darwin Network Plugin" do
+describe info_getter::System, "Darwin Network Plugin" do
before(:each) do
@darwin_ifconfig = <<-DARWIN_IFCONFIG
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
diff --git a/spec/unit/plugins/darwin/platform_spec.rb b/spec/unit/plugins/darwin/platform_spec.rb
index 53a8ff21..73783eef 100644
--- a/spec/unit/plugins/darwin/platform_spec.rb
+++ b/spec/unit/plugins/darwin/platform_spec.rb
@@ -18,7 +18,7 @@
require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
-describe Ohai::System, "Darwin plugin platform" do
+describe info_getter::System, "Darwin plugin platform" do
before(:each) do
@plugin = get_plugin("darwin/platform")
allow(@plugin).to receive(:collect_os).and_return(:darwin)
diff --git a/spec/unit/plugins/darwin/system_profiler_spec.rb b/spec/unit/plugins/darwin/system_profiler_spec.rb
index 98b6c845..01d27bcc 100644
--- a/spec/unit/plugins/darwin/system_profiler_spec.rb
+++ b/spec/unit/plugins/darwin/system_profiler_spec.rb
@@ -26,7 +26,7 @@ rescue LoadError => e
raise e
end
-describe Ohai::System, "Darwin system_profiler plugin", :unix_only do
+describe info_getter::System, "Darwin system_profiler plugin", :unix_only do
before(:each) do
@plugin = get_plugin("darwin/system_profiler")
allow(@plugin).to receive(:collect_os).and_return(:darwin)
diff --git a/spec/unit/plugins/darwin/virtualization_spec.rb b/spec/unit/plugins/darwin/virtualization_spec.rb
index 0529699a..c96b87cb 100644
--- a/spec/unit/plugins/darwin/virtualization_spec.rb
+++ b/spec/unit/plugins/darwin/virtualization_spec.rb
@@ -20,7 +20,7 @@
require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
-describe Ohai::System, "Darwin virtualization platform" do
+describe info_getter::System, "Darwin virtualization platform" do
let(:plugin) { get_plugin("darwin/virtualization") }
before(:each) do
diff --git a/spec/unit/plugins/digital_ocean_spec.rb b/spec/unit/plugins/digital_ocean_spec.rb
index 45b0109d..754d0b16 100644
--- a/spec/unit/plugins/digital_ocean_spec.rb
+++ b/spec/unit/plugins/digital_ocean_spec.rb
@@ -18,7 +18,7 @@
require "ipaddress"
require "spec_helper"
-describe Ohai::System, "plugin digital_ocean" do
+describe info_getter::System, "plugin digital_ocean" do
let(:plugin) { get_plugin("digital_ocean") }
let(:digitalocean_path) { "/etc/digitalocean" }
let(:hint) do
diff --git a/spec/unit/plugins/dmi_spec.rb b/spec/unit/plugins/dmi_spec.rb
index 08a0bf25..cddc8438 100644
--- a/spec/unit/plugins/dmi_spec.rb
+++ b/spec/unit/plugins/dmi_spec.rb
@@ -100,7 +100,7 @@ Chassis Information
Contained Elements: 0
EOS
-describe Ohai::System, "plugin dmi" do
+describe info_getter::System, "plugin dmi" do
before(:each) do
@plugin = get_plugin("dmi")
@stdout = DMI_OUT
diff --git a/spec/unit/plugins/ec2_spec.rb b/spec/unit/plugins/ec2_spec.rb
index df0f00d0..23336dfe 100644
--- a/spec/unit/plugins/ec2_spec.rb
+++ b/spec/unit/plugins/ec2_spec.rb
@@ -21,7 +21,7 @@ require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
require "open-uri"
require "base64"
-describe Ohai::System, "plugin ec2" do
+describe info_getter::System, "plugin ec2" do
before(:each) do
allow(plugin).to receive(:hint?).with("ec2").and_return(false)
diff --git a/spec/unit/plugins/elixir_spec.rb b/spec/unit/plugins/elixir_spec.rb
index c3191985..a15db28d 100644
--- a/spec/unit/plugins/elixir_spec.rb
+++ b/spec/unit/plugins/elixir_spec.rb
@@ -16,7 +16,7 @@
require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "/spec_helper.rb"))
-describe Ohai::System, "plugin elixir" do
+describe info_getter::System, "plugin elixir" do
let(:plugin) { get_plugin("elixir") }
before(:each) do
@@ -48,7 +48,7 @@ describe Ohai::System, "plugin elixir" do
end
it "does not set languages[:elixir] if elixir command doesn't exist" do
- allow(plugin).to receive(:shell_out).and_raise(Ohai::Exceptions::Exec)
+ allow(plugin).to receive(:shell_out).and_raise(info_getter::Exceptions::Exec)
plugin.run
expect(plugin.languages).not_to have_key(:elixir)
end
diff --git a/spec/unit/plugins/erlang_spec.rb b/spec/unit/plugins/erlang_spec.rb
index b7f51f14..1cd54010 100644
--- a/spec/unit/plugins/erlang_spec.rb
+++ b/spec/unit/plugins/erlang_spec.rb
@@ -19,7 +19,7 @@
require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
-describe Ohai::System, "plugin erlang" do
+describe info_getter::System, "plugin erlang" do
let(:plugin) { get_plugin("erlang") }
before(:each) do
@@ -64,7 +64,7 @@ describe Ohai::System, "plugin erlang" do
end
it "does not set languages[:erlang] if the erl command doesn't exist" do
- allow(plugin).to receive(:shell_out).and_raise(Ohai::Exceptions::Exec)
+ allow(plugin).to receive(:shell_out).and_raise(info_getter::Exceptions::Exec)
plugin.run
expect(plugin.languages).not_to have_key(:erlang)
end
diff --git a/spec/unit/plugins/eucalyptus_spec.rb b/spec/unit/plugins/eucalyptus_spec.rb
index e834b430..49f8e1a2 100644
--- a/spec/unit/plugins/eucalyptus_spec.rb
+++ b/spec/unit/plugins/eucalyptus_spec.rb
@@ -20,7 +20,7 @@
require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
require "open-uri"
-describe Ohai::System, "plugin eucalyptus" do
+describe info_getter::System, "plugin eucalyptus" do
let(:plugin) { get_plugin("eucalyptus") }
shared_examples_for "!eucalyptus" do
diff --git a/spec/unit/plugins/fail_spec.rb b/spec/unit/plugins/fail_spec.rb
index 763dc266..c799911c 100644
--- a/spec/unit/plugins/fail_spec.rb
+++ b/spec/unit/plugins/fail_spec.rb
@@ -49,23 +49,23 @@ shared_examples "a v7 loading failure" do
end
before(:each) do
- @ohai = Ohai::System.new
- @loader = Ohai::Loader.new(@ohai)
+ @info_getter = info_getter::System.new
+ @loader = info_getter::Loader.new(@info_getter)
end
it "should not have attribute keys" do
@loader.load_plugin("#{tmp}/plugins/fail.rb")
- #@ohai.attributes.should_not have_key("fail")
- expect { @ohai.provides_map.find_providers_for(["fail"]) }.to raise_error(Ohai::Exceptions::AttributeNotFound)
+ #@info_getter.attributes.should_not have_key("fail")
+ expect { @info_getter.provides_map.find_providers_for(["fail"]) }.to raise_error(info_getter::Exceptions::AttributeNotFound)
end
it "should not have source key" do
@loader.load_plugin("#{tmp}/plugins/fail.rb")
- expect(@ohai.v6_dependency_solver).not_to have_key("#{tmp}/plugins/fail.rb")
+ expect(@info_getter.v6_dependency_solver).not_to have_key("#{tmp}/plugins/fail.rb")
end
- it "should write to Ohai::Log" do
- expect(Ohai::Log).to receive(:warn).once
+ it "should write to info_getter::Log" do
+ expect(info_getter::Log).to receive(:warn).once
@loader.load_plugin("#{tmp}/plugins/fail.rb")
end
end
@@ -98,22 +98,22 @@ shared_examples "a v7 loading success" do
end
before(:each) do
- @ohai = Ohai::System.new
- @loader = Ohai::Loader.new(@ohai)
+ @info_getter = info_getter::System.new
+ @loader = info_getter::Loader.new(@info_getter)
end
it "should have attribute keys" do
@loader.load_plugin("#{tmp}/plugins/fail.rb")
- expect(@ohai.provides_map).to have_key("fail")
+ expect(@info_getter.provides_map).to have_key("fail")
end
it "should have source key" do
@loader.load_plugin("#{tmp}/plugins/fail.rb")
- expect(@ohai.v6_dependency_solver).to have_key("#{tmp}/plugins/fail.rb")
+ expect(@info_getter.v6_dependency_solver).to have_key("#{tmp}/plugins/fail.rb")
end
- it "should not write to Ohai::Log" do
- expect(Ohai::Log).not_to receive(:warn)
+ it "should not write to info_getter::Log" do
+ expect(info_getter::Log).not_to receive(:warn)
@loader.load_plugin("#{tmp}/plugins/fail.rb")
end
end
@@ -146,18 +146,18 @@ shared_examples "a v7 run failure" do
end
before(:each) do
- @ohai = Ohai::System.new
- @loader = Ohai::Loader.new(@ohai)
+ @info_getter = info_getter::System.new
+ @loader = info_getter::Loader.new(@info_getter)
end
it "should not have new attribute keys" do
- @loader.load_plugin("#{tmp}/plugins/fail.rb").new(@ohai).run
- expect(@ohai.provides_map).not_to have_key("other")
+ @loader.load_plugin("#{tmp}/plugins/fail.rb").new(@info_getter).run
+ expect(@info_getter.provides_map).not_to have_key("other")
end
- it "should write to Ohai::Log" do
- expect(Ohai::Log).to receive(:warn).once
- @loader.load_plugin("#{tmp}/plugins/fail.rb").new(@ohai).run
+ it "should write to info_getter::Log" do
+ expect(info_getter::Log).to receive(:warn).once
+ @loader.load_plugin("#{tmp}/plugins/fail.rb").new(@info_getter).run
end
end
@@ -190,39 +190,39 @@ shared_examples "a v6 run failure" do
end
before(:each) do
- @ohai = Ohai::System.new
- @loader = Ohai::Loader.new(@ohai)
+ @info_getter = info_getter::System.new
+ @loader = info_getter::Loader.new(@info_getter)
end
it "should not add data keys" do
@loader.load_plugin("#{tmp}/plugins/fail.rb")
- @ohai.data.should_not have_key("fail")
+ @info_getter.data.should_not have_key("fail")
end
- it "should write to Ohai::Log" do
- Ohai::Log.should_receive(:warn).once
- @loader.load_plugin("#{tmp}/plugins/fail.rb").new(@ohai).run
+ it "should write to info_getter::Log" do
+ info_getter::Log.should_receive(:warn).once
+ @loader.load_plugin("#{tmp}/plugins/fail.rb").new(@info_getter).run
end
end
=end
-describe "when using DSL commands outside Ohai.plugin block" do
+describe "when using DSL commands outside info_getter.plugin block" do
failstr1 = <<EOF
provides "fail"
-Ohai.plugin do
+info_getter.plugin do
end
EOF
failstr2 = <<EOF
depends "fail"
-Ohai.plugin do
+info_getter.plugin do
end
EOF
failstr3 = <<EOF
collect_data do
end
-Ohai.plugin do
+info_getter.plugin do
end
EOF
@@ -239,8 +239,8 @@ EOF
end
end
-describe "when using nonexistent DSL commands in Ohai.plugin block" do
- failstr = "Ohai.plugin do\n\tcreates \"fail\"\nend\n"
+describe "when using nonexistent DSL commands in info_getter.plugin block" do
+ failstr = "info_getter.plugin do\n\tcreates \"fail\"\nend\n"
it_behaves_like "a v7 loading failure" do
let(:failstr) { failstr }
@@ -250,7 +250,7 @@ end
=begin
describe "when using DSL commands in collect_data block" do
failstr1 = <<EOF
-Ohai.plugin do
+info_getter.plugin do
provides "fail"
collect_data do
provides "other"
@@ -259,7 +259,7 @@ end
EOF
failstr2 =<<EOF
-Ohai.plugin do
+info_getter.plugin do
provides "fail"
collect_data do
provides "other"
@@ -286,7 +286,7 @@ end
describe "when setting undeclared attribute in collect_data block" do
failstr = <<EOF
-Ohai.plugin do
+info_getter.plugin do
provides "fail"
collect_data do
creates "other"
diff --git a/spec/unit/plugins/freebsd/cpu_spec.rb b/spec/unit/plugins/freebsd/cpu_spec.rb
index 1dbbf3a6..936f941d 100644
--- a/spec/unit/plugins/freebsd/cpu_spec.rb
+++ b/spec/unit/plugins/freebsd/cpu_spec.rb
@@ -18,7 +18,7 @@
require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
-describe Ohai::System, "FreeBSD cpu plugin on FreeBSD >=10.2" do
+describe info_getter::System, "FreeBSD cpu plugin on FreeBSD >=10.2" do
before(:each) do
@plugin = get_plugin("freebsd/cpu")
allow(@plugin).to receive(:collect_os).and_return(:freebsd)
@@ -93,7 +93,7 @@ describe Ohai::System, "FreeBSD cpu plugin on FreeBSD >=10.2" do
end
-describe Ohai::System, "FreeBSD cpu plugin on FreeBSD <=10.1" do
+describe info_getter::System, "FreeBSD cpu plugin on FreeBSD <=10.1" do
before(:each) do
@plugin = get_plugin("freebsd/cpu")
allow(@plugin).to receive(:collect_os).and_return(:freebsd)
diff --git a/spec/unit/plugins/freebsd/hostname_spec.rb b/spec/unit/plugins/freebsd/hostname_spec.rb
index a1279b20..978a0a8b 100644
--- a/spec/unit/plugins/freebsd/hostname_spec.rb
+++ b/spec/unit/plugins/freebsd/hostname_spec.rb
@@ -18,7 +18,7 @@
require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
-describe Ohai::System, "FreeBSD hostname plugin" do
+describe info_getter::System, "FreeBSD hostname plugin" do
before(:each) do
@plugin = get_plugin("hostname")
allow(@plugin).to receive(:collect_os).and_return(:freebsd)
diff --git a/spec/unit/plugins/freebsd/kernel_spec.rb b/spec/unit/plugins/freebsd/kernel_spec.rb
index d9baf8fc..89e471c5 100644
--- a/spec/unit/plugins/freebsd/kernel_spec.rb
+++ b/spec/unit/plugins/freebsd/kernel_spec.rb
@@ -18,14 +18,14 @@
require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
-describe Ohai::System, "FreeBSD kernel plugin" do
+describe info_getter::System, "FreeBSD kernel plugin" do
before(:each) do
@plugin = get_plugin("kernel")
allow(@plugin).to receive(:collect_os).and_return(:freebsd)
allow(@plugin).to receive(:init_kernel).and_return({ :name => "freebsd" })
allow(@plugin).to receive(:shell_out).with("uname -i").and_return(mock_shell_out(0, "foo\n", ""))
allow(@plugin).to receive(:shell_out).with("sysctl kern.securelevel").and_return(mock_shell_out(0, "kern.securelevel: 1", ""))
- allow(@plugin).to receive(:shell_out).with( Ohai.abs_path( "/sbin/kldstat" )).and_return(mock_shell_out(0, " 1 7 0xc0400000 97f830 kernel", ""))
+ allow(@plugin).to receive(:shell_out).with( info_getter.abs_path( "/sbin/kldstat" )).and_return(mock_shell_out(0, " 1 7 0xc0400000 97f830 kernel", ""))
end
it "should set the kernel_os to the kernel_name value" do
diff --git a/spec/unit/plugins/freebsd/os_spec.rb b/spec/unit/plugins/freebsd/os_spec.rb
index dfb89996..1842f7ad 100644
--- a/spec/unit/plugins/freebsd/os_spec.rb
+++ b/spec/unit/plugins/freebsd/os_spec.rb
@@ -18,7 +18,7 @@
require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
-describe Ohai::System, "FreeBSD plugin os" do
+describe info_getter::System, "FreeBSD plugin os" do
before(:each) do
@plugin = get_plugin("freebsd/os")
allow(@plugin).to receive(:shell_out).with("sysctl -n kern.osreldate").and_return(mock_shell_out(0, "902001\n", ""))
diff --git a/spec/unit/plugins/freebsd/platform_spec.rb b/spec/unit/plugins/freebsd/platform_spec.rb
index 2ddcc4cd..048eaaa2 100644
--- a/spec/unit/plugins/freebsd/platform_spec.rb
+++ b/spec/unit/plugins/freebsd/platform_spec.rb
@@ -18,7 +18,7 @@
require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
-describe Ohai::System, "FreeBSD plugin platform" do
+describe info_getter::System, "FreeBSD plugin platform" do
before(:each) do
@plugin = get_plugin("freebsd/platform")
allow(@plugin).to receive(:shell_out).with("uname -s").and_return(mock_shell_out(0, "FreeBSD\n", ""))
diff --git a/spec/unit/plugins/gce_spec.rb b/spec/unit/plugins/gce_spec.rb
index a30b232d..ae46ffd4 100644
--- a/spec/unit/plugins/gce_spec.rb
+++ b/spec/unit/plugins/gce_spec.rb
@@ -18,7 +18,7 @@
require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
require "open-uri"
-describe Ohai::System, "plugin gce" do
+describe info_getter::System, "plugin gce" do
let(:plugin) { get_plugin("gce") }
shared_examples_for "!gce" do
diff --git a/spec/unit/plugins/go_spec.rb b/spec/unit/plugins/go_spec.rb
index 7bd3cd79..1c8651bb 100644
--- a/spec/unit/plugins/go_spec.rb
+++ b/spec/unit/plugins/go_spec.rb
@@ -15,7 +15,7 @@
require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "/spec_helper.rb"))
-describe Ohai::System, "plugin go" do
+describe info_getter::System, "plugin go" do
let(:plugin) { get_plugin("go") }
before(:each) do
@@ -41,7 +41,7 @@ describe Ohai::System, "plugin go" do
end
it "does not set languages[:go] if go command doesn't exist" do
- allow(plugin).to receive(:shell_out).and_raise(Ohai::Exceptions::Exec)
+ allow(plugin).to receive(:shell_out).and_raise(info_getter::Exceptions::Exec)
plugin.run
expect(plugin.languages).not_to have_key(:go)
end
diff --git a/spec/unit/plugins/groovy_spec.rb b/spec/unit/plugins/groovy_spec.rb
index 4b614ab3..cadd4499 100644
--- a/spec/unit/plugins/groovy_spec.rb
+++ b/spec/unit/plugins/groovy_spec.rb
@@ -18,7 +18,7 @@
require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "/spec_helper.rb"))
-describe Ohai::System, "plugin groovy" do
+describe info_getter::System, "plugin groovy" do
let(:plugin) { get_plugin("groovy") }
before(:each) do
@@ -59,7 +59,7 @@ describe Ohai::System, "plugin groovy" do
end
it "does not set languages[:groovy] if groovy command doesn't exist" do
- allow(plugin).to receive(:shell_out).and_raise(Ohai::Exceptions::Exec)
+ allow(plugin).to receive(:shell_out).and_raise(info_getter::Exceptions::Exec)
plugin.run
expect(plugin.languages).not_to have_key(:groovy)
end
diff --git a/spec/unit/plugins/hostname_spec.rb b/spec/unit/plugins/hostname_spec.rb
index e0f7672d..2de280c5 100644
--- a/spec/unit/plugins/hostname_spec.rb
+++ b/spec/unit/plugins/hostname_spec.rb
@@ -18,7 +18,7 @@
require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
-describe Ohai::System, "hostname plugin" do
+describe info_getter::System, "hostname plugin" do
before(:each) do
@plugin = get_plugin("hostname")
allow(@plugin).to receive(:collect_os).and_return(:default)
diff --git a/spec/unit/plugins/init_package_spec.rb b/spec/unit/plugins/init_package_spec.rb
index c34fb654..4f064926 100644
--- a/spec/unit/plugins/init_package_spec.rb
+++ b/spec/unit/plugins/init_package_spec.rb
@@ -18,7 +18,7 @@
require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "/spec_helper.rb"))
-describe Ohai::System, "Init package" do
+describe info_getter::System, "Init package" do
let(:plugin) do
p = get_plugin("init_package")
allow(p).to receive(:collect_os).and_return("linux")
diff --git a/spec/unit/plugins/ip_scopes_spec.rb b/spec/unit/plugins/ip_scopes_spec.rb
index 4a808949..9c3c4eb5 100644
--- a/spec/unit/plugins/ip_scopes_spec.rb
+++ b/spec/unit/plugins/ip_scopes_spec.rb
@@ -5,7 +5,7 @@ begin
rescue LoadError
end
-describe Ohai::System, "plugin ip_scopes" do
+describe info_getter::System, "plugin ip_scopes" do
let(:plugin) { get_plugin("ip_scopes") }
let(:network) { Mash.new(:interfaces => interfaces) }
let(:interfaces) do
diff --git a/spec/unit/plugins/java_spec.rb b/spec/unit/plugins/java_spec.rb
index a8279caf..0da70e28 100644
--- a/spec/unit/plugins/java_spec.rb
+++ b/spec/unit/plugins/java_spec.rb
@@ -19,7 +19,7 @@
require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
-describe Ohai::System, "plugin java (Java5 Client VM)" do
+describe info_getter::System, "plugin java (Java5 Client VM)" do
let(:plugin) { get_plugin("java") }
before(:each) do
@@ -70,7 +70,7 @@ describe Ohai::System, "plugin java (Java5 Client VM)" do
end
it "does not set the languages[:java] tree up if java command doesn't exist" do
- allow(plugin).to receive(:shell_out).and_raise(Ohai::Exceptions::Exec)
+ allow(plugin).to receive(:shell_out).and_raise(info_getter::Exceptions::Exec)
plugin.run
expect(plugin[:languages]).not_to have_key(:java)
end
diff --git a/spec/unit/plugins/joyent_spec.rb b/spec/unit/plugins/joyent_spec.rb
index a6670126..bfb90a10 100644
--- a/spec/unit/plugins/joyent_spec.rb
+++ b/spec/unit/plugins/joyent_spec.rb
@@ -1,6 +1,6 @@
require "spec_helper"
-describe Ohai::System, "plugin joyent" do
+describe info_getter::System, "plugin joyent" do
before(:each) do
@plugin = get_plugin("joyent")
end
diff --git a/spec/unit/plugins/kernel_spec.rb b/spec/unit/plugins/kernel_spec.rb
index c46952e5..56558d70 100644
--- a/spec/unit/plugins/kernel_spec.rb
+++ b/spec/unit/plugins/kernel_spec.rb
@@ -18,7 +18,7 @@
require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
-describe Ohai::System, "plugin kernel" do
+describe info_getter::System, "plugin kernel" do
before(:each) do
@plugin = get_plugin("kernel")
allow(@plugin).to receive(:collect_os).and_return(:default) # for debugging
@@ -40,8 +40,8 @@ describe Ohai::System, "plugin kernel" do
before do
require "wmi-lite/wmi"
- @ohai_system = Ohai::System.new
- @plugin = get_plugin("kernel", @ohai_system)
+ @info_getter_system = info_getter::System.new
+ @plugin = get_plugin("kernel", @info_getter_system)
# Mock a Win32_OperatingSystem OLE32 WMI object
caption = double("WIN32OLE", :name => "Caption")
@@ -79,11 +79,11 @@ describe Ohai::System, "plugin kernel" do
@plugin.run
end
it "should set the correct system information" do
- expect(@ohai_system.data[:kernel][:name]).to eq("Microsoft Windows 7 Ultimate")
- expect(@ohai_system.data[:kernel][:release]).to eq("6.1.7601")
- expect(@ohai_system.data[:kernel][:version]).to eq("6.1.7601 Service Pack 1 Build 7601")
- expect(@ohai_system.data[:kernel][:os]).to eq("WINNT")
- expect(@ohai_system.data[:kernel][:machine]).to eq("x86_64")
+ expect(@info_getter_system.data[:kernel][:name]).to eq("Microsoft Windows 7 Ultimate")
+ expect(@info_getter_system.data[:kernel][:release]).to eq("6.1.7601")
+ expect(@info_getter_system.data[:kernel][:version]).to eq("6.1.7601 Service Pack 1 Build 7601")
+ expect(@info_getter_system.data[:kernel][:os]).to eq("WINNT")
+ expect(@info_getter_system.data[:kernel][:machine]).to eq("x86_64")
end
end
diff --git a/spec/unit/plugins/linode_spec.rb b/spec/unit/plugins/linode_spec.rb
index 43c43f39..5d847c5e 100644
--- a/spec/unit/plugins/linode_spec.rb
+++ b/spec/unit/plugins/linode_spec.rb
@@ -17,7 +17,7 @@
require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
-describe Ohai::System, "plugin linode" do
+describe info_getter::System, "plugin linode" do
let(:plugin) { get_plugin("linode") }
before do
diff --git a/spec/unit/plugins/linux/block_device_spec.rb b/spec/unit/plugins/linux/block_device_spec.rb
index edb4b243..18f3545f 100644
--- a/spec/unit/plugins/linux/block_device_spec.rb
+++ b/spec/unit/plugins/linux/block_device_spec.rb
@@ -17,7 +17,7 @@
require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
-describe Ohai::System, "Linux Block Device Plugin" do
+describe info_getter::System, "Linux Block Device Plugin" do
DISKS = {
"sda" => {
"size" => "7814037168",
diff --git a/spec/unit/plugins/linux/cpu_spec.rb b/spec/unit/plugins/linux/cpu_spec.rb
index f6252453..1ebeb9b9 100644
--- a/spec/unit/plugins/linux/cpu_spec.rb
+++ b/spec/unit/plugins/linux/cpu_spec.rb
@@ -61,7 +61,7 @@ shared_examples "S390 processor info" do |cpu_no, version, identification, machi
end
end
-describe Ohai::System, "General Linux cpu plugin" do
+describe info_getter::System, "General Linux cpu plugin" do
let(:plugin) { get_plugin("linux/cpu") }
let(:cpuinfo_contents) do
@@ -89,7 +89,7 @@ clflush size : 32
end
let(:tempfile_handle) do
- tempfile = Tempfile.new("ohai-rspec-proc-cpuinfo")
+ tempfile = Tempfile.new("info_getter-rspec-proc-cpuinfo")
tempfile.write cpuinfo_contents
tempfile.rewind
tempfile
@@ -311,7 +311,7 @@ power management:
end
end
-describe Ohai::System, "S390 linux cpu plugin" do
+describe info_getter::System, "S390 linux cpu plugin" do
let(:plugin) { get_plugin("linux/cpu") }
before(:each) do
diff --git a/spec/unit/plugins/linux/filesystem2_spec.rb b/spec/unit/plugins/linux/filesystem2_spec.rb
index e62e9d1a..2db28289 100644
--- a/spec/unit/plugins/linux/filesystem2_spec.rb
+++ b/spec/unit/plugins/linux/filesystem2_spec.rb
@@ -18,7 +18,7 @@
require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
-describe Ohai::System, "Linux filesystem plugin" do
+describe info_getter::System, "Linux filesystem plugin" do
let (:plugin) { get_plugin("linux/filesystem2") }
before(:each) do
allow(plugin).to receive(:collect_os).and_return(:linux)
diff --git a/spec/unit/plugins/linux/filesystem_spec.rb b/spec/unit/plugins/linux/filesystem_spec.rb
index 7375a8cf..d7932267 100644
--- a/spec/unit/plugins/linux/filesystem_spec.rb
+++ b/spec/unit/plugins/linux/filesystem_spec.rb
@@ -18,7 +18,7 @@
require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
-describe Ohai::System, "Linux filesystem plugin" do
+describe info_getter::System, "Linux filesystem plugin" do
let(:plugin) { get_plugin("linux/filesystem") }
before(:each) do
allow(plugin).to receive(:collect_os).and_return(:linux)
diff --git a/spec/unit/plugins/linux/fips_spec.rb b/spec/unit/plugins/linux/fips_spec.rb
index 30d70c17..c8a98816 100644
--- a/spec/unit/plugins/linux/fips_spec.rb
+++ b/spec/unit/plugins/linux/fips_spec.rb
@@ -18,7 +18,7 @@
require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
-describe Ohai::System, "plugin fips" do
+describe info_getter::System, "plugin fips" do
let(:enabled) { "0" }
let(:plugin) { get_plugin("linux/fips") }
let(:fips_path) { "/proc/sys/crypto/fips_enabled" }
diff --git a/spec/unit/plugins/linux/hostname_spec.rb b/spec/unit/plugins/linux/hostname_spec.rb
index a7dba293..0a1d3a53 100644
--- a/spec/unit/plugins/linux/hostname_spec.rb
+++ b/spec/unit/plugins/linux/hostname_spec.rb
@@ -18,7 +18,7 @@
require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
-describe Ohai::System, "Linux hostname plugin" do
+describe info_getter::System, "Linux hostname plugin" do
before(:each) do
@plugin = get_plugin("hostname")
allow(@plugin).to receive(:collect_os).and_return(:linux)
@@ -35,7 +35,7 @@ describe Ohai::System, "Linux hostname plugin" do
describe "when domain name is unset" do
before(:each) do
- expect(@plugin).to receive(:shell_out).with("hostname --fqdn").and_raise("Ohai::Exception::Exec")
+ expect(@plugin).to receive(:shell_out).with("hostname --fqdn").and_raise("info_getter::Exception::Exec")
end
it "should not raise an error" do
diff --git a/spec/unit/plugins/linux/hostnamectl_spec.rb b/spec/unit/plugins/linux/hostnamectl_spec.rb
index bfa72790..f5121f43 100644
--- a/spec/unit/plugins/linux/hostnamectl_spec.rb
+++ b/spec/unit/plugins/linux/hostnamectl_spec.rb
@@ -18,7 +18,7 @@
require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
-describe Ohai::System, "Linux hostnamectl plugin" do
+describe info_getter::System, "Linux hostnamectl plugin" do
let(:plugin) { get_plugin("linux/hostnamectl") }
before(:each) do
diff --git a/spec/unit/plugins/linux/kernel_spec.rb b/spec/unit/plugins/linux/kernel_spec.rb
index 18646156..6a3ae056 100644
--- a/spec/unit/plugins/linux/kernel_spec.rb
+++ b/spec/unit/plugins/linux/kernel_spec.rb
@@ -19,7 +19,7 @@
require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
-describe Ohai::System, "Linux kernel plugin" do
+describe info_getter::System, "Linux kernel plugin" do
before(:each) do
@env_lsmod = <<-ENV_LSMOD
Module Size Used by
diff --git a/spec/unit/plugins/linux/lsb_spec.rb b/spec/unit/plugins/linux/lsb_spec.rb
index eac26412..d9c4dbdc 100644
--- a/spec/unit/plugins/linux/lsb_spec.rb
+++ b/spec/unit/plugins/linux/lsb_spec.rb
@@ -20,7 +20,7 @@ require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
# We do not alter case for lsb attributes and consume them as provided
-describe Ohai::System, "Linux lsb plugin" do
+describe info_getter::System, "Linux lsb plugin" do
before(:each) do
@plugin = get_plugin("linux/lsb")
allow(@plugin).to receive(:collect_os).and_return(:linux)
diff --git a/spec/unit/plugins/linux/machineid_spec.rb b/spec/unit/plugins/linux/machineid_spec.rb
index 12267079..ccab81fb 100644
--- a/spec/unit/plugins/linux/machineid_spec.rb
+++ b/spec/unit/plugins/linux/machineid_spec.rb
@@ -18,7 +18,7 @@
require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
-describe Ohai::System, "Machine id plugin" do
+describe info_getter::System, "Machine id plugin" do
let(:plugin) { get_plugin("linux/machineid") }
before(:each) do
diff --git a/spec/unit/plugins/linux/mdadm_spec.rb b/spec/unit/plugins/linux/mdadm_spec.rb
index 2e8b533d..d97aae54 100644
--- a/spec/unit/plugins/linux/mdadm_spec.rb
+++ b/spec/unit/plugins/linux/mdadm_spec.rb
@@ -18,7 +18,7 @@
require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
-describe Ohai::System, "Linux Mdadm Plugin" do
+describe info_getter::System, "Linux Mdadm Plugin" do
before(:each) do
@md0 = <<-MD
/dev/md0:
diff --git a/spec/unit/plugins/linux/memory_spec.rb b/spec/unit/plugins/linux/memory_spec.rb
index 3a30ead3..9331d9fb 100644
--- a/spec/unit/plugins/linux/memory_spec.rb
+++ b/spec/unit/plugins/linux/memory_spec.rb
@@ -16,7 +16,7 @@
require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
-describe Ohai::System, "Linux memory plugin" do
+describe info_getter::System, "Linux memory plugin" do
before(:each) do
@plugin = get_plugin("linux/memory")
allow(@plugin).to receive(:collect_os).and_return(:linux)
diff --git a/spec/unit/plugins/linux/network_spec.rb b/spec/unit/plugins/linux/network_spec.rb
index 6e78997f..9cc8415b 100644
--- a/spec/unit/plugins/linux/network_spec.rb
+++ b/spec/unit/plugins/linux/network_spec.rb
@@ -26,7 +26,7 @@ rescue LoadError => e
raise e
end
-describe Ohai::System, "Linux Network Plugin" do
+describe info_getter::System, "Linux Network Plugin" do
let(:plugin) { get_plugin("linux/network") }
let(:linux_ifconfig) do
@@ -567,7 +567,7 @@ EOM
end
it "completes the run" do
- expect(Ohai::Log).not_to receive(:debug).with(/Plugin linux::network threw exception/)
+ expect(info_getter::Log).not_to receive(:debug).with(/Plugin linux::network threw exception/)
expect(plugin["network"]).not_to be_nil
end
@@ -803,7 +803,7 @@ EOM
end
it "completes the run" do
- expect(Ohai::Log).not_to receive(:debug).with(/Plugin linux::network threw exception/)
+ expect(info_getter::Log).not_to receive(:debug).with(/Plugin linux::network threw exception/)
expect(plugin["network"]).not_to be_nil
end
@@ -923,7 +923,7 @@ EOM
end
it "completes the run" do
- expect(Ohai::Log).not_to receive(:debug).with(/Plugin linux::network threw exception/)
+ expect(info_getter::Log).not_to receive(:debug).with(/Plugin linux::network threw exception/)
expect(plugin["network"]).not_to be_nil
end
@@ -964,7 +964,7 @@ EOM
end
it "completes the run" do
- expect(Ohai::Log).not_to receive(:debug).with(/Plugin linux::network threw exception/)
+ expect(info_getter::Log).not_to receive(:debug).with(/Plugin linux::network threw exception/)
expect(plugin["network"]).not_to be_nil
end
@@ -1007,7 +1007,7 @@ EOM
end
it "completes the run" do
- expect(Ohai::Log).not_to receive(:debug).with(/Plugin linux::network threw exception/)
+ expect(info_getter::Log).not_to receive(:debug).with(/Plugin linux::network threw exception/)
expect(plugin["network"]).not_to be_nil
end
@@ -1042,7 +1042,7 @@ EOM
end
it "completes the run" do
- expect(Ohai::Log).not_to receive(:debug).with(/Plugin linux::network threw exception/)
+ expect(info_getter::Log).not_to receive(:debug).with(/Plugin linux::network threw exception/)
plugin.run
expect(plugin["network"]).not_to be_nil
end
@@ -1083,7 +1083,7 @@ EOM
let(:linux_ip_route_inet6) { "" }
it "completes the run" do
- expect(Ohai::Log).not_to receive(:debug).with(/Plugin linux::network threw exception/)
+ expect(info_getter::Log).not_to receive(:debug).with(/Plugin linux::network threw exception/)
plugin.run
expect(plugin["network"]).not_to be_nil
end
@@ -1108,7 +1108,7 @@ EOM
end
it "completes the run" do
- expect(Ohai::Log).not_to receive(:debug).with(/Plugin linux::network threw exception/)
+ expect(info_getter::Log).not_to receive(:debug).with(/Plugin linux::network threw exception/)
expect(plugin["network"]).not_to be_nil
end
@@ -1129,7 +1129,7 @@ EOM
end
it "completes the run" do
- expect(Ohai::Log).not_to receive(:debug).with(/Plugin linux::network threw exception/)
+ expect(info_getter::Log).not_to receive(:debug).with(/Plugin linux::network threw exception/)
expect(plugin["network"]).not_to be_nil
end
@@ -1154,7 +1154,7 @@ EOM
end
it "completes the run" do
- expect(Ohai::Log).not_to receive(:debug).with(/Plugin linux::network threw exception/)
+ expect(info_getter::Log).not_to receive(:debug).with(/Plugin linux::network threw exception/)
expect(plugin["network"]).not_to be_nil
end
@@ -1179,7 +1179,7 @@ EOM
end
it "completes the run" do
- expect(Ohai::Log).not_to receive(:debug).with(/Plugin linux::network threw exception/)
+ expect(info_getter::Log).not_to receive(:debug).with(/Plugin linux::network threw exception/)
expect(plugin["network"]).not_to be_nil
end
@@ -1213,7 +1213,7 @@ EOM
end
it "completes the run" do
- expect(Ohai::Log).not_to receive(:debug).with(/Plugin linux::network threw exception/)
+ expect(info_getter::Log).not_to receive(:debug).with(/Plugin linux::network threw exception/)
expect(plugin["network"]).not_to be_nil
end
@@ -1254,7 +1254,7 @@ EOM
end
it "completes the run" do
- expect(Ohai::Log).not_to receive(:debug).with(/Plugin linux::network threw exception/)
+ expect(info_getter::Log).not_to receive(:debug).with(/Plugin linux::network threw exception/)
expect(plugin["network"]).not_to be_nil
end
@@ -1297,7 +1297,7 @@ EOM
end
it "completes the run" do
- expect(Ohai::Log).not_to receive(:debug).with(/Plugin linux::network threw exception/)
+ expect(info_getter::Log).not_to receive(:debug).with(/Plugin linux::network threw exception/)
expect(plugin["network"]).not_to be_nil
end
@@ -1325,8 +1325,8 @@ EOM
end
it "logs a message and skips previously unseen interfaces in 'ip route show'" do
- expect(Ohai::Log).to receive(:debug).with("Skipping previously unseen interface from 'ip route show': virbr0").once
- allow(Ohai::Log).to receive(:debug) # Catches the 'Loading plugin network' type messages
+ expect(info_getter::Log).to receive(:debug).with("Skipping previously unseen interface from 'ip route show': virbr0").once
+ allow(info_getter::Log).to receive(:debug) # Catches the 'Loading plugin network' type messages
plugin.run
end
end
diff --git a/spec/unit/plugins/linux/platform_spec.rb b/spec/unit/plugins/linux/platform_spec.rb
index 5bff78e4..2747fd6d 100644
--- a/spec/unit/plugins/linux/platform_spec.rb
+++ b/spec/unit/plugins/linux/platform_spec.rb
@@ -19,7 +19,7 @@
require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
-describe Ohai::System, "Linux plugin platform" do
+describe info_getter::System, "Linux plugin platform" do
let(:have_debian_version) { false }
let(:have_redhat_release) { false }
@@ -387,7 +387,7 @@ describe Ohai::System, "Linux plugin platform" do
expect(@plugin[:platform_version].to_i).to eq(13)
end
- # https://github.com/chef/ohai/issues/560
+ # https://github.com/chef/info_getter/issues/560
# Issue is seen on EL7, so that's what we're testing.
context "on versions that have /etc/os-release" do
@@ -659,7 +659,7 @@ CISCO_RELEASE
expect(@plugin[:platform_family]).to eq("suse")
end
- it "[OHAI-272] should read the version as 11.3" do
+ it "[info_getter-272] should read the version as 11.3" do
expect(File).to receive(:read).with("/etc/SuSE-release").exactly(1).times.and_return("openSUSE 11.3 (x86_64)\nVERSION = 11.3")
@plugin.run
expect(@plugin[:platform]).to eq("opensuse")
@@ -667,7 +667,7 @@ CISCO_RELEASE
expect(@plugin[:platform_family]).to eq("suse")
end
- it "[OHAI-272] should read the version as 9.1" do
+ it "[info_getter-272] should read the version as 9.1" do
expect(File).to receive(:read).with("/etc/SuSE-release").exactly(1).times.and_return("SuSE Linux 9.1 (i586)\nVERSION = 9.1")
@plugin.run
expect(@plugin[:platform]).to eq("suse")
@@ -675,7 +675,7 @@ CISCO_RELEASE
expect(@plugin[:platform_family]).to eq("suse")
end
- it "[OHAI-272] should read the version as 11.4" do
+ it "[info_getter-272] should read the version as 11.4" do
expect(File).to receive(:read).with("/etc/SuSE-release").exactly(1).times.and_return("openSUSE 11.4 (i586)\nVERSION = 11.4\nCODENAME = Celadon")
@plugin.run
expect(@plugin[:platform]).to eq("opensuse")
diff --git a/spec/unit/plugins/linux/sessions_spec.rb b/spec/unit/plugins/linux/sessions_spec.rb
index 89130142..94ce7a0f 100644
--- a/spec/unit/plugins/linux/sessions_spec.rb
+++ b/spec/unit/plugins/linux/sessions_spec.rb
@@ -18,7 +18,7 @@
require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
-describe Ohai::System, "Linux sessions plugin" do
+describe info_getter::System, "Linux sessions plugin" do
let(:plugin) { get_plugin("linux/sessions") }
before(:each) do
diff --git a/spec/unit/plugins/linux/uptime_spec.rb b/spec/unit/plugins/linux/uptime_spec.rb
index 4bdc46de..d5effab3 100644
--- a/spec/unit/plugins/linux/uptime_spec.rb
+++ b/spec/unit/plugins/linux/uptime_spec.rb
@@ -18,7 +18,7 @@
require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
-describe Ohai::System, "Linux plugin uptime" do
+describe info_getter::System, "Linux plugin uptime" do
before(:each) do
@plugin = get_plugin("uptime")
allow(@plugin).to receive(:collect_os).and_return(:linux)
diff --git a/spec/unit/plugins/linux/virtualization_spec.rb b/spec/unit/plugins/linux/virtualization_spec.rb
index 84870b95..c81d9b8c 100644
--- a/spec/unit/plugins/linux/virtualization_spec.rb
+++ b/spec/unit/plugins/linux/virtualization_spec.rb
@@ -18,7 +18,7 @@
require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
-describe Ohai::System, "Linux virtualization platform" do
+describe info_getter::System, "Linux virtualization platform" do
let(:plugin) { get_plugin("linux/virtualization") }
before(:each) do
diff --git a/spec/unit/plugins/lua_spec.rb b/spec/unit/plugins/lua_spec.rb
index c994ef17..00f35c8e 100644
--- a/spec/unit/plugins/lua_spec.rb
+++ b/spec/unit/plugins/lua_spec.rb
@@ -20,7 +20,7 @@
require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "/spec_helper.rb"))
-describe Ohai::System, "plugin lua" do
+describe info_getter::System, "plugin lua" do
let(:plugin) { get_plugin("lua") }
@@ -47,7 +47,7 @@ describe Ohai::System, "plugin lua" do
end
it "does not set languages[:lua] if lua command doesn't exist" do
- allow(plugin).to receive(:shell_out).and_raise(Ohai::Exceptions::Exec)
+ allow(plugin).to receive(:shell_out).and_raise(info_getter::Exceptions::Exec)
plugin.run
expect(plugin.languages).not_to have_key(:lua)
end
diff --git a/spec/unit/plugins/mono_spec.rb b/spec/unit/plugins/mono_spec.rb
index a45f57ed..7b742507 100644
--- a/spec/unit/plugins/mono_spec.rb
+++ b/spec/unit/plugins/mono_spec.rb
@@ -18,7 +18,7 @@
require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "/spec_helper.rb"))
-describe Ohai::System, "plugin mono" do
+describe info_getter::System, "plugin mono" do
let(:plugin) { get_plugin("mono") }
before(:each) do
@@ -60,7 +60,7 @@ OUT
end
it "does not set languages[:mono] if mono command doesn't exist" do
- allow(plugin).to receive(:shell_out).and_raise(Ohai::Exceptions::Exec)
+ allow(plugin).to receive(:shell_out).and_raise(info_getter::Exceptions::Exec)
plugin.run
expect(plugin.languages).not_to have_key(:mono)
end
diff --git a/spec/unit/plugins/netbsd/hostname_spec.rb b/spec/unit/plugins/netbsd/hostname_spec.rb
index 4486a4c9..ee7b36c5 100644
--- a/spec/unit/plugins/netbsd/hostname_spec.rb
+++ b/spec/unit/plugins/netbsd/hostname_spec.rb
@@ -18,7 +18,7 @@
require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
-describe Ohai::System, "NetBSD hostname plugin" do
+describe info_getter::System, "NetBSD hostname plugin" do
before(:each) do
@plugin = get_plugin("hostname")
allow(@plugin).to receive(:collect_os).and_return(:netbsd)
diff --git a/spec/unit/plugins/netbsd/kernel_spec.rb b/spec/unit/plugins/netbsd/kernel_spec.rb
index 6b716efc..02ba2bf6 100644
--- a/spec/unit/plugins/netbsd/kernel_spec.rb
+++ b/spec/unit/plugins/netbsd/kernel_spec.rb
@@ -18,14 +18,14 @@
require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
-describe Ohai::System, "NetBSD kernel plugin" do
+describe info_getter::System, "NetBSD kernel plugin" do
before(:each) do
@plugin = get_plugin("kernel")
allow(@plugin).to receive(:collect_os).and_return(:netbsd)
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" )}").and_return(mock_shell_out(0, " 1 7 0xc0400000 97f830 kernel", ""))
+ allow(@plugin).to receive(:shell_out).with("#{ info_getter.abs_path( "/usr/bin/modstat" )}").and_return(mock_shell_out(0, " 1 7 0xc0400000 97f830 kernel", ""))
end
it "should set 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 37da17ab..3e299b99 100644
--- a/spec/unit/plugins/netbsd/platform_spec.rb
+++ b/spec/unit/plugins/netbsd/platform_spec.rb
@@ -18,7 +18,7 @@
require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
-describe Ohai::System, "NetBSD plugin platform" do
+describe info_getter::System, "NetBSD plugin platform" do
before(:each) do
@plugin = get_plugin("netbsd/platform")
allow(@plugin).to receive(:shell_out).with("uname -s").and_return(mock_shell_out(0, "NetBSD\n", ""))
diff --git a/spec/unit/plugins/network_spec.rb b/spec/unit/plugins/network_spec.rb
index 60d4cac6..70c75a14 100644
--- a/spec/unit/plugins/network_spec.rb
+++ b/spec/unit/plugins/network_spec.rb
@@ -20,8 +20,8 @@ require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
def it_doesnt_fail
it "doesnt fail" do
- allow(Ohai::Log).to receive(:warn)
- expect(Ohai::Log).not_to receive(:debug).with(/^Plugin network threw exception/)
+ allow(info_getter::Log).to receive(:warn)
+ expect(info_getter::Log).not_to receive(:debug).with(/^Plugin network threw exception/)
@plugin.run
end
end
@@ -32,8 +32,8 @@ def it_populates_ipaddress_attributes
it "populates ipaddress, macaddress and ip6address" do
begin
- allow(Ohai::Log).to receive(:warn)
- expect(Ohai::Log).not_to receive(:debug).with(/^Plugin network threw exception/)
+ allow(info_getter::Log).to receive(:warn)
+ expect(info_getter::Log).not_to receive(:debug).with(/^Plugin network threw exception/)
@plugin.run
%w{ ipaddress macaddress ip6address }.each do |attribute|
expect(@plugin).to have_key(attribute)
@@ -45,7 +45,7 @@ def it_populates_ipaddress_attributes
end
end
-describe Ohai::System, "Network Plugin" do
+describe info_getter::System, "Network Plugin" do
# output of network plugins on particular platforms to mock plugin runs
basic_data = {
@@ -126,7 +126,7 @@ describe Ohai::System, "Network Plugin" do
},
},
"ipfw0" => {
- # OHAI-492: Ensure network plugin works with interfaces without addresses.
+ # info_getter-492: Ensure network plugin works with interfaces without addresses.
"type" => "ipfw",
"number" => "0",
"flags" => %w{UP SIMPLEX MULTICAST},
@@ -367,8 +367,8 @@ describe Ohai::System, "Network Plugin" do
end
it "informs about this setup" do
- expect(Ohai::Log).to receive(:debug).with(/^ipaddress and ip6address are set from different interfaces/)
- allow(Ohai::Log).to receive(:debug)
+ expect(info_getter::Log).to receive(:debug).with(/^ipaddress and ip6address are set from different interfaces/)
+ allow(info_getter::Log).to receive(:debug)
@plugin.run
end
end
@@ -396,8 +396,8 @@ describe Ohai::System, "Network Plugin" do
end
it "informs about this setup" do
- expect(Ohai::Log).to receive(:debug).with(/^ipaddress and ip6address are set from different interfaces/)
- allow(Ohai::Log).to receive(:debug)
+ expect(info_getter::Log).to receive(:debug).with(/^ipaddress and ip6address are set from different interfaces/)
+ allow(info_getter::Log).to receive(:debug)
@plugin.run
end
end
@@ -413,7 +413,7 @@ describe Ohai::System, "Network Plugin" do
it_populates_ipaddress_attributes
it "picks {ip,ip6,mac}address" do
- allow(Ohai::Log).to receive(:warn)
+ allow(info_getter::Log).to receive(:warn)
@plugin.run
expect(@plugin["ipaddress"]).to eq("192.168.99.11")
expect(@plugin["macaddress"]).to eq("00:16:3E:2F:36:80")
@@ -421,9 +421,9 @@ describe Ohai::System, "Network Plugin" do
end
it "warns about this conflict" do
- expect(Ohai::Log).to receive(:debug).with(/^\[inet\] no ipaddress\/mask on eth1/).once
- expect(Ohai::Log).to receive(:debug).with(/^\[inet6\] no ipaddress\/mask on eth1/).once
- allow(Ohai::Log).to receive(:debug)
+ expect(info_getter::Log).to receive(:debug).with(/^\[inet\] no ipaddress\/mask on eth1/).once
+ expect(info_getter::Log).to receive(:debug).with(/^\[inet6\] no ipaddress\/mask on eth1/).once
+ allow(info_getter::Log).to receive(:debug)
@plugin.run
end
end
@@ -435,7 +435,7 @@ describe Ohai::System, "Network Plugin" do
end
it "picks {ip,ip6,mac}address" do
- allow(Ohai::Log).to receive(:warn)
+ allow(info_getter::Log).to receive(:warn)
@plugin.run
expect(@plugin["ipaddress"]).to eq("192.168.66.33")
expect(@plugin["macaddress"]).to eq("00:16:3E:2F:36:79")
@@ -452,7 +452,7 @@ describe Ohai::System, "Network Plugin" do
it_doesnt_fail
it "doesn't detect {ip,ip6,mac}address" do
- allow(Ohai::Log).to receive(:warn)
+ allow(info_getter::Log).to receive(:warn)
@plugin.run
expect(@plugin["ipaddress"]).to be_nil
expect(@plugin["macaddress"]).to be_nil
@@ -460,11 +460,11 @@ describe Ohai::System, "Network Plugin" do
end
it "warns about this conflict" do
- expect(Ohai::Log).to receive(:warn).with(/^unable to detect ipaddress/).once
- expect(Ohai::Log).to receive(:warn).with(/^\[inet\] no ip address on eth0/).once
- expect(Ohai::Log).to receive(:debug).with(/^unable to detect ip6address/).once
- expect(Ohai::Log).to receive(:debug).with(/^unable to detect macaddress/).twice # for each family
- expect(Ohai::Log).to receive(:warn).with(/^\[inet6\] no ip address on eth0/).once
+ expect(info_getter::Log).to receive(:warn).with(/^unable to detect ipaddress/).once
+ expect(info_getter::Log).to receive(:warn).with(/^\[inet\] no ip address on eth0/).once
+ expect(info_getter::Log).to receive(:debug).with(/^unable to detect ip6address/).once
+ expect(info_getter::Log).to receive(:debug).with(/^unable to detect macaddress/).twice # for each family
+ expect(info_getter::Log).to receive(:warn).with(/^\[inet6\] no ip address on eth0/).once
@plugin.run
end
end
@@ -483,7 +483,7 @@ describe Ohai::System, "Network Plugin" do
it_doesnt_fail
it "doesn't detect {ip,ip6,mac}address" do
- allow(Ohai::Log).to receive(:warn)
+ allow(info_getter::Log).to receive(:warn)
@plugin.run
expect(@plugin["ipaddress"]).to be_nil
expect(@plugin["macaddress"]).to be_nil
@@ -491,9 +491,9 @@ describe Ohai::System, "Network Plugin" do
end
it "should warn about it" do
- expect(Ohai::Log).to receive(:warn).with(/^unable to detect ipaddress/).once
- expect(Ohai::Log).to receive(:debug).with(/^unable to detect macaddress/).twice # for each family
- expect(Ohai::Log).to receive(:debug).with(/^unable to detect ip6address/).once
+ expect(info_getter::Log).to receive(:warn).with(/^unable to detect ipaddress/).once
+ expect(info_getter::Log).to receive(:debug).with(/^unable to detect macaddress/).twice # for each family
+ expect(info_getter::Log).to receive(:debug).with(/^unable to detect ip6address/).once
@plugin.run
end
end
@@ -643,9 +643,9 @@ describe Ohai::System, "Network Plugin" do
it_populates_ipaddress_attributes
it "picks {ip,mac,ip6}address from the first interface" do
- expect(Ohai::Log).to receive(:debug).with(/^\[inet\] no default interface/).once
- expect(Ohai::Log).to receive(:debug).with(/^\[inet6\] no default interface/).once
- allow(Ohai::Log).to receive(:debug)
+ expect(info_getter::Log).to receive(:debug).with(/^\[inet\] no default interface/).once
+ expect(info_getter::Log).to receive(:debug).with(/^\[inet6\] no default interface/).once
+ allow(info_getter::Log).to receive(:debug)
@plugin.run
expect(@plugin["ipaddress"]).to eq("192.168.99.11")
expect(@plugin["macaddress"]).to eq("00:16:3E:2F:36:80")
@@ -666,9 +666,9 @@ describe Ohai::System, "Network Plugin" do
it_populates_ipaddress_attributes
it "prefers global scope addressses to set {ip,mac,ip6}address" do
- expect(Ohai::Log).to receive(:debug).with(/^\[inet\] no default interface/).once
- expect(Ohai::Log).to receive(:debug).with(/^\[inet6\] no default interface/).once
- allow(Ohai::Log).to receive(:debug)
+ expect(info_getter::Log).to receive(:debug).with(/^\[inet\] no default interface/).once
+ expect(info_getter::Log).to receive(:debug).with(/^\[inet6\] no default interface/).once
+ allow(info_getter::Log).to receive(:debug)
@plugin.run
expect(@plugin["ipaddress"]).to eq("192.168.99.11")
expect(@plugin["macaddress"]).to eq("00:16:3E:2F:36:80")
@@ -789,29 +789,29 @@ describe Ohai::System, "Network Plugin" do
it_doesnt_fail
it "can't detect ipaddress" do
- allow(Ohai::Log).to receive(:warn)
+ allow(info_getter::Log).to receive(:warn)
@plugin.run
expect(@plugin["ipaddress"]).to be_nil
end
it "warns about not being able to set {ip,mac}address (ipv4)" do
- expect(Ohai::Log).to receive(:warn).with(/^unable to detect ipaddress/).once
- expect(Ohai::Log).to receive(:debug).with(/^unable to detect macaddress/) # for ipv4
- expect(Ohai::Log).to receive(:debug).with(/^setting macaddress to/) # for ipv6
- expect(Ohai::Log).to receive(:debug).with(/^\[inet6\] Using default interface eth0 and default gateway/) # for ipv6
+ expect(info_getter::Log).to receive(:warn).with(/^unable to detect ipaddress/).once
+ expect(info_getter::Log).to receive(:debug).with(/^unable to detect macaddress/) # for ipv4
+ expect(info_getter::Log).to receive(:debug).with(/^setting macaddress to/) # for ipv6
+ expect(info_getter::Log).to receive(:debug).with(/^\[inet6\] Using default interface eth0 and default gateway/) # for ipv6
@plugin.run
end
it "sets {ip6,mac}address" do
- allow(Ohai::Log).to receive(:warn)
+ allow(info_getter::Log).to receive(:warn)
@plugin.run
expect(@plugin["ip6address"]).to eq("3ffe:1111:2222::33")
expect(@plugin["macaddress"]).to eq("00:16:3E:2F:36:79")
end
it "informs about macaddress being set using the ipv6 setup" do
- expect(Ohai::Log).to receive(:debug).with(/^setting macaddress to '00:16:3E:2F:36:79'/)
- allow(Ohai::Log).to receive(:debug)
+ expect(info_getter::Log).to receive(:debug).with(/^setting macaddress to '00:16:3E:2F:36:79'/)
+ allow(info_getter::Log).to receive(:debug)
@plugin.run
end
end
@@ -829,21 +829,21 @@ describe Ohai::System, "Network Plugin" do
it_doesnt_fail
it "can't detect ipaddress" do
- allow(Ohai::Log).to receive(:warn)
+ allow(info_getter::Log).to receive(:warn)
@plugin.run
expect(@plugin["ipaddress"]).to eq("127.0.0.1")
end
it "sets {ip6,mac}address" do
- allow(Ohai::Log).to receive(:warn)
+ allow(info_getter::Log).to receive(:warn)
@plugin.run
expect(@plugin["ip6address"]).to eq("3ffe:1111:2222::33")
expect(@plugin["macaddress"]).to eq("00:16:3E:2F:36:79")
end
it "informs about macaddress being set using the ipv6 setup" do
- expect(Ohai::Log).to receive(:debug).with(/^setting macaddress to '00:16:3E:2F:36:79'/)
- allow(Ohai::Log).to receive(:debug)
+ expect(info_getter::Log).to receive(:debug).with(/^setting macaddress to '00:16:3E:2F:36:79'/)
+ allow(info_getter::Log).to receive(:debug)
@plugin.run
end
end
@@ -950,24 +950,24 @@ describe Ohai::System, "Network Plugin" do
it_doesnt_fail
it "can't detect ipaddress (ipv4)" do
- allow(Ohai::Log).to receive(:warn)
+ allow(info_getter::Log).to receive(:warn)
@plugin.run
expect(@plugin["ipaddress"]).to be_nil
end
it "takes the macaddress from ipv6" do
- allow(Ohai::Log).to receive(:warn)
+ allow(info_getter::Log).to receive(:warn)
@plugin.run
expect(@plugin["macaddress"]).to eq(@expected_results[os]["macaddress"])
end
it "warns about not being able to set ipaddress" do
- expect(Ohai::Log).to receive(:warn).with(/^unable to detect ipaddress/).once
+ expect(info_getter::Log).to receive(:warn).with(/^unable to detect ipaddress/).once
@plugin.run
end
it "doesn't overwrite ip6address" do
- allow(Ohai::Log).to receive(:warn)
+ allow(info_getter::Log).to receive(:warn)
@plugin.run
expect(@plugin["ip6address"]).to eq("3ffe:8888:9999::1")
end
@@ -1025,13 +1025,13 @@ describe Ohai::System, "Network Plugin" do
it_doesnt_fail
it "can't set ipaddress" do
- allow(Ohai::Log).to receive(:warn)
+ allow(info_getter::Log).to receive(:warn)
@plugin.run
expect(@plugin["ipaddress"]).to be_nil
end
it "doesn't overwrite {ip6,mac}address" do
- allow(Ohai::Log).to receive(:warn)
+ allow(info_getter::Log).to receive(:warn)
@plugin.run
expect(@plugin["ip6address"]).to eq("3ffe:8888:9999::1")
expect(@plugin["macaddress"]).to eq("00:AA:BB:CC:DD:EE")
diff --git a/spec/unit/plugins/nodejs_spec.rb b/spec/unit/plugins/nodejs_spec.rb
index a87d5b05..440af086 100644
--- a/spec/unit/plugins/nodejs_spec.rb
+++ b/spec/unit/plugins/nodejs_spec.rb
@@ -20,7 +20,7 @@
require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "/spec_helper.rb"))
-describe Ohai::System, "plugin nodejs" do
+describe info_getter::System, "plugin nodejs" do
let(:plugin) { get_plugin("nodejs") }
@@ -47,7 +47,7 @@ describe Ohai::System, "plugin nodejs" do
end
it "does not set languages[:nodejs] if node command doesn't exist" do
- allow(plugin).to receive(:shell_out).and_raise(Ohai::Exceptions::Exec)
+ allow(plugin).to receive(:shell_out).and_raise(info_getter::Exceptions::Exec)
plugin.run
expect(plugin.languages).not_to have_key(:nodejs)
end
diff --git a/spec/unit/plugins/ohai_spec.rb b/spec/unit/plugins/ohai_spec.rb
index 530df962..714708a4 100644
--- a/spec/unit/plugins/ohai_spec.rb
+++ b/spec/unit/plugins/ohai_spec.rb
@@ -20,13 +20,13 @@
require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
-describe Ohai::System, "plugin ohai" do
+describe info_getter::System, "plugin info_getter" do
before(:each) do
- @plugin = get_plugin("ohai")
+ @plugin = get_plugin("info_getter")
end
- it "should set [:chef_packages][:ohai][:version] to the current version" do
+ it "should set [:chef_packages][:info_getter][:version] to the current version" do
@plugin.run
- expect(@plugin[:chef_packages][:ohai][:version]).to eq(Ohai::VERSION)
+ expect(@plugin[:chef_packages][:info_getter][:version]).to eq(info_getter::VERSION)
end
end
diff --git a/spec/unit/plugins/ohai_time_spec.rb b/spec/unit/plugins/ohai_time_spec.rb
index e1fe0e48..40c47bf2 100644
--- a/spec/unit/plugins/ohai_time_spec.rb
+++ b/spec/unit/plugins/ohai_time_spec.rb
@@ -18,9 +18,9 @@
require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
-describe Ohai::System, "plugin ohai_time" do
+describe info_getter::System, "plugin info_getter_time" do
before(:each) do
- @plugin = get_plugin("ohai_time")
+ @plugin = get_plugin("info_getter_time")
end
it "should get the current time" do
@@ -35,10 +35,10 @@ describe Ohai::System, "plugin ohai_time" do
@plugin.run
end
- it "should set ohai_time to the current time" do
+ it "should set info_getter_time to the current time" do
time = Time.now
allow(Time).to receive(:now).and_return(time)
@plugin.run
- expect(@plugin[:ohai_time]).to eq(time.to_f)
+ expect(@plugin[:info_getter_time]).to eq(time.to_f)
end
end
diff --git a/spec/unit/plugins/openbsd/hostname_spec.rb b/spec/unit/plugins/openbsd/hostname_spec.rb
index d2d320a0..363c1880 100644
--- a/spec/unit/plugins/openbsd/hostname_spec.rb
+++ b/spec/unit/plugins/openbsd/hostname_spec.rb
@@ -18,7 +18,7 @@
require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
-describe Ohai::System, "OpenBSD hostname plugin" do
+describe info_getter::System, "OpenBSD hostname plugin" do
before(:each) do
@plugin = get_plugin("hostname")
allow(@plugin).to receive(:collect_os).and_return(:openbsd)
diff --git a/spec/unit/plugins/openbsd/kernel_spec.rb b/spec/unit/plugins/openbsd/kernel_spec.rb
index f80de3bb..46ee73bf 100644
--- a/spec/unit/plugins/openbsd/kernel_spec.rb
+++ b/spec/unit/plugins/openbsd/kernel_spec.rb
@@ -18,14 +18,14 @@
require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
-describe Ohai::System, "OpenBSD kernel plugin" do
+describe info_getter::System, "OpenBSD kernel plugin" do
before(:each) do
@plugin = get_plugin("kernel")
allow(@plugin).to receive(:collect_os).and_return(:openbsd)
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" )).and_return(mock_shell_out(0, " 1 7 0xc0400000 97f830 kernel", ""))
+ allow(@plugin).to receive(:shell_out).with( info_getter.abs_path( "/usr/bin/modstat" )).and_return(mock_shell_out(0, " 1 7 0xc0400000 97f830 kernel", ""))
end
it "should set the kernel_os to the kernel_name value" do
diff --git a/spec/unit/plugins/openbsd/platform_spec.rb b/spec/unit/plugins/openbsd/platform_spec.rb
index 3c3759ae..769e6567 100644
--- a/spec/unit/plugins/openbsd/platform_spec.rb
+++ b/spec/unit/plugins/openbsd/platform_spec.rb
@@ -18,7 +18,7 @@
require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
-describe Ohai::System, "OpenBSD plugin platform" do
+describe info_getter::System, "OpenBSD plugin platform" do
before(:each) do
@plugin = get_plugin("openbsd/platform")
allow(@plugin).to receive(:shell_out).with("uname -s").and_return(mock_shell_out(0, "OpenBSD\n", ""))
diff --git a/spec/unit/plugins/openstack_spec.rb b/spec/unit/plugins/openstack_spec.rb
index fcca9a33..09a8dc9e 100644
--- a/spec/unit/plugins/openstack_spec.rb
+++ b/spec/unit/plugins/openstack_spec.rb
@@ -17,7 +17,7 @@
#
require "spec_helper"
-require "ohai/plugins/openstack"
+require "info_getter/plugins/openstack"
describe "OpenStack Plugin" do
@@ -39,7 +39,7 @@ describe "OpenStack Plugin" do
context "and the metadata service is not available" do
before do
allow(plugin).to receive(:can_metadata_connect?).
- with(Ohai::Mixin::Ec2Metadata::EC2_METADATA_ADDR, 80).
+ with(info_getter::Mixin::Ec2Metadata::EC2_METADATA_ADDR, 80).
and_return(false)
plugin[:dmi] = { :system => { :all_records => [ { :Manufacturer => "OpenStack Foundation" } ] } }
plugin.run
@@ -59,7 +59,7 @@ describe "OpenStack Plugin" do
it "sets openstack provider attribute to dreamhost" do
plugin["etc"] = { "passwd" => { "dhc-user" => {} } }
allow(plugin).to receive(:can_metadata_connect?).
- with(Ohai::Mixin::Ec2Metadata::EC2_METADATA_ADDR, 80).
+ with(info_getter::Mixin::Ec2Metadata::EC2_METADATA_ADDR, 80).
and_return(false)
plugin[:dmi] = { :system => { :all_records => [ { :Manufacturer => "OpenStack Foundation" } ] } }
plugin.run
@@ -71,7 +71,7 @@ describe "OpenStack Plugin" do
context "and the metadata service is not available" do
before do
allow(plugin).to receive(:can_metadata_connect?).
- with(Ohai::Mixin::Ec2Metadata::EC2_METADATA_ADDR, 80).
+ with(info_getter::Mixin::Ec2Metadata::EC2_METADATA_ADDR, 80).
and_return(false)
allow(plugin).to receive(:hint?).with("openstack").and_return(true)
plugin.run
@@ -126,12 +126,12 @@ EOM
"instance-id" => "i-0000162a",
"local-ipv4" => "172.31.7.23",
"ari-id" => "ari-00000037",
- "local-hostname" => "ohai-7-system-test.opscode.us",
+ "local-hostname" => "info_getter-7-system-test.opscode.us",
"placement/" => "availability-zone",
"placement/availability-zone" => "nova",
"ami-launch-index" => "0",
- "public-hostname" => "ohai-7-system-test.opscode.us",
- "hostname" => "ohai-7-system-test.opscode.us",
+ "public-hostname" => "info_getter-7-system-test.opscode.us",
+ "hostname" => "info_getter-7-system-test.opscode.us",
"ami-id" => "ami-00000035",
"instance-action" => "none",
"aki-id" => "aki-00000036",
@@ -147,13 +147,13 @@ EOM
let(:openstack_metadata_values) do
'{
"availability_zone" : "nova",
- "hostname" : "ohai.novalocal",
+ "hostname" : "info_getter.novalocal",
"launch_index" : 0,
"meta" : {
"priority" : "low",
- "role" : "ohaiserver"
+ "role" : "info_getterserver"
},
- "name" : "ohai_spec",
+ "name" : "info_getter_spec",
"public_keys" : {
"mykey" : "SSH KEY DATA"
},
@@ -178,11 +178,11 @@ EOM
before do
allow(plugin).to receive(:hint?).with("openstack").and_return(true)
allow(plugin).to receive(:can_metadata_connect?).
- with(Ohai::Mixin::Ec2Metadata::EC2_METADATA_ADDR, 80).
+ with(info_getter::Mixin::Ec2Metadata::EC2_METADATA_ADDR, 80).
and_return(true)
allow(Net::HTTP).to receive(:start).
- with(Ohai::Mixin::Ec2Metadata::EC2_METADATA_ADDR).
+ with(info_getter::Mixin::Ec2Metadata::EC2_METADATA_ADDR).
and_return(http_client)
allow(plugin).to receive(:best_api_version).and_return(metadata_version)
@@ -228,7 +228,7 @@ EOM
expect(plugin["openstack"]["ari_id"]).to eq("ari-00000037")
end
it "reads the local_hostname from the metadata service" do
- expect(plugin["openstack"]["local_hostname"]).to eq("ohai-7-system-test.opscode.us")
+ expect(plugin["openstack"]["local_hostname"]).to eq("info_getter-7-system-test.opscode.us")
end
it "reads the placement_availability_zone from the metadata service" do
expect(plugin["openstack"]["placement_availability_zone"]).to eq("nova")
@@ -237,10 +237,10 @@ EOM
expect(plugin["openstack"]["ami_launch_index"]).to eq("0")
end
it "reads the public_hostname from the metadata service" do
- expect(plugin["openstack"]["public_hostname"]).to eq("ohai-7-system-test.opscode.us")
+ expect(plugin["openstack"]["public_hostname"]).to eq("info_getter-7-system-test.opscode.us")
end
it "reads the hostname from the metadata service" do
- expect(plugin["openstack"]["hostname"]).to eq("ohai-7-system-test.opscode.us")
+ expect(plugin["openstack"]["hostname"]).to eq("info_getter-7-system-test.opscode.us")
end
it "reads the ami_id from the metadata service" do
expect(plugin["openstack"]["ami_id"]).to eq("ami-00000035")
diff --git a/spec/unit/plugins/os_spec.rb b/spec/unit/plugins/os_spec.rb
index 3cff244d..010d5630 100644
--- a/spec/unit/plugins/os_spec.rb
+++ b/spec/unit/plugins/os_spec.rb
@@ -20,7 +20,7 @@ require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
ORIGINAL_CONFIG_HOST_OS = ::RbConfig::CONFIG["host_os"]
-describe Ohai::System, "plugin os" do
+describe info_getter::System, "plugin os" do
before(:each) do
@plugin = get_plugin("os")
@plugin[:kernel] = Mash.new
diff --git a/spec/unit/plugins/packages_spec.rb b/spec/unit/plugins/packages_spec.rb
index ac1e5a26..0010eff8 100644
--- a/spec/unit/plugins/packages_spec.rb
+++ b/spec/unit/plugins/packages_spec.rb
@@ -19,7 +19,7 @@
require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
-describe Ohai::System, "plugin packages" do
+describe info_getter::System, "plugin packages" do
context "on debian" do
let(:plugin) do
get_plugin("packages").tap do |plugin|
diff --git a/spec/unit/plugins/passwd_spec.rb b/spec/unit/plugins/passwd_spec.rb
index b6559989..b7a32aed 100644
--- a/spec/unit/plugins/passwd_spec.rb
+++ b/spec/unit/plugins/passwd_spec.rb
@@ -1,6 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
-describe Ohai::System, "plugin etc", :unix_only do
+describe info_getter::System, "plugin etc", :unix_only do
before(:each) do
@plugin = get_plugin("passwd")
end
diff --git a/spec/unit/plugins/perl_spec.rb b/spec/unit/plugins/perl_spec.rb
index 47bd686f..09216eae 100644
--- a/spec/unit/plugins/perl_spec.rb
+++ b/spec/unit/plugins/perl_spec.rb
@@ -19,7 +19,7 @@
require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
-describe Ohai::System, "plugin perl" do
+describe info_getter::System, "plugin perl" do
let(:plugin) { get_plugin("perl") }
before(:each) do
@@ -55,7 +55,7 @@ describe Ohai::System, "plugin perl" do
end
it "does not set languages[:perl] if perl command doesn't exist" do
- allow(plugin).to receive(:shell_out).and_raise(Ohai::Exceptions::Exec)
+ allow(plugin).to receive(:shell_out).and_raise(info_getter::Exceptions::Exec)
plugin.run
expect(plugin.languages).not_to have_key(:perl)
end
diff --git a/spec/unit/plugins/php_spec.rb b/spec/unit/plugins/php_spec.rb
index cc2542ae..950f3804 100644
--- a/spec/unit/plugins/php_spec.rb
+++ b/spec/unit/plugins/php_spec.rb
@@ -20,7 +20,7 @@
require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "/spec_helper.rb"))
-describe Ohai::System, "plugin php" do
+describe info_getter::System, "plugin php" do
let(:plugin) { get_plugin("php") }
before(:each) do
diff --git a/spec/unit/plugins/platform_spec.rb b/spec/unit/plugins/platform_spec.rb
index 7e841c3f..b26e9b79 100644
--- a/spec/unit/plugins/platform_spec.rb
+++ b/spec/unit/plugins/platform_spec.rb
@@ -18,7 +18,7 @@
require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
-describe Ohai::System, "plugin platform" do
+describe info_getter::System, "plugin platform" do
before(:each) do
@plugin = get_plugin("platform")
allow(@plugin).to receive(:collect_os).and_return(:default)
diff --git a/spec/unit/plugins/powershell_spec.rb b/spec/unit/plugins/powershell_spec.rb
index 43ecbee9..7746d9db 100644
--- a/spec/unit/plugins/powershell_spec.rb
+++ b/spec/unit/plugins/powershell_spec.rb
@@ -17,7 +17,7 @@
require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "/spec_helper.rb"))
-describe Ohai::System, "plugin powershell" do
+describe info_getter::System, "plugin powershell" do
let(:plugin) { get_plugin("powershell") }
before do
diff --git a/spec/unit/plugins/python_spec.rb b/spec/unit/plugins/python_spec.rb
index 8e9fb478..ebf5a9a1 100644
--- a/spec/unit/plugins/python_spec.rb
+++ b/spec/unit/plugins/python_spec.rb
@@ -19,7 +19,7 @@
require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
-describe Ohai::System, "plugin python" do
+describe info_getter::System, "plugin python" do
let(:stdout) { "2.5.2 (r252:60911, Jan 4 2009, 17:40:26)\n[GCC 4.3.2]\n" }
let(:retval) { 0 }
diff --git a/spec/unit/plugins/rackspace_spec.rb b/spec/unit/plugins/rackspace_spec.rb
index 76dc34bf..6547be03 100644
--- a/spec/unit/plugins/rackspace_spec.rb
+++ b/spec/unit/plugins/rackspace_spec.rb
@@ -19,7 +19,7 @@ require "resolv"
require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
-describe Ohai::System, "plugin rackspace" do
+describe info_getter::System, "plugin rackspace" do
let(:plugin) { get_plugin("rackspace") }
before(:each) do
@@ -148,9 +148,9 @@ OUT
expect(plugin).
to receive(:shell_out).
with("xenstore-ls vm-data/provider_data").
- and_raise(Ohai::Exceptions::Exec)
+ and_raise(info_getter::Exceptions::Exec)
- expect(Ohai::Log).
+ expect(info_getter::Log).
to receive(:debug).
with("rackspace plugin: Unable to find xenstore-ls, cannot capture " \
"region information for Rackspace cloud")
@@ -171,9 +171,9 @@ OUT
expect(plugin).
to receive(:shell_out).
with("xenstore-read name").
- and_raise(Ohai::Exceptions::Exec)
+ and_raise(info_getter::Exceptions::Exec)
- expect(Ohai::Log).
+ expect(info_getter::Log).
to receive(:debug).
with("rackspace plugin: Unable to find xenstore-read, cannot capture " \
"instance ID information for Rackspace cloud")
@@ -252,7 +252,7 @@ OUT
allow(plugin).
to receive(:shell_out).
with("xenstore-read vm-data/provider_data/provider").
- and_raise(Ohai::Exceptions::Exec)
+ and_raise(info_getter::Exceptions::Exec)
end
end
@@ -263,9 +263,9 @@ OUT
expect(plugin).
to receive(:shell_out).
with("xenstore-ls vm-data/networking").
- and_raise(Ohai::Exceptions::Exec)
+ and_raise(info_getter::Exceptions::Exec)
- expect(Ohai::Log).
+ expect(info_getter::Log).
to receive(:debug).
with("rackspace plugin: Unable to capture custom private networking " \
"information for Rackspace cloud")
diff --git a/spec/unit/plugins/root_group_spec.rb b/spec/unit/plugins/root_group_spec.rb
index 67ee4c11..d6dbb18a 100644
--- a/spec/unit/plugins/root_group_spec.rb
+++ b/spec/unit/plugins/root_group_spec.rb
@@ -17,9 +17,9 @@
#
require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
-require File.expand_path(File.dirname(__FILE__) + "/../../../lib/ohai/util/win32/group_helper.rb")
+require File.expand_path(File.dirname(__FILE__) + "/../../../lib/info_getter/util/win32/group_helper.rb")
-describe Ohai::System, "root_group" do
+describe info_getter::System, "root_group" do
before(:each) do
@plugin = get_plugin("root_group")
end
@@ -80,7 +80,7 @@ describe Ohai::System, "root_group" do
describe "windows platform" do
it "should return the group administrators" do
stub_const("::RbConfig::CONFIG", { "host_os" => "windows" } )
- expect(Ohai::Util::Win32::GroupHelper).to receive(:windows_root_group_name).and_return("administrators")
+ expect(info_getter::Util::Win32::GroupHelper).to receive(:windows_root_group_name).and_return("administrators")
@plugin.run
expect(@plugin[:root_group]).to eq("administrators")
end
diff --git a/spec/unit/plugins/ruby_spec.rb b/spec/unit/plugins/ruby_spec.rb
index 9acb35b6..709f40ff 100644
--- a/spec/unit/plugins/ruby_spec.rb
+++ b/spec/unit/plugins/ruby_spec.rb
@@ -20,18 +20,18 @@ require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
ruby_bin = File.join(::RbConfig::CONFIG["bindir"], ::RbConfig::CONFIG["ruby_install_name"])
-describe Ohai::System, "plugin ruby" do
+describe info_getter::System, "plugin ruby" do
before(:all) do
@plugin = get_plugin("ruby")
@plugin[:languages] = Mash.new
@plugin.run
- @ruby_ohai_data_pristine = @plugin[:languages][:ruby]
+ @ruby_info_getter_data_pristine = @plugin[:languages][:ruby]
end
before(:each) do
- @ruby_ohai_data = @ruby_ohai_data_pristine.dup
+ @ruby_info_getter_data = @ruby_info_getter_data_pristine.dup
end
{
@@ -53,7 +53,7 @@ describe Ohai::System, "plugin ruby" do
:ruby_bin => ruby_bin,
}.each do |attribute, value|
it "should have #{attribute} set to #{value.inspect}" do
- expect(@ruby_ohai_data[attribute]).to eql(value)
+ expect(@ruby_info_getter_data[attribute]).to eql(value)
end
end
diff --git a/spec/unit/plugins/rust_spec.rb b/spec/unit/plugins/rust_spec.rb
index daa45d48..96ad5a66 100644
--- a/spec/unit/plugins/rust_spec.rb
+++ b/spec/unit/plugins/rust_spec.rb
@@ -16,7 +16,7 @@
require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "/spec_helper.rb"))
-describe Ohai::System, "plugin rust" do
+describe info_getter::System, "plugin rust" do
let(:stdout) { "rustc 1.0.0-nightly (29bd9a06e 2015-01-20 23:03:09 +0000)" }
let (:plugin) do
plugin = get_plugin("rust")
diff --git a/spec/unit/plugins/scala_spec.rb b/spec/unit/plugins/scala_spec.rb
index f85c577c..aeb3c06a 100644
--- a/spec/unit/plugins/scala_spec.rb
+++ b/spec/unit/plugins/scala_spec.rb
@@ -17,7 +17,7 @@
require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "/spec_helper.rb"))
-describe Ohai::System, "plugin scala" do
+describe info_getter::System, "plugin scala" do
let(:plugin) do
plugin = get_plugin("scala").tap do |plugin|
@@ -64,7 +64,7 @@ describe Ohai::System, "plugin scala" do
before(:each) do
allow(plugin).to receive(:shell_out)
- .and_raise( Ohai::Exceptions::Exec )
+ .and_raise( info_getter::Exceptions::Exec )
plugin.run
end
@@ -81,7 +81,7 @@ describe Ohai::System, "plugin scala" do
allow(plugin).to receive(:shell_out)
.with("sbt --version")
- .and_raise( Ohai::Exceptions::Exec )
+ .and_raise( info_getter::Exceptions::Exec )
plugin.run
end
diff --git a/spec/unit/plugins/shard_spec.rb b/spec/unit/plugins/shard_spec.rb
index 5d6ef066..088ee9c1 100644
--- a/spec/unit/plugins/shard_spec.rb
+++ b/spec/unit/plugins/shard_spec.rb
@@ -19,7 +19,7 @@
require "digest/md5"
require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
-describe Ohai::System, "shard plugin" do
+describe info_getter::System, "shard plugin" do
let(:plugin) { get_plugin("shard") }
let(:fqdn) { "somehost004.someregion.somecompany.com" }
let(:uuid) { "48555CF4-5BB1-21D9-BC4C-E8B73DDE5801" }
@@ -47,14 +47,14 @@ describe Ohai::System, "shard plugin" do
end
it "should provide a shard with a configured source" do
- Ohai.config[:plugin][:shard_seed][:sources] = [:fqdn]
+ info_getter.config[:plugin][:shard_seed][:sources] = [:fqdn]
plugin.run
result = Digest::MD5.hexdigest(fqdn)[0...7].to_i(16)
expect(plugin[:shard_seed]).to eq(result)
end
it "fails on an unrecognized source" do
- Ohai.config[:plugin][:shard_seed][:sources] = [:GreatGooglyMoogly]
+ info_getter.config[:plugin][:shard_seed][:sources] = [:GreatGooglyMoogly]
expect { plugin.run }.to raise_error(RuntimeError)
end
end
diff --git a/spec/unit/plugins/shells_spec.rb b/spec/unit/plugins/shells_spec.rb
index 4c0381aa..59545b5b 100644
--- a/spec/unit/plugins/shells_spec.rb
+++ b/spec/unit/plugins/shells_spec.rb
@@ -17,7 +17,7 @@
require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
-describe Ohai::System, "plugin shells" do
+describe info_getter::System, "plugin shells" do
let(:plugin) { get_plugin("shells") }
# content from OS X 10.11
diff --git a/spec/unit/plugins/sigar/network_route_spec.rb b/spec/unit/plugins/sigar/network_route_spec.rb
index b3b2ec4d..2f8732c0 100644
--- a/spec/unit/plugins/sigar/network_route_spec.rb
+++ b/spec/unit/plugins/sigar/network_route_spec.rb
@@ -25,15 +25,15 @@ rescue LoadError
false
end
-require "ohai"
+require "info_getter"
-describe Ohai::System, "Sigar network route plugin" do
+describe info_getter::System, "Sigar network route plugin" do
if sigar_available
before(:each) do
- @ohai = Ohai::System.new
- @plugin = get_plugin("sigar/network", @ohai)
+ @info_getter = info_getter::System.new
+ @plugin = get_plugin("sigar/network", @info_getter)
allow(@plugin).to receive(:collect_os).and_return(:sigar)
@sigar = double("Sigar")
@net_info_conf = {
diff --git a/spec/unit/plugins/softlayer_spec.rb b/spec/unit/plugins/softlayer_spec.rb
index 1734b83d..44d04259 100644
--- a/spec/unit/plugins/softlayer_spec.rb
+++ b/spec/unit/plugins/softlayer_spec.rb
@@ -19,7 +19,7 @@
require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
-describe Ohai::System, "plugin softlayer" do
+describe info_getter::System, "plugin softlayer" do
let(:plugin) { get_plugin("softlayer") }
it "not create softlayer if hint file doesn't exists" do
diff --git a/spec/unit/plugins/solaris2/cpu_spec.rb b/spec/unit/plugins/solaris2/cpu_spec.rb
index c183b796..d2c51eb9 100644
--- a/spec/unit/plugins/solaris2/cpu_spec.rb
+++ b/spec/unit/plugins/solaris2/cpu_spec.rb
@@ -16,7 +16,7 @@
require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
-describe Ohai::System, "Solaris2.X cpu plugin" do
+describe info_getter::System, "Solaris2.X cpu plugin" do
before(:each) do
@plugin = get_plugin("solaris2/cpu")
allow(@plugin).to receive(:collect_os).and_return("solaris2")
diff --git a/spec/unit/plugins/solaris2/dmi_spec.rb b/spec/unit/plugins/solaris2/dmi_spec.rb
index 261c4431..66bd8b7f 100644
--- a/spec/unit/plugins/solaris2/dmi_spec.rb
+++ b/spec/unit/plugins/solaris2/dmi_spec.rb
@@ -111,7 +111,7 @@ ID SIZE TYPE
Element Records: 0
EOS
-describe Ohai::System, "Solaris2.X DMI plugin" do
+describe info_getter::System, "Solaris2.X DMI plugin" do
before(:each) do
@plugin = get_plugin("solaris2/dmi")
allow(@plugin).to receive(:collect_os).and_return("solaris2")
diff --git a/spec/unit/plugins/solaris2/filesystem.rb b/spec/unit/plugins/solaris2/filesystem.rb
index 97a3b222..02777f00 100644
--- a/spec/unit/plugins/solaris2/filesystem.rb
+++ b/spec/unit/plugins/solaris2/filesystem.rb
@@ -17,7 +17,7 @@
require_relative "../../../spec_helper"
-describe Ohai::System, "Solaris2.X filesystem plugin" do
+describe info_getter::System, "Solaris2.X filesystem plugin" do
let(:plugin) { get_plugin("solaris2/filesystem") }
before(:each) do
@@ -28,15 +28,15 @@ describe Ohai::System, "Solaris2.X filesystem plugin" do
let(:plugin_config) { {} }
before(:each) do
- @original_plugin_config = Ohai.config[:plugin]
- Ohai.config[:plugin] = plugin_config
+ @original_plugin_config = info_getter.config[:plugin]
+ info_getter.config[:plugin] = plugin_config
allow(plugin).to receive(:shell_out).with("df -Pka").and_return(mock_shell_out(0, "", ""))
allow(plugin).to receive(:shell_out).with("df -na").and_return(mock_shell_out(0, "", ""))
allow(plugin).to receive(:shell_out).with("mount").and_return(mock_shell_out(0, "", ""))
end
after(:each) do
- Ohai.config[:plugin] = @original_plugin_config
+ info_getter.config[:plugin] = @original_plugin_config
end
context "when 'zfs get' properties are not configured" do
diff --git a/spec/unit/plugins/solaris2/hostname_spec.rb b/spec/unit/plugins/solaris2/hostname_spec.rb
index 6b793abe..32c4ec0a 100644
--- a/spec/unit/plugins/solaris2/hostname_spec.rb
+++ b/spec/unit/plugins/solaris2/hostname_spec.rb
@@ -18,7 +18,7 @@
require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
-describe Ohai::System, "Solaris2.X hostname plugin" do
+describe info_getter::System, "Solaris2.X hostname plugin" do
before(:each) do
@plugin = get_plugin("hostname")
allow(@plugin).to receive(:collect_os).and_return(:solaris2)
diff --git a/spec/unit/plugins/solaris2/kernel_spec.rb b/spec/unit/plugins/solaris2/kernel_spec.rb
index cb2822b1..e6100c53 100644
--- a/spec/unit/plugins/solaris2/kernel_spec.rb
+++ b/spec/unit/plugins/solaris2/kernel_spec.rb
@@ -18,7 +18,7 @@
require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
-describe Ohai::System, "Solaris2.X kernel plugin" do
+describe info_getter::System, "Solaris2.X kernel plugin" do
# NOTE: Solaris will report the same module loaded multiple times
# with the same ID, Loadaddr, etc. and only the info column different
# ignoring it, and removing the data from this fixture.
diff --git a/spec/unit/plugins/solaris2/memory_spec.rb b/spec/unit/plugins/solaris2/memory_spec.rb
index 101dcd3d..949b6246 100644
--- a/spec/unit/plugins/solaris2/memory_spec.rb
+++ b/spec/unit/plugins/solaris2/memory_spec.rb
@@ -16,7 +16,7 @@
require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
-describe Ohai::System, "Solaris2.X memory plugin" do
+describe info_getter::System, "Solaris2.X memory plugin" do
before(:each) do
@plugin = get_plugin("solaris2/memory")
allow(@plugin).to receive(:collect_os).and_return("solaris2")
diff --git a/spec/unit/plugins/solaris2/network_spec.rb b/spec/unit/plugins/solaris2/network_spec.rb
index caa444dc..a5a02150 100644
--- a/spec/unit/plugins/solaris2/network_spec.rb
+++ b/spec/unit/plugins/solaris2/network_spec.rb
@@ -18,7 +18,7 @@
require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
-describe Ohai::System, "Solaris2.X network plugin" do
+describe info_getter::System, "Solaris2.X network plugin" do
before do
@solaris_arp_rn = <<-ARP_RN
diff --git a/spec/unit/plugins/solaris2/platform_spec.rb b/spec/unit/plugins/solaris2/platform_spec.rb
index 1c813f72..82bb035f 100644
--- a/spec/unit/plugins/solaris2/platform_spec.rb
+++ b/spec/unit/plugins/solaris2/platform_spec.rb
@@ -18,7 +18,7 @@
require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
-describe Ohai::System, "Solaris plugin platform" do
+describe info_getter::System, "Solaris plugin platform" do
before(:each) do
@plugin = get_plugin("solaris2/platform")
allow(@plugin).to receive(:collect_os).and_return(:solaris2)
diff --git a/spec/unit/plugins/solaris2/virtualization_spec.rb b/spec/unit/plugins/solaris2/virtualization_spec.rb
index e0f950e3..06557c0c 100644
--- a/spec/unit/plugins/solaris2/virtualization_spec.rb
+++ b/spec/unit/plugins/solaris2/virtualization_spec.rb
@@ -18,7 +18,7 @@
require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
-describe Ohai::System, "Solaris virtualization platform" do
+describe info_getter::System, "Solaris virtualization platform" do
before(:each) do
@psrinfo_pv = <<-PSRINFO_PV
The physical processor has 1 virtual processor (0)
@@ -34,7 +34,7 @@ PSRINFO_PV
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(: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, "", ""))
+ allow(@plugin).to receive(:shell_out).with("#{ info_getter.abs_path( "/usr/sbin/psrinfo" )} -pv").and_return(mock_shell_out(0, "", ""))
end
describe "when we are checking for kvm" do
@@ -43,12 +43,12 @@ PSRINFO_PV
end
it "should run psrinfo -pv" do
- expect(@plugin).to receive(:shell_out).with("#{ Ohai.abs_path( "/usr/sbin/psrinfo" )} -pv")
+ expect(@plugin).to receive(:shell_out).with("#{ info_getter.abs_path( "/usr/sbin/psrinfo" )} -pv")
@plugin.run
end
it "Should set kvm guest if psrinfo -pv contains QEMU Virtual CPU" do
- allow(@plugin).to receive(:shell_out).with("#{ Ohai.abs_path( "/usr/sbin/psrinfo" )} -pv").and_return(mock_shell_out(0, "QEMU Virtual CPU", ""))
+ allow(@plugin).to receive(:shell_out).with("#{ info_getter.abs_path( "/usr/sbin/psrinfo" )} -pv").and_return(mock_shell_out(0, "QEMU Virtual CPU", ""))
@plugin.run
expect(@plugin[:virtualization][:system]).to eq("kvm")
expect(@plugin[:virtualization][:role]).to eq("guest")
@@ -56,7 +56,7 @@ PSRINFO_PV
end
it "should not set virtualization if kvm isn't there" do
- expect(@plugin).to receive(:shell_out).with("#{ Ohai.abs_path( "/usr/sbin/psrinfo" )} -pv").and_return(mock_shell_out(0, @psrinfo_pv, ""))
+ expect(@plugin).to receive(:shell_out).with("#{ info_getter.abs_path( "/usr/sbin/psrinfo" )} -pv").and_return(mock_shell_out(0, @psrinfo_pv, ""))
@plugin.run
expect(@plugin[:virtualization][:systems]).to eq({})
end
diff --git a/spec/unit/plugins/solaris2/zpools_spec.rb b/spec/unit/plugins/solaris2/zpools_spec.rb
index b53b659b..89c0cc3c 100644
--- a/spec/unit/plugins/solaris2/zpools_spec.rb
+++ b/spec/unit/plugins/solaris2/zpools_spec.rb
@@ -15,7 +15,7 @@
require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
-describe Ohai::System, "Solaris 2.x zpool plugin" do
+describe info_getter::System, "Solaris 2.x zpool plugin" do
before(:each) do
@plugin = get_plugin("solaris2/zpools")
allow(@plugin).to receive(:collect_os).and_return(:solaris2)
diff --git a/spec/unit/plugins/ssh_host_keys_spec.rb b/spec/unit/plugins/ssh_host_keys_spec.rb
index 7bdf90d8..f59cb77f 100644
--- a/spec/unit/plugins/ssh_host_keys_spec.rb
+++ b/spec/unit/plugins/ssh_host_keys_spec.rb
@@ -18,7 +18,7 @@
require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "/spec_helper.rb"))
-describe Ohai::System, "ssh_host_key plugin" do
+describe info_getter::System, "ssh_host_key plugin" do
before(:each) do
@plugin = get_plugin("ssh_host_key")
diff --git a/spec/unit/plugins/timezone_spec.rb b/spec/unit/plugins/timezone_spec.rb
index 62fcb0ef..fc55930f 100644
--- a/spec/unit/plugins/timezone_spec.rb
+++ b/spec/unit/plugins/timezone_spec.rb
@@ -17,7 +17,7 @@
require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
-describe Ohai::System, "timezone plugin" do
+describe info_getter::System, "timezone plugin" do
before(:each) do
@plugin = get_plugin("timezone")
allow(Time).to receive_message_chain(:now, :getlocal, :zone) { "ZZZ" }
diff --git a/spec/unit/plugins/virtualbox_spec.rb b/spec/unit/plugins/virtualbox_spec.rb
index 49e2268f..8654fabb 100644
--- a/spec/unit/plugins/virtualbox_spec.rb
+++ b/spec/unit/plugins/virtualbox_spec.rb
@@ -47,7 +47,7 @@ Name: /VirtualBox/GuestInfo/OS/Release, value: 3.19.0-31-generic, timestamp: 144
Name: /VirtualBox/GuestInfo/OS/NoLoggedInUsers, value: false, timestamp: 1448390452251532000, flags: TRANSIENT, TRANSRESET
EOF
-describe Ohai::System, "plugin virtualbox" do
+describe info_getter::System, "plugin virtualbox" do
context "when VBoxControl shellout fails" do
it "should not set the virtualbox attribute" do
plugin = get_plugin("virtualbox")
diff --git a/spec/unit/plugins/vmware_spec.rb b/spec/unit/plugins/vmware_spec.rb
index bcaf17bf..8e078364 100644
--- a/spec/unit/plugins/vmware_spec.rb
+++ b/spec/unit/plugins/vmware_spec.rb
@@ -16,7 +16,7 @@
# limitations under the License.
require "spec_helper"
-describe Ohai::System, "plugin vmware" do
+describe info_getter::System, "plugin vmware" do
let(:plugin) { get_plugin("vmware") }
let(:path) { "/usr/bin/vmware-toolbox-cmd" }
diff --git a/spec/unit/plugins/windows/cpu_spec.rb b/spec/unit/plugins/windows/cpu_spec.rb
index 313104bf..3adb1c9c 100644
--- a/spec/unit/plugins/windows/cpu_spec.rb
+++ b/spec/unit/plugins/windows/cpu_spec.rb
@@ -55,7 +55,7 @@ shared_examples "a cpu" do |cpu_no|
end
end
-describe Ohai::System, "Windows cpu plugin" do
+describe info_getter::System, "Windows cpu plugin" do
before(:each) do
@plugin = get_plugin("windows/cpu")
allow(@plugin).to receive(:collect_os).and_return(:windows)
diff --git a/spec/unit/plugins/windows/fips_spec.rb b/spec/unit/plugins/windows/fips_spec.rb
index 29138082..acfc0479 100644
--- a/spec/unit/plugins/windows/fips_spec.rb
+++ b/spec/unit/plugins/windows/fips_spec.rb
@@ -18,7 +18,7 @@
require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
-describe Ohai::System, "plugin fips", :windows_only do
+describe info_getter::System, "plugin fips", :windows_only do
let(:enabled) { 0 }
let(:plugin) { get_plugin("windows/fips") }
let(:fips_key) { 'System\CurrentControlSet\Control\Lsa\FIPSAlgorithmPolicy' }
diff --git a/spec/unit/plugins/windows/memory_spec.rb b/spec/unit/plugins/windows/memory_spec.rb
index 0579439b..a10f2e0f 100644
--- a/spec/unit/plugins/windows/memory_spec.rb
+++ b/spec/unit/plugins/windows/memory_spec.rb
@@ -16,7 +16,7 @@
require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
-describe Ohai::System, "Windows memory plugin", :windows_only do
+describe info_getter::System, "Windows memory plugin", :windows_only do
before do
require "wmi-lite/wmi"
@plugin = get_plugin("windows/memory")
diff --git a/spec/unit/plugins/windows/uptime_spec.rb b/spec/unit/plugins/windows/uptime_spec.rb
index 05d2fd2f..7acd2966 100644
--- a/spec/unit/plugins/windows/uptime_spec.rb
+++ b/spec/unit/plugins/windows/uptime_spec.rb
@@ -18,7 +18,7 @@
require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
-describe Ohai::System, "Windows plugin uptime" do
+describe info_getter::System, "Windows plugin uptime" do
let(:wmi) { double("wmi", { :first_of => "" }) }
diff --git a/spec/unit/plugins/windows/virtualization_spec.rb b/spec/unit/plugins/windows/virtualization_spec.rb
index 124e92f6..1865a8a4 100644
--- a/spec/unit/plugins/windows/virtualization_spec.rb
+++ b/spec/unit/plugins/windows/virtualization_spec.rb
@@ -20,7 +20,7 @@
require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
-describe Ohai::System, "Windows virtualization platform" do
+describe info_getter::System, "Windows virtualization platform" do
let(:plugin) { get_plugin("windows/virtualization") }
before(:each) do
diff --git a/spec/unit/provides_map_spec.rb b/spec/unit/provides_map_spec.rb
index 5a6eb1fe..8365f0f4 100644
--- a/spec/unit/provides_map_spec.rb
+++ b/spec/unit/provides_map_spec.rb
@@ -19,26 +19,26 @@
require File.expand_path(File.dirname(__FILE__) + "/../spec_helper.rb")
-describe Ohai::ProvidesMap do
+describe info_getter::ProvidesMap do
- let(:ohai_system) { Ohai::System.new }
- let(:provides_map) { Ohai::ProvidesMap.new }
- let(:plugin_1) { Ohai::DSL::Plugin.new(ohai_system.data) }
- let(:plugin_2) { Ohai::DSL::Plugin.new(ohai_system.data) }
- let(:plugin_3) { Ohai::DSL::Plugin.new(ohai_system.data) }
- let(:plugin_4) { Ohai::DSL::Plugin.new(ohai_system.data) }
+ let(:info_getter_system) { info_getter::System.new }
+ let(:provides_map) { info_getter::ProvidesMap.new }
+ let(:plugin_1) { info_getter::DSL::Plugin.new(info_getter_system.data) }
+ let(:plugin_2) { info_getter::DSL::Plugin.new(info_getter_system.data) }
+ let(:plugin_3) { info_getter::DSL::Plugin.new(info_getter_system.data) }
+ let(:plugin_4) { info_getter::DSL::Plugin.new(info_getter_system.data) }
describe "when looking up providing plugins for a single attribute" do
describe "when the attribute does not exist" do
- it "should raise Ohai::Exceptions::AttributeNotFound error" do
- expect { provides_map.find_providers_for(["single"]) }.to raise_error(Ohai::Exceptions::AttributeNotFound, "No such attribute: 'single'")
+ it "should raise info_getter::Exceptions::AttributeNotFound error" do
+ expect { provides_map.find_providers_for(["single"]) }.to raise_error(info_getter::Exceptions::AttributeNotFound, "No such attribute: 'single'")
end
end
describe "when the attribute does not have a provider" do
- it "should raise Ohai::Exceptions::ProviderNotFound error" do
+ it "should raise info_getter::Exceptions::ProviderNotFound error" do
provides_map.set_providers_for(plugin_1, ["first/second"])
- expect { provides_map.find_providers_for(["first"]) }.to raise_error(Ohai::Exceptions::ProviderNotFound, "Cannot find plugin providing attribute: 'first'")
+ expect { provides_map.find_providers_for(["first"]) }.to raise_error(info_getter::Exceptions::ProviderNotFound, "Cannot find plugin providing attribute: 'first'")
end
end
@@ -104,14 +104,14 @@ describe Ohai::ProvidesMap do
describe "when setting multi-level attributes" do
describe "when the attribute contains //" do
- it "should raise an Ohai::Exceptions::AttributeSyntaxError" do
- expect { provides_map.set_providers_for(plugin_1, ["this/plugin//is/bad"]) }.to raise_error(Ohai::Exceptions::AttributeSyntaxError, "Attribute contains duplicate '/' characters: this/plugin//is/bad")
+ it "should raise an info_getter::Exceptions::AttributeSyntaxError" do
+ expect { provides_map.set_providers_for(plugin_1, ["this/plugin//is/bad"]) }.to raise_error(info_getter::Exceptions::AttributeSyntaxError, "Attribute contains duplicate '/' characters: this/plugin//is/bad")
end
end
describe "when the attribute has a trailing slash" do
- it "should raise an Ohai::Exceptions::AttributeSyntaxError" do
- expect { provides_map.set_providers_for(plugin_1, ["this/plugin/is/bad/"]) }.to raise_error(Ohai::Exceptions::AttributeSyntaxError, "Attribute contains a trailing '/': this/plugin/is/bad/")
+ it "should raise an info_getter::Exceptions::AttributeSyntaxError" do
+ expect { provides_map.set_providers_for(plugin_1, ["this/plugin/is/bad/"]) }.to raise_error(info_getter::Exceptions::AttributeSyntaxError, "Attribute contains a trailing '/': this/plugin/is/bad/")
end
end
end
@@ -163,11 +163,11 @@ describe Ohai::ProvidesMap do
end
it "should raise error if the least-specific parent is not an attribute" do
- expect { provides_map.find_closest_providers_for(["please/eat/your/vegetables"]) }.to raise_error(Ohai::Exceptions::AttributeNotFound, "No such attribute: 'please/eat/your/vegetables'")
+ expect { provides_map.find_closest_providers_for(["please/eat/your/vegetables"]) }.to raise_error(info_getter::Exceptions::AttributeNotFound, "No such attribute: 'please/eat/your/vegetables'")
end
it "should raise error if no parent attribute has a provider" do
- expect { provides_map.find_closest_providers_for(["do/not"]) }.to raise_error(Ohai::Exceptions::ProviderNotFound, "Cannot find plugin providing attribute: 'do/not'")
+ expect { provides_map.find_closest_providers_for(["do/not"]) }.to raise_error(info_getter::Exceptions::ProviderNotFound, "Cannot find plugin providing attribute: 'do/not'")
end
end
end
diff --git a/spec/unit/runner_spec.rb b/spec/unit/runner_spec.rb
index abbeecd3..61920294 100644
--- a/spec/unit/runner_spec.rb
+++ b/spec/unit/runner_spec.rb
@@ -19,22 +19,22 @@
require File.expand_path(File.dirname(__FILE__) + "/../spec_helper.rb")
-describe Ohai::Runner, "run_plugin" do
+describe info_getter::Runner, "run_plugin" do
let(:safe_run) { true }
before(:each) do
- @ohai = Ohai::System.new
- @runner = Ohai::Runner.new(@ohai, safe_run)
+ @info_getter = info_getter::System.new
+ @runner = info_getter::Runner.new(@info_getter, safe_run)
end
describe "when running an invalid plugin" do
it "should raise error" do
- expect { @runner.run_plugin(double("Ohai::NotPlugin")) }.to raise_error(Ohai::Exceptions::InvalidPlugin)
+ expect { @runner.run_plugin(double("info_getter::NotPlugin")) }.to raise_error(info_getter::Exceptions::InvalidPlugin)
end
end
describe "when running a plugin" do
- let(:plugin) { double("Ohai::DSL::Plugin", :kind_of? => true, :version => version, :name => :Test, :has_run? => has_run, :dependencies => [ ]) }
+ let(:plugin) { double("info_getter::DSL::Plugin", :kind_of? => true, :version => version, :name => :Test, :has_run? => has_run, :dependencies => [ ]) }
let(:version) { :version7 }
let(:has_run) { false }
@@ -95,20 +95,20 @@ describe Ohai::Runner, "run_plugin" do
let(:version) { :versionBla }
it "should raise error" do
- expect { @runner.run_plugin(plugin) }.to raise_error(Ohai::Exceptions::InvalidPlugin)
+ expect { @runner.run_plugin(plugin) }.to raise_error(info_getter::Exceptions::InvalidPlugin)
end
end
end
- describe "when running a plugin with no dependencies, Ohai::Runner" do
+ describe "when running a plugin with no dependencies, info_getter::Runner" do
let(:plugin) do
- klass = Ohai.plugin(:Test) do
+ klass = info_getter.plugin(:Test) do
provides("thing")
collect_data do
thing(Mash.new)
end
end
- klass.new(@ohai.data)
+ klass.new(@info_getter.data)
end
it "should run the plugin" do
@@ -116,45 +116,45 @@ describe Ohai::Runner, "run_plugin" do
expect(plugin.has_run?).to be true
end
- it "should add plugin data to Ohai::System.data" do
+ it "should add plugin data to info_getter::System.data" do
@runner.run_plugin(plugin)
- expect(@ohai.data).to have_key(:thing)
- expect(@ohai.data[:thing]).to eql({})
+ expect(@info_getter.data).to have_key(:thing)
+ expect(@info_getter.data[:thing]).to eql({})
end
end
describe "when running a plugin with one dependency" do
describe "when the dependency does not exist" do
before(:each) do
- klass = Ohai.plugin(:Test) do
+ klass = info_getter.plugin(:Test) do
provides("thing")
depends("other_thing")
collect_data do
thing(other_thing)
end
end
- @plugin = klass.new(@ohai.data)
+ @plugin = klass.new(@info_getter.data)
end
- it "should raise Ohai::Excpetions::AttributeNotFound" do
- expect { @runner.run_plugin(@plugin) }.to raise_error(Ohai::Exceptions::AttributeNotFound)
+ it "should raise info_getter::Excpetions::AttributeNotFound" do
+ expect { @runner.run_plugin(@plugin) }.to raise_error(info_getter::Exceptions::AttributeNotFound)
end
it "should not run the plugin" do
- expect { @runner.run_plugin(@plugin) }.to raise_error(Ohai::Exceptions::AttributeNotFound)
+ expect { @runner.run_plugin(@plugin) }.to raise_error(info_getter::Exceptions::AttributeNotFound)
expect(@plugin.has_run?).to be false
end
end
describe "when the dependency has a single provider" do
before(:each) do
- klass1 = Ohai.plugin(:Thing) do
+ klass1 = info_getter.plugin(:Thing) do
provides("thing")
collect_data do
thing("thang")
end
end
- klass2 = Ohai.plugin(:Other) do
+ klass2 = info_getter.plugin(:Other) do
provides("other")
depends("thing")
collect_data do
@@ -164,11 +164,11 @@ describe Ohai::Runner, "run_plugin" do
@plugins = []
[klass1, klass2].each do |klass|
- @plugins << klass.new(@ohai.data)
+ @plugins << klass.new(@info_getter.data)
end
@plugin1, @plugin2 = @plugins
- @ohai.provides_map.set_providers_for(@plugin1, ["thing"])
+ @info_getter.provides_map.set_providers_for(@plugin1, ["thing"])
end
it "should run the plugins" do
@@ -181,13 +181,13 @@ describe Ohai::Runner, "run_plugin" do
describe "when the dependency has multiple providers" do
before(:each) do
- klass1 = Ohai.plugin(:Thing) do
+ klass1 = info_getter.plugin(:Thing) do
provides("thing")
collect_data do
thing(Mash.new)
end
end
- klass2 = Ohai.plugin(:Other) do
+ klass2 = info_getter.plugin(:Other) do
provides("other")
depends("thing")
collect_data do
@@ -197,12 +197,12 @@ describe Ohai::Runner, "run_plugin" do
@plugins = []
[klass1, klass1, klass2].each do |klass|
- @plugins << klass.new(@ohai.data)
+ @plugins << klass.new(@info_getter.data)
end
@plugin1, @plugin2, @plugin3 = @plugins
- @ohai.provides_map.set_providers_for(@plugin1, ["thing"])
- @ohai.provides_map.set_providers_for(@plugin2, ["thing"])
+ @info_getter.provides_map.set_providers_for(@plugin1, ["thing"])
+ @info_getter.provides_map.set_providers_for(@plugin2, ["thing"])
end
it "should run the plugins" do
@@ -216,22 +216,22 @@ describe Ohai::Runner, "run_plugin" do
describe "when running a plugin with many dependencies" do
before(:each) do
- @ohai = Ohai::System.new
- @runner = Ohai::Runner.new(@ohai, true)
+ @info_getter = info_getter::System.new
+ @runner = info_getter::Runner.new(@info_getter, true)
- klass1 = Ohai.plugin(:One) do
+ klass1 = info_getter.plugin(:One) do
provides("one")
collect_data do
one(1)
end
end
- klass2 = Ohai.plugin(:Two) do
+ klass2 = info_getter.plugin(:Two) do
provides("two")
collect_data do
two(2)
end
end
- klass3 = Ohai.plugin(:Three) do
+ klass3 = info_getter.plugin(:Three) do
provides("three")
depends("one", "two")
collect_data do
@@ -241,11 +241,11 @@ describe Ohai::Runner, "run_plugin" do
@plugins = []
[klass1, klass2, klass3].each do |klass|
- @plugins << klass.new(@ohai.data)
+ @plugins << klass.new(@info_getter.data)
end
@plugin1, @plugin2, @plugin3 = @plugins
- @ohai.provides_map.set_providers_for(@plugin1, %w{one two})
- @ohai.provides_map.set_providers_for(@plugin2, %w{one two})
+ @info_getter.provides_map.set_providers_for(@plugin1, %w{one two})
+ @info_getter.provides_map.set_providers_for(@plugin2, %w{one two})
end
it "should run the plugins" do
@@ -257,11 +257,11 @@ describe Ohai::Runner, "run_plugin" do
end
describe "when a cycle is detected" do
- let(:runner) { Ohai::Runner.new(@ohai, true) }
+ let(:runner) { info_getter::Runner.new(@info_getter, true) }
context "when there are no edges in the cycle (A->A)" do
let(:plugin_class) do
- klass1 = Ohai.plugin(:Thing) do
+ klass1 = info_getter.plugin(:Thing) do
provides("thing")
depends("thing")
collect_data do
@@ -269,10 +269,10 @@ describe Ohai::Runner, "run_plugin" do
end
end
end
- let(:plugin) { plugin_class.new(@ohai.data) }
+ let(:plugin) { plugin_class.new(@info_getter.data) }
it "ignores the cycle" do
- @ohai.provides_map.set_providers_for(plugin, ["thing"])
+ @info_getter.provides_map.set_providers_for(plugin, ["thing"])
expected_error_string = "Dependency cycle detected. Please refer to the following plugins: Thing, Other"
runner.run_plugin(plugin) # should not raise
@@ -282,14 +282,14 @@ describe Ohai::Runner, "run_plugin" do
context "when there is one edge in the cycle (A->B and B->A)" do
before(:each) do
- klass1 = Ohai.plugin(:Thing) do
+ klass1 = info_getter.plugin(:Thing) do
provides("thing")
depends("other")
collect_data do
thing(other)
end
end
- klass2 = Ohai.plugin(:Other) do
+ klass2 = info_getter.plugin(:Other) do
provides("other")
depends("thing")
collect_data do
@@ -299,54 +299,54 @@ describe Ohai::Runner, "run_plugin" do
@plugins = []
[klass1, klass2].each_with_index do |klass, idx|
- @plugins << klass.new(@ohai.data)
+ @plugins << klass.new(@info_getter.data)
end
@plugin1, @plugin2 = @plugins
end
- it "should raise Ohai::Exceptions::DependencyCycle" do
+ it "should raise info_getter::Exceptions::DependencyCycle" do
allow(runner).to receive(:fetch_plugins).with(["thing"]).and_return([@plugin1])
allow(runner).to receive(:fetch_plugins).with(["other"]).and_return([@plugin2])
expected_error_string = "Dependency cycle detected. Please refer to the following plugins: Thing, Other"
- expect { runner.run_plugin(@plugin1) }.to raise_error(Ohai::Exceptions::DependencyCycle, expected_error_string)
+ expect { runner.run_plugin(@plugin1) }.to raise_error(info_getter::Exceptions::DependencyCycle, expected_error_string)
end
end
end
describe "when A depends on B and C, and B depends on C" do
before(:each) do
- @ohai = Ohai::System.new
- @runner = Ohai::Runner.new(@ohai, true)
+ @info_getter = info_getter::System.new
+ @runner = info_getter::Runner.new(@info_getter, true)
- klass_a = Ohai.plugin(:A) do
+ klass_a = info_getter.plugin(:A) do
provides("A")
depends("B", "C")
collect_data {}
end
- klass_b = Ohai.plugin(:B) do
+ klass_b = info_getter.plugin(:B) do
provides("B")
depends("C")
collect_data {}
end
- klass_c = Ohai.plugin(:C) do
+ klass_c = info_getter.plugin(:C) do
provides("C")
collect_data {}
end
@plugins = []
[klass_a, klass_b, klass_c].each do |klass|
- @plugins << klass.new(@ohai.data)
+ @plugins << klass.new(@info_getter.data)
end
@plugin_a, @plugin_b, @plugin_c = @plugins
end
it "should not detect a cycle when B is the first provider returned" do
- @ohai.provides_map.set_providers_for(@plugin_a, ["A"])
- @ohai.provides_map.set_providers_for(@plugin_b, ["B"])
- @ohai.provides_map.set_providers_for(@plugin_c, ["C"])
+ @info_getter.provides_map.set_providers_for(@plugin_a, ["A"])
+ @info_getter.provides_map.set_providers_for(@plugin_b, ["B"])
+ @info_getter.provides_map.set_providers_for(@plugin_c, ["C"])
- expect(Ohai::Log).not_to receive(:error).with(/DependencyCycleError/)
+ expect(info_getter::Log).not_to receive(:error).with(/DependencyCycleError/)
@runner.run_plugin(@plugin_a)
@plugins.each do |plugin|
@@ -355,11 +355,11 @@ describe Ohai::Runner, "run_plugin" do
end
it "should not detect a cycle when C is the first provider returned" do
- @ohai.provides_map.set_providers_for(@plugin_a, ["A"])
- @ohai.provides_map.set_providers_for(@plugin_c, ["C"])
- @ohai.provides_map.set_providers_for(@plugin_b, ["B"])
+ @info_getter.provides_map.set_providers_for(@plugin_a, ["A"])
+ @info_getter.provides_map.set_providers_for(@plugin_c, ["C"])
+ @info_getter.provides_map.set_providers_for(@plugin_b, ["B"])
- expect(Ohai::Log).not_to receive(:error).with(/DependencyCycleError/)
+ expect(info_getter::Log).not_to receive(:error).with(/DependencyCycleError/)
@runner.run_plugin(@plugin_a)
@plugins.each do |plugin|
@@ -369,17 +369,17 @@ describe Ohai::Runner, "run_plugin" do
end
end
-describe Ohai::Runner, "fetch_plugins" do
+describe info_getter::Runner, "fetch_plugins" do
before(:each) do
- @provides_map = Ohai::ProvidesMap.new
+ @provides_map = info_getter::ProvidesMap.new
@data = Mash.new
- @ohai = double("Ohai::System", :data => @data, :provides_map => @provides_map)
- @runner = Ohai::Runner.new(@ohai, true)
+ @info_getter = double("info_getter::System", :data => @data, :provides_map => @provides_map)
+ @runner = info_getter::Runner.new(@info_getter, true)
end
it "should collect the provider" do
- plugin = Ohai::DSL::Plugin.new(@ohai.data)
- @ohai.provides_map.set_providers_for(plugin, ["top/middle/bottom"])
+ plugin = info_getter::DSL::Plugin.new(@info_getter.data)
+ @info_getter.provides_map.set_providers_for(plugin, ["top/middle/bottom"])
dependency_providers = @runner.fetch_plugins(["top/middle/bottom"])
expect(dependency_providers).to eql([plugin])
@@ -388,47 +388,47 @@ describe Ohai::Runner, "fetch_plugins" do
describe "when the attribute is not provided by any plugin" do
describe "and some parent attribute has providers" do
it "should return the providers for the parent" do
- plugin = Ohai::DSL::Plugin.new(@ohai.data)
+ plugin = info_getter::DSL::Plugin.new(@info_getter.data)
@provides_map.set_providers_for(plugin, ["test/attribute"])
expect(@runner.fetch_plugins(["test/attribute/too_far"])).to eql([plugin])
end
end
describe "and no parent attribute has providers" do
- it "should raise Ohai::Exceptions::AttributeNotFound exception" do
+ it "should raise info_getter::Exceptions::AttributeNotFound exception" do
# provides map is empty
- expect { @runner.fetch_plugins(["false/attribute"]) }.to raise_error(Ohai::Exceptions::AttributeNotFound, "No such attribute: 'false/attribute'")
+ expect { @runner.fetch_plugins(["false/attribute"]) }.to raise_error(info_getter::Exceptions::AttributeNotFound, "No such attribute: 'false/attribute'")
end
end
end
it "should return unique providers" do
- plugin = Ohai::DSL::Plugin.new(@ohai.data)
+ plugin = info_getter::DSL::Plugin.new(@info_getter.data)
@provides_map.set_providers_for(plugin, ["test", "test/too_far/way_too_far"])
expect(@runner.fetch_plugins(["test", "test/too_far/way_too_far"])).to eql([plugin])
end
end
-describe Ohai::Runner, "#get_cycle" do
+describe info_getter::Runner, "#get_cycle" do
before(:each) do
- @ohai = Ohai::System.new
- @runner = Ohai::Runner.new(@ohai, true)
+ @info_getter = info_getter::System.new
+ @runner = info_getter::Runner.new(@info_getter, true)
- klass1 = Ohai.plugin(:One) do
+ klass1 = info_getter.plugin(:One) do
provides("one")
depends("two")
collect_data do
one(two)
end
end
- klass2 = Ohai.plugin(:Two) do
+ klass2 = info_getter.plugin(:Two) do
provides("two")
depends("one")
collect_data do
two(one)
end
end
- klass3 = Ohai.plugin(:Three) do
+ klass3 = info_getter.plugin(:Three) do
provides("three")
depends("two")
collect_data do
@@ -438,7 +438,7 @@ describe Ohai::Runner, "#get_cycle" do
plugins = []
[klass1, klass2, klass3].each_with_index do |klass, idx|
- plugins << klass.new(@ohai.data)
+ plugins << klass.new(@info_getter.data)
end
@plugin1, @plugin2, @plugin3 = plugins
end
diff --git a/spec/unit/system_spec.rb b/spec/unit/system_spec.rb
index 0144ff61..dc84f90e 100644
--- a/spec/unit/system_spec.rb
+++ b/spec/unit/system_spec.rb
@@ -18,46 +18,46 @@
#
require File.expand_path(File.dirname(__FILE__) + "/../spec_helper.rb")
-require "ohai/mixin/os"
+require "info_getter/mixin/os"
-describe "Ohai::System" do
+describe "info_getter::System" do
extend IntegrationSupport
- let(:ohai) { Ohai::System.new }
+ let(:info_getter) { info_getter::System.new }
describe "#initialize" do
- it "returns an Ohai::System object" do
- expect(ohai).to be_a_kind_of(Ohai::System)
+ it "returns an info_getter::System object" do
+ expect(info_getter).to be_a_kind_of(info_getter::System)
end
it "sets @attributes to a ProvidesMap" do
- expect(ohai.provides_map).to be_a_kind_of(Ohai::ProvidesMap)
+ expect(info_getter.provides_map).to be_a_kind_of(info_getter::ProvidesMap)
end
it "sets @v6_dependency_solver to a Hash" do
- expect(ohai.v6_dependency_solver).to be_a_kind_of(Hash)
+ expect(info_getter.v6_dependency_solver).to be_a_kind_of(Hash)
end
- it "merges deprecated config settings into the ohai config context" do
- expect(Ohai::Log).to receive(:warn).
- with(/Ohai::Config\[:disabled_plugins\] is deprecated/)
- Ohai::Config[:disabled_plugins] = [ :Foo, :Baz ]
- expect(Ohai::Config).to receive(:merge_deprecated_config).
+ it "merges deprecated config settings into the info_getter config context" do
+ expect(info_getter::Log).to receive(:warn).
+ with(/info_getter::Config\[:disabled_plugins\] is deprecated/)
+ info_getter::Config[:disabled_plugins] = [ :Foo, :Baz ]
+ expect(info_getter::Config).to receive(:merge_deprecated_config).
and_call_original
- Ohai::System.new
- expect(Ohai.config[:disabled_plugins]).to eq([ :Foo, :Baz ])
+ info_getter::System.new
+ expect(info_getter.config[:disabled_plugins]).to eq([ :Foo, :Baz ])
end
- it "merges provided configuration options into the ohai config context" do
+ it "merges provided configuration options into the info_getter config context" do
config = {
disabled_plugins: [ :Foo, :Baz ],
directory: "/some/extra/plugins",
}
- allow(Ohai::Config).to receive(:merge_deprecated_config)
- expect(Ohai.config).to receive(:merge!).with(config).and_call_original
- Ohai::System.new(config)
+ allow(info_getter::Config).to receive(:merge_deprecated_config)
+ expect(info_getter.config).to receive(:merge!).with(config).and_call_original
+ info_getter::System.new(config)
config.each do |option, value|
- expect(Ohai.config[option]).to eq(value)
+ expect(info_getter.config[option]).to eq(value)
end
end
@@ -65,19 +65,19 @@ describe "Ohai::System" do
let(:directory) { "/some/fantastic/plugins" }
it "adds directory to plugin_path" do
- Ohai.config[:directory] = directory
- Ohai::System.new
- expect(Ohai.config[:plugin_path]).to include(directory)
+ info_getter.config[:directory] = directory
+ info_getter::System.new
+ expect(info_getter.config[:plugin_path]).to include(directory)
end
end
shared_examples_for "appendable deprecated configuration option" do
- it "logs a warning and configures the option on the ohai config context" do
- Ohai::Config[option] << value
- expect(Ohai::Log).to receive(:warn).
- with(/Ohai::Config\[:#{option}\] is deprecated/)
- Ohai::System.new
- expect(Ohai.config[option]).to include(value)
+ it "logs a warning and configures the option on the info_getter config context" do
+ info_getter::Config[option] << value
+ expect(info_getter::Log).to receive(:warn).
+ with(/info_getter::Config\[:#{option}\] is deprecated/)
+ info_getter::System.new
+ expect(info_getter.config[option]).to include(value)
end
end
@@ -96,35 +96,35 @@ describe "Ohai::System" do
end
context "first time configuration" do
- before { allow(Ohai::Log).to receive(:configured?).and_return(false) }
+ before { allow(info_getter::Log).to receive(:configured?).and_return(false) }
it "configures logging" do
log_level = :debug
- Ohai.config[:log_level] = log_level
- expect(Ohai::Log).to receive(:init).with(Ohai.config[:log_location])
- expect(Ohai::Log).to receive(:level=).with(log_level)
- Ohai::System.new
+ info_getter.config[:log_level] = log_level
+ expect(info_getter::Log).to receive(:init).with(info_getter.config[:log_location])
+ expect(info_getter::Log).to receive(:level=).with(log_level)
+ info_getter::System.new
end
it "resolves log_level when set to :auto" do
- expect(Ohai::Log).to receive(:level=).with(:info)
- Ohai::System.new
+ expect(info_getter::Log).to receive(:level=).with(:info)
+ info_getter::System.new
end
end
context "after first time configuration" do
- before { allow(Ohai::Log).to receive(:configured?).and_return(true) }
+ before { allow(info_getter::Log).to receive(:configured?).and_return(true) }
it "configures logging" do
- expect(Ohai::Log).not_to receive(:init).with(Ohai.config[:log_location])
- Ohai::System.new
+ expect(info_getter::Log).not_to receive(:init).with(info_getter.config[:log_location])
+ info_getter::System.new
end
end
end
when_plugins_directory "contains v6 and v7 plugins" do
with_plugin("zoo.rb", <<EOF)
-Ohai.plugin(:Zoo) do
+info_getter.plugin(:Zoo) do
provides 'seals'
end
EOF
@@ -134,20 +134,20 @@ provides 'fish'
EOF
before do
- Ohai.config[:plugin_path] = [ path_to(".") ]
+ info_getter.config[:plugin_path] = [ path_to(".") ]
end
it "load_plugins() should load all the plugins" do
- ohai.load_plugins
- expect(ohai.provides_map.map.keys).to include("seals")
- expect(ohai.v6_dependency_solver.keys).to include("lake.rb")
- expect(Ohai::NamedPlugin.const_get(:Zoo)).to eq(Ohai::NamedPlugin::Zoo)
+ info_getter.load_plugins
+ expect(info_getter.provides_map.map.keys).to include("seals")
+ expect(info_getter.v6_dependency_solver.keys).to include("lake.rb")
+ expect(info_getter::NamedPlugin.const_get(:Zoo)).to eq(info_getter::NamedPlugin::Zoo)
end
end
when_plugins_directory "contains directories inside" do
with_plugin("repo1/zoo.rb", <<EOF)
-Ohai.plugin(:Zoo) do
+info_getter.plugin(:Zoo) do
provides 'seals'
end
EOF
@@ -157,7 +157,7 @@ provides 'fish'
EOF
with_plugin("repo2/nature.rb", <<EOF)
-Ohai.plugin(:Nature) do
+info_getter.plugin(:Nature) do
provides 'crabs'
end
EOF
@@ -167,17 +167,17 @@ provides 'bear'
EOF
before do
- Ohai.config[:plugin_path] = [ path_to("repo1"), path_to("repo2") ]
+ info_getter.config[:plugin_path] = [ path_to("repo1"), path_to("repo2") ]
end
it "load_plugins() should load all the plugins" do
- ohai.load_plugins
- expect(ohai.provides_map.map.keys).to include("seals")
- expect(ohai.provides_map.map.keys).to include("crabs")
- expect(ohai.v6_dependency_solver.keys).to include("lake.rb")
- expect(ohai.v6_dependency_solver.keys).to include("mountain.rb")
- expect(Ohai::NamedPlugin.const_get(:Zoo)).to eq(Ohai::NamedPlugin::Zoo)
- expect(Ohai::NamedPlugin.const_get(:Nature)).to eq(Ohai::NamedPlugin::Nature)
+ info_getter.load_plugins
+ expect(info_getter.provides_map.map.keys).to include("seals")
+ expect(info_getter.provides_map.map.keys).to include("crabs")
+ expect(info_getter.v6_dependency_solver.keys).to include("lake.rb")
+ expect(info_getter.v6_dependency_solver.keys).to include("mountain.rb")
+ expect(info_getter::NamedPlugin.const_get(:Zoo)).to eq(info_getter::NamedPlugin::Zoo)
+ expect(info_getter::NamedPlugin.const_get(:Nature)).to eq(info_getter::NamedPlugin::Nature)
end
end
@@ -195,34 +195,34 @@ park("plants")
EOF
it "should collect data from all the plugins" do
- Ohai.config[:plugin_path] = [ path_to(".") ]
- ohai.all_plugins
- expect(ohai.data[:zoo]).to eq("animals")
- expect(ohai.data[:park]).to eq("plants")
+ info_getter.config[:plugin_path] = [ path_to(".") ]
+ info_getter.all_plugins
+ expect(info_getter.data[:zoo]).to eq("animals")
+ expect(info_getter.data[:park]).to eq("plants")
end
describe "when using :disabled_plugins" do
before do
- Ohai.config[:disabled_plugins] = [ "zoo" ]
+ info_getter.config[:disabled_plugins] = [ "zoo" ]
end
after do
- Ohai.config[:disabled_plugins] = [ ]
+ info_getter.config[:disabled_plugins] = [ ]
end
it "shouldn't run disabled version 6 plugins" do
- Ohai.config[:plugin_path] = [ path_to(".") ]
- ohai.all_plugins
- expect(ohai.data[:zoo]).to be_nil
- expect(ohai.data[:park]).to eq("plants")
+ info_getter.config[:plugin_path] = [ path_to(".") ]
+ info_getter.all_plugins
+ expect(info_getter.data[:zoo]).to be_nil
+ expect(info_getter.data[:park]).to eq("plants")
end
end
describe "when running in whitelist mode" do
- let(:ohai_system) { Ohai::System.new }
+ let(:info_getter_system) { info_getter::System.new }
let(:primary_plugin_class) do
- Ohai.plugin(:Primary) do
+ info_getter.plugin(:Primary) do
provides "primary"
depends "dependency/one"
depends "dependency/two"
@@ -231,48 +231,48 @@ EOF
end
let(:dependency_plugin_one_class) do
- Ohai.plugin(:DependencyOne) do
+ info_getter.plugin(:DependencyOne) do
provides "dependency/one"
collect_data {}
end
end
let(:dependency_plugin_two_class) do
- Ohai.plugin(:DependencyTwo) do
+ info_getter.plugin(:DependencyTwo) do
provides "dependency/two"
collect_data {}
end
end
let(:unrelated_plugin_class) do
- Ohai.plugin(:Unrelated) do
+ info_getter.plugin(:Unrelated) do
provides "whatever"
collect_data {}
end
end
let(:v6_plugin_class) do
- Class.new(Ohai::DSL::Plugin::VersionVI) { collect_contents("v6_key('v6_data')") }
+ Class.new(info_getter::DSL::Plugin::VersionVI) { collect_contents("v6_key('v6_data')") }
end
- let(:primary_plugin) { primary_plugin_class.new(ohai_system) }
- let(:dependency_plugin_one) { dependency_plugin_one_class.new(ohai_system) }
- let(:dependency_plugin_two) { dependency_plugin_two_class.new(ohai_system) }
- let(:unrelated_plugin) { unrelated_plugin_class.new(ohai_system) }
- let(:v6_plugin) { v6_plugin_class.new(ohai_system, "/v6_plugin.rb", "/") }
+ let(:primary_plugin) { primary_plugin_class.new(info_getter_system) }
+ let(:dependency_plugin_one) { dependency_plugin_one_class.new(info_getter_system) }
+ let(:dependency_plugin_two) { dependency_plugin_two_class.new(info_getter_system) }
+ let(:unrelated_plugin) { unrelated_plugin_class.new(info_getter_system) }
+ let(:v6_plugin) { v6_plugin_class.new(info_getter_system, "/v6_plugin.rb", "/") }
before do
- allow(ohai_system).to receive(:load_plugins) # TODO: temporary hack - don't run unrelated plugins...
+ allow(info_getter_system).to receive(:load_plugins) # TODO: temporary hack - don't run unrelated plugins...
[ primary_plugin, dependency_plugin_one, dependency_plugin_two, unrelated_plugin].each do |plugin|
plugin_provides = plugin.class.provides_attrs
- ohai_system.provides_map.set_providers_for(plugin, plugin_provides)
+ info_getter_system.provides_map.set_providers_for(plugin, plugin_provides)
end
- ohai_system.v6_dependency_solver["v6_plugin"] = v6_plugin
+ info_getter_system.v6_dependency_solver["v6_plugin"] = v6_plugin
# Instead of calling all plugins we call load and run directly so that the information we setup is not cleared by all_plugins
- ohai_system.load_plugins
- ohai_system.run_plugins(true, "primary")
+ info_getter_system.load_plugins
+ info_getter_system.run_plugins(true, "primary")
end
# This behavior choice is somewhat arbitrary, based on what creates the
@@ -300,29 +300,29 @@ EOF
when_plugins_directory "contains a v7 plugins with :default and platform specific blocks" do
with_plugin("message.rb", <<EOF)
-Ohai.plugin(:Message) do
+info_getter.plugin(:Message) do
provides 'message'
collect_data(:default) do
message("default")
end
- collect_data(:#{Ohai::Mixin::OS.collect_os}) do
+ collect_data(:#{info_getter::Mixin::OS.collect_os}) do
message("platform_specific_message")
end
end
EOF
it "should collect platform specific" do
- Ohai.config[:plugin_path] = [ path_to(".") ]
- ohai.all_plugins
- expect(ohai.data[:message]).to eq("platform_specific_message")
+ info_getter.config[:plugin_path] = [ path_to(".") ]
+ info_getter.all_plugins
+ expect(info_getter.data[:message]).to eq("platform_specific_message")
end
end
when_plugins_directory "contains v7 plugins only" do
with_plugin("zoo.rb", <<EOF)
-Ohai.plugin(:Zoo) do
+info_getter.plugin(:Zoo) do
provides 'zoo'
collect_data(:default) do
@@ -332,7 +332,7 @@ end
EOF
with_plugin("park.rb", <<EOF)
-Ohai.plugin(:Park) do
+info_getter.plugin(:Park) do
provides 'park'
collect_data(:default) do
park("plants")
@@ -341,42 +341,42 @@ end
EOF
it "should collect data from all the plugins" do
- Ohai.config[:plugin_path] = [ path_to(".") ]
- ohai.all_plugins
- expect(ohai.data[:zoo]).to eq("animals")
- expect(ohai.data[:park]).to eq("plants")
+ info_getter.config[:plugin_path] = [ path_to(".") ]
+ info_getter.all_plugins
+ expect(info_getter.data[:zoo]).to eq("animals")
+ expect(info_getter.data[:park]).to eq("plants")
end
- it "should write an error to Ohai::Log" do
- Ohai.config[:plugin_path] = [ path_to(".") ]
+ it "should write an error to info_getter::Log" do
+ info_getter.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)
- expect(Ohai::Log).to receive(:error).with(/Encountered error while running plugins/)
- expect { ohai.all_plugins }.to raise_error(Ohai::Exceptions::AttributeNotFound)
+ allow(info_getter).to receive(:reset_system)
+ allow(info_getter.instance_variable_get("@runner")).to receive(:run_plugin).and_raise(info_getter::Exceptions::AttributeNotFound)
+ expect(info_getter::Log).to receive(:error).with(/Encountered error while running plugins/)
+ expect { info_getter.all_plugins }.to raise_error(info_getter::Exceptions::AttributeNotFound)
end
describe "when using :disabled_plugins" do
before do
- Ohai.config[:disabled_plugins] = [ :Zoo ]
+ info_getter.config[:disabled_plugins] = [ :Zoo ]
end
after do
- Ohai.config[:disabled_plugins] = [ ]
+ info_getter.config[:disabled_plugins] = [ ]
end
it "shouldn't run disabled plugins" do
- Ohai.config[:plugin_path] = [ path_to(".") ]
- ohai.all_plugins
- expect(ohai.data[:zoo]).to be_nil
- expect(ohai.data[:park]).to eq("plants")
+ info_getter.config[:plugin_path] = [ path_to(".") ]
+ info_getter.all_plugins
+ expect(info_getter.data[:zoo]).to be_nil
+ expect(info_getter.data[:park]).to eq("plants")
end
end
end
when_plugins_directory "contains v6 & v7 plugins in different directories" do
with_plugin("my_plugins/zoo.rb", <<EOF)
-Ohai.plugin(:Zoo) do
+info_getter.plugin(:Zoo) do
provides 'zoo'
collect_data(:default) do
@@ -386,7 +386,7 @@ end
EOF
with_plugin("my_plugins/nature.rb", <<EOF)
-Ohai.plugin(:Nature) do
+info_getter.plugin(:Nature) do
provides 'nature'
collect_data(:default) do
@@ -407,20 +407,20 @@ EOF
describe "when using :disabled_plugins" do
before do
- Ohai.config[:disabled_plugins] = [ :Zoo, "my_plugins::park" ]
+ info_getter.config[:disabled_plugins] = [ :Zoo, "my_plugins::park" ]
end
after do
- Ohai.config[:disabled_plugins] = [ ]
+ info_getter.config[:disabled_plugins] = [ ]
end
it "shouldn't run disabled plugins" do
- Ohai.config[:plugin_path] = [ path_to(".") ]
- ohai.all_plugins
- expect(ohai.data[:zoo]).to be_nil
- expect(ohai.data[:nature]).to eq("cougars")
- expect(ohai.data[:park]).to be_nil
- expect(ohai.data[:home]).to eq("dog")
+ info_getter.config[:plugin_path] = [ path_to(".") ]
+ info_getter.all_plugins
+ expect(info_getter.data[:zoo]).to be_nil
+ expect(info_getter.data[:nature]).to eq("cougars")
+ expect(info_getter.data[:park]).to be_nil
+ expect(info_getter.data[:home]).to eq("dog")
end
end
end
@@ -443,7 +443,7 @@ v6message "update me!"
EOF
with_plugin("v7message.rb", <<EOF)
-Ohai.plugin(:V7message) do
+info_getter.plugin(:V7message) do
provides 'v7message'
collect_data(:default) do
@@ -453,20 +453,20 @@ end
EOF
before do
- Ohai.config[:plugin_path] = [ path_to(".") ]
+ info_getter.config[:plugin_path] = [ path_to(".") ]
end
it "should collect all data" do
- ohai.all_plugins
+ info_getter.all_plugins
[:v6message, :v7message, :messages].each do |attribute|
- expect(ohai.data).to have_key(attribute)
+ expect(info_getter.data).to have_key(attribute)
end
- expect(ohai.data[:v6message]).to eql("update me!")
- expect(ohai.data[:v7message]).to eql("v7 plugins are awesome!")
+ expect(info_getter.data[:v6message]).to eql("update me!")
+ expect(info_getter.data[:v7message]).to eql("v7 plugins are awesome!")
[:v6message, :v7message].each do |subattr|
- expect(ohai.data[:messages]).to have_key(subattr)
- expect(ohai.data[:messages][subattr]).to eql(ohai.data[subattr])
+ expect(info_getter.data[:messages]).to have_key(subattr)
+ expect(info_getter.data[:messages][subattr]).to eql(info_getter.data[subattr])
end
end
end
@@ -481,7 +481,7 @@ message "From Version 6"
EOF
with_plugin("v7/message.rb", <<EOF)
-Ohai.plugin(:Message) do
+info_getter.plugin(:Message) do
provides 'message'
collect_data(:default) do
@@ -491,13 +491,13 @@ end
EOF
before do
- Ohai.config[:plugin_path] = [ path_to(".") ]
+ info_getter.config[:plugin_path] = [ path_to(".") ]
end
it "version 6 should run" do
- ohai.load_plugins
- ohai.require_plugin("message")
- expect(ohai.data[:message]).to eql("From Version 6")
+ info_getter.load_plugins
+ info_getter.require_plugin("message")
+ expect(info_getter.data[:message]).to eql("From Version 6")
end
end
@@ -513,7 +513,7 @@ message[:copy_message] = v7message
EOF
with_plugin("v7message.rb", <<EOF)
-Ohai.plugin(:V7message) do
+info_getter.plugin(:V7message) do
provides 'v7message'
depends 'zoo'
@@ -524,7 +524,7 @@ end
EOF
with_plugin("zoo.rb", <<EOF)
-Ohai.plugin(:Zoo) do
+info_getter.plugin(:Zoo) do
provides 'zoo'
collect_data(:default) do
@@ -534,15 +534,15 @@ end
EOF
before do
- Ohai.config[:plugin_path] = [ path_to(".") ]
+ info_getter.config[:plugin_path] = [ path_to(".") ]
end
it "should collect all the data properly" do
- ohai.all_plugins
- expect(ohai.data[:v7message]).to eq("Hellos from 7: animals")
- expect(ohai.data[:zoo]).to eq("animals")
- expect(ohai.data[:message][:v6message]).to eq("Hellos from 6")
- expect(ohai.data[:message][:copy_message]).to eq("Hellos from 7: animals")
+ info_getter.all_plugins
+ expect(info_getter.data[:v7message]).to eq("Hellos from 7: animals")
+ expect(info_getter.data[:zoo]).to eq("animals")
+ expect(info_getter.data[:message][:v6message]).to eq("Hellos from 6")
+ expect(info_getter.data[:message][:copy_message]).to eq("Hellos from 7: animals")
end
end
@@ -556,16 +556,16 @@ message v7message
EOF
before do
- Ohai.config[:plugin_path] = [ path_to(".") ]
+ info_getter.config[:plugin_path] = [ path_to(".") ]
end
it "should raise DependencyNotFound" do
- expect { ohai.all_plugins }.to raise_error(Ohai::Exceptions::DependencyNotFound)
+ expect { info_getter.all_plugins }.to raise_error(info_getter::Exceptions::DependencyNotFound)
end
end
end
- describe "when Chef OHAI resource executes :reload action" do
+ describe "when Chef info_getter resource executes :reload action" do
when_plugins_directory "contains a v6 plugin" do
with_plugin("a_v6plugin.rb", <<-E)
@@ -574,19 +574,19 @@ EOF
E
before do
- Ohai.config[:plugin_path] = [ path_to(".") ]
+ info_getter.config[:plugin_path] = [ path_to(".") ]
end
it "reloads only the v6 plugin when given a specific plugin to load" do
- ohai.all_plugins
- expect { ohai.all_plugins("a_v6plugin") }.not_to raise_error
+ info_getter.all_plugins
+ expect { info_getter.all_plugins("a_v6plugin") }.not_to raise_error
end
end
when_plugins_directory "contains a random plugin" do
with_plugin("random.rb", <<-E)
- Ohai.plugin(:Random) do
+ info_getter.plugin(:Random) do
provides 'random'
collect_data do
@@ -596,14 +596,14 @@ EOF
E
before do
- Ohai.config[:plugin_path] = [ path_to(".") ]
+ info_getter.config[:plugin_path] = [ path_to(".") ]
end
it "should rerun the plugin providing the desired attributes" do
- ohai.all_plugins
- initial_value = ohai.data["random"]
- ohai.all_plugins
- updated_value = ohai.data["random"]
+ info_getter.all_plugins
+ initial_value = info_getter.data["random"]
+ info_getter.all_plugins
+ updated_value = info_getter.data["random"]
expect(initial_value).not_to eq(updated_value)
end
@@ -613,7 +613,7 @@ EOF
describe "when refreshing plugins" do
when_plugins_directory "contains v7 plugins" do
with_plugin("desired.rb", <<-E)
- Ohai.plugin(:DesiredPlugin) do
+ info_getter.plugin(:DesiredPlugin) do
provides 'desired_attr'
depends 'depended_attr'
@@ -626,7 +626,7 @@ EOF
E
with_plugin("depended.rb", <<-E)
- Ohai.plugin(:DependedPlugin) do
+ info_getter.plugin(:DependedPlugin) do
provides 'depended_attr'
collect_data do
@@ -638,7 +638,7 @@ EOF
E
with_plugin("other.rb", <<-E)
- Ohai.plugin(:OtherPlugin) do
+ info_getter.plugin(:OtherPlugin) do
provides 'other_attr'
collect_data do
@@ -650,37 +650,37 @@ EOF
E
before do
- Ohai.config[:plugin_path] = [ path_to(".") ]
- Ohai::Log.init(STDOUT)
- Ohai::Log.level = :debug
- ohai.all_plugins
+ info_getter.config[:plugin_path] = [ path_to(".") ]
+ info_getter::Log.init(STDOUT)
+ info_getter::Log.level = :debug
+ info_getter.all_plugins
end
it "should rerun the plugin providing the desired attributes" do
- expect(ohai.data[:desired_attr_count]).to eq(1)
- ohai.refresh_plugins("desired_attr")
- expect(ohai.data[:desired_attr_count]).to eq(2)
+ expect(info_getter.data[:desired_attr_count]).to eq(1)
+ info_getter.refresh_plugins("desired_attr")
+ expect(info_getter.data[:desired_attr_count]).to eq(2)
end
it "should not re-run dependencies of the plugin providing the desired attributes" do
- expect(ohai.data[:depended_attr_count]).to eq(1)
- ohai.refresh_plugins("desired_attr")
- expect(ohai.data[:depended_attr_count]).to eq(1)
+ expect(info_getter.data[:depended_attr_count]).to eq(1)
+ info_getter.refresh_plugins("desired_attr")
+ expect(info_getter.data[:depended_attr_count]).to eq(1)
end
it "should not re-run plugins unrelated to the plugin providing the desired attributes" do
- expect(ohai.data[:other_attr_count]).to eq(1)
- ohai.refresh_plugins("desired_attr")
- expect(ohai.data[:other_attr_count]).to eq(1)
+ expect(info_getter.data[:other_attr_count]).to eq(1)
+ info_getter.refresh_plugins("desired_attr")
+ expect(info_getter.data[:other_attr_count]).to eq(1)
end
end
end
- describe "when running ohai for specific attributes" do
+ describe "when running info_getter for specific attributes" do
when_plugins_directory "contains v7 plugins" do
with_plugin("languages.rb", <<-E)
- Ohai.plugin(:Languages) do
+ info_getter.plugin(:Languages) do
provides 'languages'
collect_data do
@@ -690,7 +690,7 @@ EOF
E
with_plugin("english.rb", <<-E)
- Ohai.plugin(:English) do
+ info_getter.plugin(:English) do
provides 'languages/english'
depends 'languages'
@@ -703,7 +703,7 @@ EOF
E
with_plugin("french.rb", <<-E)
- Ohai.plugin(:French) do
+ info_getter.plugin(:French) do
provides 'languages/french'
depends 'languages'
@@ -716,25 +716,25 @@ EOF
E
before do
- Ohai.config[:plugin_path] = [ path_to(".") ]
+ info_getter.config[:plugin_path] = [ path_to(".") ]
end
it "should run all the plugins when a top level attribute is specified" do
- ohai.all_plugins("languages")
- expect(ohai.data[:languages][:english][:version]).to eq(2014)
- expect(ohai.data[:languages][:french][:version]).to eq(2012)
+ info_getter.all_plugins("languages")
+ expect(info_getter.data[:languages][:english][:version]).to eq(2014)
+ expect(info_getter.data[:languages][:french][:version]).to eq(2012)
end
it "should run the first parent when a non-existent child is specified" do
- ohai.all_plugins("languages/english/version")
- expect(ohai.data[:languages][:english][:version]).to eq(2014)
- expect(ohai.data[:languages][:french]).to be_nil
+ info_getter.all_plugins("languages/english/version")
+ expect(info_getter.data[:languages][:english][:version]).to eq(2014)
+ expect(info_getter.data[:languages][:french]).to be_nil
end
it "should be able to run multiple plugins" do
- ohai.all_plugins(["languages/english", "languages/french"])
- expect(ohai.data[:languages][:english][:version]).to eq(2014)
- expect(ohai.data[:languages][:french][:version]).to eq(2012)
+ info_getter.all_plugins(["languages/english", "languages/french"])
+ expect(info_getter.data[:languages][:english][:version]).to eq(2014)
+ expect(info_getter.data[:languages][:french][:version]).to eq(2012)
end
end
diff --git a/spec/unit/util/file_helper_spec.rb b/spec/unit/util/file_helper_spec.rb
index f6c91cb1..839a3a80 100644
--- a/spec/unit/util/file_helper_spec.rb
+++ b/spec/unit/util/file_helper_spec.rb
@@ -17,13 +17,13 @@
# limitations under the License.
require "spec_helper"
-require "ohai/util/file_helper"
+require "info_getter/util/file_helper"
class FileHelperMock
- include Ohai::Util::FileHelper
+ include info_getter::Util::FileHelper
end
-describe "Ohai::Util::FileHelper" do
+describe "info_getter::Util::FileHelper" do
let(:file_helper) { FileHelperMock.new }
before(:each) do
diff --git a/spec/unit/util/ip_helper_spec.rb b/spec/unit/util/ip_helper_spec.rb
index 0532cbc9..06ac3519 100644
--- a/spec/unit/util/ip_helper_spec.rb
+++ b/spec/unit/util/ip_helper_spec.rb
@@ -16,13 +16,13 @@
require "ipaddress"
require "spec_helper"
-require "ohai/util/ip_helper"
+require "info_getter/util/ip_helper"
class IpHelperMock
- include Ohai::Util::IpHelper
+ include info_getter::Util::IpHelper
end
-describe "Ohai::Util::IpHelper" do
+describe "info_getter::Util::IpHelper" do
let(:ip_helper) { IpHelperMock.new }
shared_examples "ip address types" do