Skip to content

Commit

Permalink
Release v1.3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
legal90 committed May 28, 2015
2 parents 7588045 + e8b4644 commit 1e07d57
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
1 change: 1 addition & 0 deletions lib/vagrant-parallels/driver/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def initialize

@prlctl_path = util_path('prlctl')
@prlsrvctl_path = util_path('prlsrvctl')
@prldisktool_path = util_path('prl_disk_tool')

if !@prlctl_path
# This means that Parallels Desktop was not found, so we raise this
Expand Down
16 changes: 8 additions & 8 deletions lib/vagrant-parallels/driver/pd_8.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def compact(uuid)
name.start_with? 'hdd'
end
used_drives.each_value do |drive_params|
execute('prl_disk_tool', 'compact', '--hdd', drive_params['image']) do |type, data|
execute(@prldisktool_path, 'compact', '--hdd', drive_params['image']) do |type, data|
lines = data.split("\r")
# The progress of the compact will be in the last line. Do a greedy
# regular expression to find what we're looking for.
Expand Down Expand Up @@ -168,9 +168,9 @@ def export(path, tpl_name)
end

def halt(force=false)
args = ['prlctl', 'stop', @uuid]
args = ['stop', @uuid]
args << '--kill' if force
execute(*args)
execute_prlctl(*args)
end

def import(tpl_name)
Expand Down Expand Up @@ -447,7 +447,7 @@ def regenerate_src_uuid
end

def register(pvm_file)
args = ['prlctl', 'register', pvm_file]
args = [@prlctl_path, 'register', pvm_file]

3.times do
result = raw(*args)
Expand All @@ -465,7 +465,7 @@ def register(pvm_file)
# If we reach this point, it means that we consistently got the
# failure, do a standard execute now. This will raise an
# exception if it fails again.
execute(*args)
execute_prlctl(*args)
end

def registered?(uuid)
Expand Down Expand Up @@ -516,7 +516,7 @@ def suspend
end

def unregister(uuid)
args = ['prlctl', 'unregister', uuid]
args = [@prlctl_path, 'unregister', uuid]
3.times do
result = raw(*args)
# Exit if everything is OK
Expand All @@ -534,7 +534,7 @@ def unregister(uuid)
# If we reach this point, it means that we consistently got the
# failure, do a standard execute now. This will raise an
# exception if it fails again.
execute(*args)
execute_prlctl(*args)
end

def unshare_folders(names)
Expand All @@ -545,7 +545,7 @@ def unshare_folders(names)

def vm_exists?(uuid)
5.times do |i|
result = raw('prlctl', 'list', uuid)
result = raw(@prlctl_path, 'list', uuid)
return true if result.exit_code == 0

# Sometimes this happens. In this case, retry. If
Expand Down
1 change: 1 addition & 0 deletions test/unit/support/shared/parallels_context.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def subprocess_result(options={})
# Consider that 'prlctl' and 'prlsrvctl' binaries are available
allow(Vagrant::Util::Which).to receive(:which).with('prlctl').and_return('prlctl')
allow(Vagrant::Util::Which).to receive(:which).with('prlsrvctl').and_return('prlsrvctl')
allow(Vagrant::Util::Which).to receive(:which).with('prl_disk_tool').and_return('prl_disk_tool')

# we don't want unit tests to ever run commands on the system; so we wire
# in a double to ensure any unexpected messages raise exceptions
Expand Down

0 comments on commit 1e07d57

Please sign in to comment.