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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6cec07d512096a25b4795721fc93e328fe27d5cd
|
4
|
+
data.tar.gz: 78e9f4ee8d880ad7c92125329f0e7cff36006d52
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
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)")
|
@@ -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
|