Attempt to read guest additions version from showvminfo [GH-1575]

This commit is contained in:
Mitchell Hashimoto 2013-04-22 20:38:57 -07:00
parent efcb25693e
commit d8ff2cb5ad
2 changed files with 9 additions and 0 deletions

View File

@ -12,6 +12,8 @@ IMPROVEMENTS:
- Better locking around handling the `box_url` parameter for
parallel providers.
- Solaris guest is now properly detected on SmartOS, OmniOS, etc. [GH-1639]
- Guest addition version detection is more robust, attempting other
routes to get the version, and also retrying a few times. [GH-1575]
BUG FIXES:

View File

@ -264,6 +264,13 @@ module VagrantPlugins
return value.split("_").first
end
# If we can't get the guest additions version by guest property, try
# to get it from the VM info itself.
info = execute("showvminfo", @uuid, "--machinereadable", :retryable => true)
info.split("\n").each do |line|
return $1.to_s if line =~ /^GuestAdditionsVersion="(.+?)"$/
end
return nil
end