diff options
author | Tim Smith <tsmith@chef.io> | 2021-02-23 09:17:57 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-23 09:17:57 -0800 |
commit | 48c0eb31d121ac9c479d25851d86324024a7eea7 (patch) | |
tree | 3769bf8c8b508248aa5430393888b05ed9cf67ce | |
parent | c10d431d34e3316fc9501c01f2ecff032fa39ff1 (diff) | |
parent | 1258347af1b7442d01da46c4d471f20403ed8dd5 (diff) | |
download | ohai-48c0eb31d121ac9c479d25851d86324024a7eea7.tar.gz |
Merge pull request #1625 from chef/fix_hab_ohai
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r-- | lib/ohai/plugins/habitat.rb | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/ohai/plugins/habitat.rb b/lib/ohai/plugins/habitat.rb index 7a50a2c0..e62838ad 100644 --- a/lib/ohai/plugins/habitat.rb +++ b/lib/ohai/plugins/habitat.rb @@ -61,11 +61,13 @@ Ohai.plugin(:Habitat) do end collect_data(:default) do - return unless habitat_binary - - habitat Mash.new - habitat["version"] = fetch_habitat_version - habitat["packages"] = fetch_habitat_packages - habitat["services"] = fetch_habitat_services + if habitat_binary + habitat Mash.new + habitat["version"] = fetch_habitat_version + habitat["packages"] = fetch_habitat_packages + habitat["services"] = fetch_habitat_services + else + logger.trace("Plugin Habitat: Could not find hab binary. Skipping plugin.") + end end end |