Skip to content

Commit

Permalink
Release v1.7.4
Browse files Browse the repository at this point in the history
* master:
  Bump version to 1.7.4
  Update changelog
  Replace special characters in synced folder id
  Handle "paused" VM state for up and halt actions
  Make `start` action run provisioners if VM is running
  • Loading branch information
legal90 committed Apr 20, 2017
2 parents 94a5cc5 + dcd1f78 commit 949bee5
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 13 deletions.
15 changes: 14 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,28 @@
## 1.7.4 (April 20, 2017)
IMPROVEMENTS:
- Make start action (`"vagrant up"`) run provisioners if VM is running.
[[GH-294](https://github.com/Parallels/vagrant-parallels/pull/294)]

BUG FIXES:
- Properly handle `"paused"` VM state for up and halt actions.
[[GH-295](https://github.com/Parallels/vagrant-parallels/pull/295)]
- synced_folder: Escape special characters in Windows-specific guest paths.
[[GH-296](https://github.com/Parallels/vagrant-parallels/pull/296)]


## 1.7.3 (February 28, 2017)
BUG FIXES:
- Fix exceptions related to `nokogiri` gem.
[[GH-291](https://github.com/Parallels/vagrant-parallels/issues/291)],
[[GH-292](https://github.com/Parallels/vagrant-parallels/issues/292)]


## 1.7.2 (December 16, 2016)
BUG FIXES:
- Fix Parallels Tools update in Linux guests. Call `ptiagent-cmd` with `--install`,
not `--info`. [[GH-286](https://github.com/Parallels/vagrant-parallels/pull/286)]


## 1.7.1 (December 7, 2016)
FEATURES:
- **Guest capability for installing Parallels Tools in Windows.** Now it is
Expand Down Expand Up @@ -84,7 +98,6 @@ BUG FIXES:


## 1.6.0 (December 24, 2015)

BREAKING CHANGES:

- The required Vagrant version is **1.8** or higher. It is caused by changes
Expand Down
26 changes: 16 additions & 10 deletions lib/vagrant-parallels/action.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,8 @@ def self.action_halt
next
end

b1.use Call, IsState, :suspended do |env2, b2|
if env2[:result]
b2.use Resume
end
end
# Resume/Unpause the VM if needed.
b1.use Resume

b1.use Call, GracefulHalt, :stopped, :running do |env2, b2|
if !env2[:result]
Expand Down Expand Up @@ -277,22 +274,31 @@ def self.action_start
Vagrant::Action::Builder.new.tap do |b|
b.use BoxCheckOutdated
b.use Call, IsState, :running do |env1, b1|
# If the VM is running, then our work here is done, exit
# If the VM is running, run the necessary provisioners
if env1[:result]
b1.use Message, I18n.t('vagrant_parallels.commands.common.vm_already_running')
action_provision
next
end

b1.use Call, IsState, :suspended do |env2, b2|
if env2[:result]
# The VM is suspended, so just resume it
# The VM is suspended, go to resume
b2.use action_resume
next
end

# The VM is not saved, so we must have to boot it up
# like normal. Boot!
b2.use action_boot
b2.use Call, IsState, :paused do |env3, b3|
if env3[:result]
# The VM is paused, just run the Resume action to unpause it
b3.use Resume
next
end

# The VM is not suspended or paused, so we must have to
# boot it up like normal. Boot!
b3.use action_boot
end
end
end
end
Expand Down
4 changes: 4 additions & 0 deletions lib/vagrant-parallels/action/resume.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@ def initialize(app, env)
def call(env)
current_state = env[:machine].state.id

# Driver method "resume" works for suspended and paused state as well
if current_state == :suspended
env[:ui].info I18n.t('vagrant.actions.vm.resume.resuming')
env[:machine].provider.driver.resume
elsif current_state == :paused
env[:ui].info I18n.t('vagrant.actions.vm.resume.unpausing')
env[:machine].provider.driver.resume
end

@app.call(env)
Expand Down
3 changes: 2 additions & 1 deletion lib/vagrant-parallels/synced_folder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ def driver(machine)
end

def os_friendly_id(id)
id.gsub(/[\/:]/,'_').sub(/^_/, '')
# Replace chars *, ", :, <, >, ?, |, /, \
id.gsub(/[*":<>?|\/\\]/,'_').sub(/^_/, '')
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/vagrant-parallels/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module VagrantPlugins
module Parallels
VERSION = '1.7.3'
VERSION = '1.7.4'
end
end

0 comments on commit 949bee5

Please sign in to comment.