vagrant-mos 0.9.27 → 0.9.28

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: 69dfdf869d50ee3fdc0750f3ec2adf73158b6d48
4
- data.tar.gz: 44b91937be73a62e8315f7d514899415a74c4f21
3
+ metadata.gz: 50438c454c86b6819ddb507eed8659d514b939b0
4
+ data.tar.gz: f0d9d722af20b7c269a1a3f03028b3d35464c302
5
5
  SHA512:
6
- metadata.gz: 28d2d3ab07aeec2ae452a93e90b24c1391c5edece0867a37ec247775f0cceb72f2def6ab2ffbe5435aa75b41befe65551b6aa8837b845a3137ae4070b366e4bb
7
- data.tar.gz: 0a1b58af1796cb11699670dfaf32ea713a31daad499ae566a6520f6301ea06f1b890e1a7555b0e47994430b71401ed7571d1c83f954cfb3fad88b7ef9eeb7810
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
- @ami_id = ami_response.data[:body]["imageId"]
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 => Fog::Errors::TimeoutError, :tries => tries) do
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 Fog::Errors::TimeoutError
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
- =end
110
+
111
+
112
+
102
113
  rescue MOS::Error => e
103
114
  raise Errors::MosError, :message => e.message
104
115
  end
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module MOS
3
- VERSION = '0.9.27'
3
+ VERSION = '0.9.28'
4
4
  end
5
5
  end
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: |-
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.27
4
+ version: 0.9.28
5
5
  platform: ruby
6
6
  authors:
7
7
  - yangcs2009