vagrant-windows-domain 1.1.8 → 1.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5b4d4875a6881aa9302b991ca98ca530ba0c2387
4
- data.tar.gz: b43d80f3309032da02801d7ca249cc4b08671743
3
+ metadata.gz: 6cec07d512096a25b4795721fc93e328fe27d5cd
4
+ data.tar.gz: 78e9f4ee8d880ad7c92125329f0e7cff36006d52
5
5
  SHA512:
6
- metadata.gz: 59121ad5e5524c081892f311c7a515443fd22520c906bff36dc027e00f0bb1f01e1e9e0aa42f7c65056c286401f294fdf7375ed3bbb0fde6985c397f95b81476
7
- data.tar.gz: 8646823778f6fb96f14b0425908fdadcbfb0e8cf111ca9a2ca86eb905fef9d5b321e86e792fc5f2f7ae78862befb2f0b1b9cba416de56a45f6f882789c6a123c
6
+ metadata.gz: 64dc44b47c9cc66955f78064eb637a87745a501497c8ed6ef72df5edaf761352861e2c17bf4f643dfcc08ce170f1869fdf3d66b74d0ea5e88823efefb8666570
7
+ data.tar.gz: fc7cf4dc6056c95465635ed4f2c0daaacc2f7dcce3b5f66aa7c0ad17795afa620f7f73696cb12692864db94a91c4c8cdc2499ebfe368b50d109e099487362c8c
@@ -46,11 +46,11 @@ module VagrantPlugins
46
46
  @logger.debug("Machine not created, nothing to do")
47
47
  elsif [:running].include? @machine.state.id
48
48
  answer = @machine.env.ui.ask("Are you sure you want to destroy this machine and disconnect from #{@config.domain}? (y/n)")
49
- if answer.downcase == 'y'
50
- env[:force_confirm_destroy] = true # Prevent the popup dialog again
51
- @logger.debug("Valid configuration detected, triggering leave domain action")
52
- @provisioner.destroy
53
- end
49
+ return unless answer.downcase == 'y' # Bail out of destroy and prevent middleware from continuing on
50
+
51
+ env[:force_confirm_destroy] = true # Prevent the popup dialog again
52
+ @logger.debug("Valid configuration detected, triggering leave domain action")
53
+ @provisioner.destroy
54
54
  else
55
55
  @machine.env.ui.say(:warn, "Machine is currently not running. To properly leave the #{@config.domain} network the machine needs to be running and connected to the network in which it was provisioned. Please run `vagrant up` and then `vagrant destroy`.\n")
56
56
  answer = @machine.env.ui.ask("Would you like to continue destroying this machine, leaving this machine orphaned in the '#{@config.domain}' network? (y/n)")
@@ -1,5 +1,5 @@
1
1
  module Vagrant
2
2
  module WindowsDomain
3
- VERSION = "1.1.8"
3
+ VERSION = "1.1.9"
4
4
  end
5
5
  end
@@ -60,6 +60,17 @@ describe VagrantPlugins::WindowsDomain::LeaveDomain do
60
60
  subject.call(env)
61
61
 
62
62
  end
63
+
64
+ it "should not continue if the user declines to destroy the machine" do
65
+ state = double("state", id: :running)
66
+ expect(provisioner).to_not receive(:destroy)
67
+
68
+ expect(ui).to receive(:ask).with("Are you sure you want to destroy this machine and disconnect from #{domain}? (y/n)").and_return("n")
69
+ expect(machine).to receive(:state).and_return(state).twice
70
+ expect(app).to_not receive(:call).with(env)
71
+ subject.call(env)
72
+
73
+ end
63
74
  end
64
75
 
65
76
  context "when machine is :paused, :saved or :poweroff" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-windows-domain
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.8
4
+ version: 1.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Fellows