vagrant-packet 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 215466bb44bc21972757b4a477870d4cfcd06f36050f9b2fab97145fd929f508
|
4
|
+
data.tar.gz: 2828be49bd71c3125528a7112e6f8018a5a6a9b2e58751a4f344165aad0ece2c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5b4aad1cba63a52193490dfc7a75fd167d7d091f0554fc2f1726dea401ebf2d1313c97894b2c711c40cb48bb368f9381e3e8bc2f934d22110aa2e933cbac0c80
|
7
|
+
data.tar.gz: 2fbc46596517976adc542aa971c91e5453f4eb906f58f4681be85650f8b66edbfebe74ddf8c8d0b551b0ff2c1ac8fe6d9dd2ce2f73a2802b94177d22f46bbd34
|
@@ -14,6 +14,10 @@ module VagrantPlugins
|
|
14
14
|
class RunInstance
|
15
15
|
include Vagrant::Util::Retryable
|
16
16
|
|
17
|
+
FOG_ERRORS = [
|
18
|
+
Fog::Errors::Error
|
19
|
+
].freeze
|
20
|
+
|
17
21
|
def initialize(app, _env)
|
18
22
|
@app = app
|
19
23
|
@logger = Log4r::Logger.new('vagrant_packet::action::run_instance')
|
@@ -56,7 +60,7 @@ module VagrantPlugins
|
|
56
60
|
|
57
61
|
begin
|
58
62
|
server = env[:packet_compute].devices.create(options)
|
59
|
-
rescue *
|
63
|
+
rescue *FOG_ERRORS => e
|
60
64
|
# TODO: Flesh this out, mostly delete everything about the instance
|
61
65
|
raise Errors::FogError, message: e.message
|
62
66
|
end
|
@@ -18,8 +18,12 @@ module VagrantPlugins
|
|
18
18
|
|
19
19
|
# Destroy the server and remove the tracking ID
|
20
20
|
env[:ui].info(I18n.t('vagrant_packet.terminating'))
|
21
|
-
|
22
|
-
|
21
|
+
begin
|
22
|
+
server.destroy
|
23
|
+
env[:machine].id = nil
|
24
|
+
rescue Exception => e
|
25
|
+
env[:ui].info(I18n.t('vagrant_packet.terminate_while_provisioning'))
|
26
|
+
end
|
23
27
|
|
24
28
|
@app.call(env)
|
25
29
|
end
|
data/locales/en.yml
CHANGED
@@ -22,6 +22,9 @@ en:
|
|
22
22
|
Stopping the instance...
|
23
23
|
terminating: |-
|
24
24
|
Terminating the instance...
|
25
|
+
terminate_while_provisioning: |-
|
26
|
+
Cannot destroy a machine while provisioning.
|
27
|
+
Wait for provisioning to finish then try again.
|
25
28
|
waiting_for_ready: |-
|
26
29
|
Waiting for instance to become "ready"...
|
27
30
|
waiting_for_ssh: |-
|