vagrant-mos 0.9.31 → 0.9.32

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
  SHA1:
3
- metadata.gz: 93ab9fd68b5306a6f3a166b806149ce4cd78c10f
4
- data.tar.gz: cb34d332c1407496841814b049ca4d98e36a3f1c
3
+ metadata.gz: 1807abec6cd8938e53bcf04896a0b8c1644cedd9
4
+ data.tar.gz: 12170589079888dc3eb0e1ed728464af5921cc33
5
5
  SHA512:
6
- metadata.gz: 23bb577d084db0e0542da86bbb880d3563c495785b5745db880ff0c2a9bfdb2841956fcfe1d03a9fccd2cff3b8fc9e1ec5a0492827de275b3c6ddc083e23a86f
7
- data.tar.gz: cf11b66202bf4563e1378ac24450b44218d88e4897a4c943970e110c4689f2277efe8f55d573a2eb8ec0d5e0af0d2457c78c83e349f876556080c797355ecfe9
6
+ metadata.gz: 8ab090cc189cdffbee5fe7de3067cb540466b38d11521ef62107827ae06792b082555edf62c0e2172031187dccba9400ef76de6595e8baf5d39a02c395f7c316
7
+ data.tar.gz: d1c6acb4441885dda5f768728f1316d2fd699c91aa5b8b892200f0c34b161ab6082688c60493ed41c09036e95aebe8ce25c3914fc5bdb054ea8241f468bfaa1f
@@ -8,7 +8,7 @@ module VagrantPlugins
8
8
  module Action
9
9
  # This action packages a running mos-based server into an
10
10
  # mos-based vagrant box. It does so by burning the associated
11
- # vagrant-mos server instance, into an template via fog. Upon
11
+ # vagrant-mos server instance, into an template via mos sdk API. Upon
12
12
  # successful template burning, the action will create a .box tarball
13
13
  # writing a Vagrantfile with the fresh template id into it.
14
14
 
@@ -40,22 +40,11 @@ module VagrantPlugins
40
40
  # This block attempts to burn the server instance into an template
41
41
  begin
42
42
  # Get the server object for given machine
43
- #server = env[:mos_compute].servers.get(env[:machine].id)
44
43
  server = (env[:mos_compute].describe_instances([env[:machine].id]))["Instance"]
45
44
 
46
45
  env[:ui].info(I18n.t("vagrant_mos.packaging_instance", :instance_id => server["instanceId"]))
47
46
 
48
-
49
- result =env[:mos_compute].create_template(server["instanceId"], "template_name", "template_notes")
50
-
51
-
52
-
53
-
54
- # Make the request to MOS to create an template from machine's instance
55
- #ami_response = server.service.create_image server.id, "#{server.tags["Name"]} Package - #{Time.now.strftime("%Y%m%d-%H%M%S")}", ""
56
-
57
- # Find ami id
58
- # @ami_id = ami_response.data[:body]["imageId"]
47
+ result =env[:mos_compute].create_template(server["instanceId"], "template_name-#{Time.now.strftime("%Y%m%d-%H%M%S")}")
59
48
 
60
49
  # Attempt to burn the mos instance into an template within timeout
61
50
  env[:metrics]["instance_ready_time"] = Util::Timer.time do
@@ -65,38 +54,18 @@ module VagrantPlugins
65
54
  region_config = env[:machine].provider_config.get_region_config(region)
66
55
  tries = region_config.instance_package_timeout / 2
67
56
 
68
- #env[:ui].info(I18n.t("vagrant_mos.burning_ami", :ami_id => @ami_id))
69
-
70
- # Check the status of the template every 2 seconds until the ami burn timeout has been reached
57
+ # Check the result of the create_template every 2 seconds until the template burn timeout has been reached
71
58
  begin
72
59
  retryable(:on => Errors::InstancePackageTimeout, :tries => tries) do
73
60
  # If we're interrupted don't worry about waiting
74
61
  next if env[:interrupted]
75
62
 
76
- # Need to update the ami_obj on each cycle
77
- #ami_obj = server.service.images.get(@ami_id)
78
-
79
63
  # Wait for the server to be ready, raise error if timeout reached
80
64
  if(result["return"] == "True")
81
65
  break
82
66
  else
83
67
  sleep(2)
84
68
  end
85
-
86
-
87
- =begin
88
- server.wait_for(2) {
89
- if ami_obj.state == "failed"
90
- raise Errors::InstancePackageError,
91
- ami_id: ami_obj.id,
92
- err: ami_obj.state
93
- return
94
- else
95
- # Successful template burn will result in true here
96
- ami_obj.ready?
97
- end
98
- }
99
- =end
100
69
  end
101
70
  rescue Errors::InstancePackageTimeout
102
71
  # Notify the user upon timeout
@@ -107,9 +76,6 @@ module VagrantPlugins
107
76
 
108
77
  env[:ui].info(I18n.t("vagrant_mos.packaging_instance_complete", :time_seconds => env[:metrics]["instance_ready_time"].to_i))
109
78
 
110
-
111
-
112
-
113
79
  rescue Exception => e
114
80
  raise Errors::MosError, :message => e.message
115
81
  end
@@ -207,8 +173,6 @@ module VagrantPlugins
207
173
  def template_root
208
174
  MOS.source_root.join("templates")
209
175
  end
210
-
211
-
212
176
  end
213
177
  end
214
178
  end
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module MOS
3
- VERSION = '0.9.31'
3
+ VERSION = '0.9.32'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-mos
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.31
4
+ version: 0.9.32
5
5
  platform: ruby
6
6
  authors:
7
7
  - yangcs2009