diff options
author | Tim Smith <tsmith@chef.io> | 2019-06-11 20:57:01 -0700 |
---|---|---|
committer | Tim Smith <tsmith@chef.io> | 2019-06-11 20:57:01 -0700 |
commit | b881d30096dc8bd81687b49136b3afe06767a66f (patch) | |
tree | 9197365aaff809286b6f8721bd8cf674b2e0971e | |
parent | 1d6214f9907524928d6e5702c64ea7a367cc580b (diff) | |
download | ohai-simpler_vbox.tar.gz |
Simplify how we detect vbox hosts as wellsimpler_vbox
Just rely on the existing ohai data
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r-- | lib/ohai/plugins/vbox_host.rb | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/lib/ohai/plugins/vbox_host.rb b/lib/ohai/plugins/vbox_host.rb index b78047ee..f1657dd2 100644 --- a/lib/ohai/plugins/vbox_host.rb +++ b/lib/ohai/plugins/vbox_host.rb @@ -21,11 +21,7 @@ Ohai.plugin(:VboxHost) do # determine if this host is configured with virtualbox or not # the determination is ultimately controlled by the "virtualization" plugin def vbox_host? - host = false - if !virtualization.nil? && (virtualization["system"] == "vbox" || virtualization["systems"]["vbox"] == "host") - host = true if which("VBoxManage") - end - host + virtualization.dig("systems", "vbox") == "host" end # query virtualbox for each configured vm, as well as |