-
Notifications
You must be signed in to change notification settings - Fork 452
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Only poll vmware attributes when on vmware #662
Conversation
Tested on Azure and we no longer get a pile of empty attributes. Tested on vmware fusion with both the compiled vmware tools and the open tools available via apt and both do what you'd expect. |
vmware[param] = from_cmd("#{vmtools_path} stat #{param}") | ||
if vmware[param] =~ /UpdateInfo failed/ | ||
vmware[param] = nil | ||
if virtualization[:systems][:vmware] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can avoid indenting the entirety of this method by pairing this check with the call to the method:
collect_data(:linux) do
get_vm_attributes("/usr/bin/vmware-toolbox-cmd") if virtualization[:systems][:vmware]
end
LGTM. (#662 (comment) is only a suggestion) |
This prevents an empty vmware hash with nil values being created on azure where the vmware tools are on the ubuntu image.
Much simpler. Rebased with that @mcquin |
Awesome. Looks good! |
👍 |
Only poll vmware attributes when on vmware
This will prevent Azure guests that contain the vmware toolbox CLI from being identified as vmware hosts. We shouldn't even try to grab vmware values unless dmidecode has identified the host as vmware. Added specs for when the CLI is missing and when we're not running on vmware.