summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2021-02-23 09:17:57 -0800
committerGitHub <noreply@github.com>2021-02-23 09:17:57 -0800
commit48c0eb31d121ac9c479d25851d86324024a7eea7 (patch)
tree3769bf8c8b508248aa5430393888b05ed9cf67ce
parentc10d431d34e3316fc9501c01f2ecff032fa39ff1 (diff)
parent1258347af1b7442d01da46c4d471f20403ed8dd5 (diff)
downloadohai-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.rb14
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