vagrant-mos 0.9.27 → 0.9.28
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 +4 -4
- data/lib/vagrant-mos/action/package_instance.rb +20 -9
- data/lib/vagrant-mos/version.rb +1 -1
- data/locales/en.yml +4 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 50438c454c86b6819ddb507eed8659d514b939b0
|
|
4
|
+
data.tar.gz: f0d9d722af20b7c269a1a3f03028b3d35464c302
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 014f8f91d0bb469b5f401a95fbaf918e4e790fe578a630146c49a727cb3544ae64684c7f7eeeb329dedf67cc392408ed7677e58a6ae2b92652b2403af5f0122b
|
|
7
|
+
data.tar.gz: 8ea015283ba929263aea470757be86ac58cb823f5553eff21f7b7466569042dcf44c0b620d9a2ac5250b5a8fd3ffc252655e1d6d16ce4f12b904002cd1249a3c
|
|
@@ -46,17 +46,16 @@ module VagrantPlugins
|
|
|
46
46
|
env[:ui].info(I18n.t("vagrant_mos.packaging_instance", :instance_id => server["instanceId"]))
|
|
47
47
|
|
|
48
48
|
|
|
49
|
-
env[:mos_compute].create_template(server["instanceId"], "template_name", "template_notes")
|
|
49
|
+
result =env[:mos_compute].create_template(server["instanceId"], "template_name", "template_notes")
|
|
50
50
|
|
|
51
51
|
|
|
52
|
-
=begin
|
|
53
52
|
|
|
54
53
|
|
|
55
54
|
# Make the request to MOS to create an template from machine's instance
|
|
56
|
-
ami_response = server.service.create_image server.id, "#{server.tags["Name"]} Package - #{Time.now.strftime("%Y%m%d-%H%M%S")}", ""
|
|
55
|
+
#ami_response = server.service.create_image server.id, "#{server.tags["Name"]} Package - #{Time.now.strftime("%Y%m%d-%H%M%S")}", ""
|
|
57
56
|
|
|
58
57
|
# Find ami id
|
|
59
|
-
|
|
58
|
+
# @ami_id = ami_response.data[:body]["imageId"]
|
|
60
59
|
|
|
61
60
|
# Attempt to burn the mos instance into an template within timeout
|
|
62
61
|
env[:metrics]["instance_ready_time"] = Util::Timer.time do
|
|
@@ -66,18 +65,26 @@ module VagrantPlugins
|
|
|
66
65
|
region_config = env[:machine].provider_config.get_region_config(region)
|
|
67
66
|
tries = region_config.instance_package_timeout / 2
|
|
68
67
|
|
|
69
|
-
env[:ui].info(I18n.t("vagrant_mos.burning_ami", :ami_id => @ami_id))
|
|
68
|
+
#env[:ui].info(I18n.t("vagrant_mos.burning_ami", :ami_id => @ami_id))
|
|
70
69
|
|
|
71
70
|
# Check the status of the template every 2 seconds until the ami burn timeout has been reached
|
|
72
71
|
begin
|
|
73
|
-
retryable(:on =>
|
|
72
|
+
retryable(:on => Errors::TimeoutError, :tries => tries) do
|
|
74
73
|
# If we're interrupted don't worry about waiting
|
|
75
74
|
next if env[:interrupted]
|
|
76
75
|
|
|
77
76
|
# Need to update the ami_obj on each cycle
|
|
78
|
-
ami_obj = server.service.images.get(@ami_id)
|
|
77
|
+
#ami_obj = server.service.images.get(@ami_id)
|
|
79
78
|
|
|
80
79
|
# Wait for the server to be ready, raise error if timeout reached
|
|
80
|
+
if(result["return"] == "True")
|
|
81
|
+
break
|
|
82
|
+
else
|
|
83
|
+
sleep(2)
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
=begin
|
|
81
88
|
server.wait_for(2) {
|
|
82
89
|
if ami_obj.state == "failed"
|
|
83
90
|
raise Errors::InstancePackageError,
|
|
@@ -89,16 +96,20 @@ module VagrantPlugins
|
|
|
89
96
|
ami_obj.ready?
|
|
90
97
|
end
|
|
91
98
|
}
|
|
99
|
+
=end
|
|
92
100
|
end
|
|
93
|
-
rescue
|
|
101
|
+
rescue Errors::TimeoutError
|
|
94
102
|
# Notify the user upon timeout
|
|
95
103
|
raise Errors::InstancePackageTimeout,
|
|
96
104
|
timeout: region_config.instance_package_timeout
|
|
97
105
|
end
|
|
98
106
|
end
|
|
107
|
+
|
|
99
108
|
env[:ui].info(I18n.t("vagrant_mos.packaging_instance_complete", :time_seconds => env[:metrics]["instance_ready_time"].to_i))
|
|
100
109
|
|
|
101
|
-
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
|
|
102
113
|
rescue MOS::Error => e
|
|
103
114
|
raise Errors::MosError, :message => e.message
|
|
104
115
|
end
|
data/lib/vagrant-mos/version.rb
CHANGED
data/locales/en.yml
CHANGED
|
@@ -10,6 +10,10 @@ en:
|
|
|
10
10
|
This can sometimes result in not being able to access your instance.
|
|
11
11
|
not_created: |-
|
|
12
12
|
Instance is not created. Please run `vagrant up` first.
|
|
13
|
+
packaging_instance: |-
|
|
14
|
+
Burning instance %{instance_id} into a template
|
|
15
|
+
packaging_instance_complete: |-
|
|
16
|
+
Burn was successful in %{time_seconds}s
|
|
13
17
|
ready: |-
|
|
14
18
|
Machine is booted and ready for use!
|
|
15
19
|
rsync_not_found_warning: |-
|