Skip to content
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

Fix in `split\': invalid byte sequence in US-ASCII #986

Merged
merged 1 commit into from Oct 3, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 6 additions & 4 deletions lib/veewee/provider/vmfusion/provider.rb
Expand Up @@ -22,16 +22,18 @@ def check_requirements

def fusion_version
# We ask the system profiler for all installed software
shell_results = shell_exec("system_profiler SPApplicationsDataType")
shell_results = IO.popen("system_profiler SPApplicationsDataType",
:external_encoding => Encoding::UTF_8){ |p| p.readlines }


env.logger.info("Checking version by querying the system_profiler")
env.logger.debug(shell_results.stdout)
env.logger.debug(shell_results.join(''))

if (shell_results.stdout == "")
if shell_results.empty?
ui.warn "Could not detect the exact version of vmware. assuming 5.1"
version = "5.1"
else
version = shell_results.stdout.split(/VMware/)[1].split(/\n/)[2].split(/:/)[1].strip
version = shell_results.join('').split(/VMware/)[1].split(/\n/)[2].split(/:/)[1].strip
end

return version
Expand Down