vagrant-mos 0.8.39 → 0.8.40

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: 85bd30d629283d5378c69d309a9ea3e3eb7075b2
4
- data.tar.gz: 671f334329aea2f098eda2fb74a859caa7a747f6
3
+ metadata.gz: 67e38e4955ab94f5e0ecb0b51b44c2fbc3437487
4
+ data.tar.gz: 836c2b90ec9d3a107085a5a61bcafd8bc0631176
5
5
  SHA512:
6
- metadata.gz: b1ff908576122f9cead295aabec74626a8283cf76de8c0d75cdebed292bf2f04ecd71a1bb5909979aa70b18c17cbe949cdbba86153357353dbe247d66dd1f030
7
- data.tar.gz: 6c7ab7b9f194d9a58801976fa483fabd1b80a49f16e10dea2d6ee1c2c7a3c474ef18db17ff21e4d37fca181f39b83604e1270e1129122b927fc7c6d12d4c1472
6
+ metadata.gz: c6b17d9d13e8f846458b8d1b40dbcca4284ab43842fe376fd1356ec092499915fe0b1084428c162d7b3a315d3a77e9c760f2b860a9285dd552e3cc074c0023b6
7
+ data.tar.gz: e0d15b5a1867d80830c95525b74947d65c6069bb6861664e8534622de47711a46f45231b1f92c05f239443bbc397b7ad350e0b6f63a7d6070e152558686e6db1
data/README.md CHANGED
@@ -49,7 +49,7 @@ manually within a `config.vm.provider` block. So first, add the dummy
49
49
  box using any name you want:
50
50
 
51
51
  ```
52
- $ vagrant box add dummy https://github.com/mitchellh/vagrant-mos/raw/master/dummy.box
52
+ $ vagrant box add dummy https://github.com/mitchellh/vagrant-mos/raw/master/mos_box.box
53
53
  ...
54
54
  ```
55
55
 
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module MOS
3
- VERSION = '0.8.39'
3
+ VERSION = '0.8.40'
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.8.39
4
+ version: 0.8.40
5
5
  platform: ruby
6
6
  authors:
7
7
  - yangcs2009
@@ -107,15 +107,12 @@ files:
107
107
  - README.md
108
108
  - Rakefile
109
109
  - Vagrantfile
110
- - dummy.box
111
110
  - example_box/README.md
112
111
  - example_box/Vagrantfile
113
112
  - example_box/metadata.json
114
113
  - lib/vagrant-mos.rb
115
114
  - lib/vagrant-mos/action.rb
116
115
  - lib/vagrant-mos/action/connect_mos.rb
117
- - lib/vagrant-mos/action/elb_deregister_instance.rb
118
- - lib/vagrant-mos/action/elb_register_instance.rb
119
116
  - lib/vagrant-mos/action/is_created.rb
120
117
  - lib/vagrant-mos/action/is_stopped.rb
121
118
  - lib/vagrant-mos/action/message_already_created.rb
@@ -135,7 +132,6 @@ files:
135
132
  - lib/vagrant-mos/errors.rb
136
133
  - lib/vagrant-mos/plugin.rb
137
134
  - lib/vagrant-mos/provider.rb
138
- - lib/vagrant-mos/util/elb.rb
139
135
  - lib/vagrant-mos/util/timer.rb
140
136
  - lib/vagrant-mos/version.rb
141
137
  - locales/en.yml
data/dummy.box DELETED
Binary file
@@ -1,24 +0,0 @@
1
- require 'vagrant-mos/util/elb'
2
-
3
- module VagrantPlugins
4
- module MOS
5
- module Action
6
- # This registers instance in ELB
7
- class ElbDeregisterInstance
8
- include ElasticLoadBalancer
9
-
10
- def initialize(app, env)
11
- @app = app
12
- @logger = Log4r::Logger.new("vagrant_mos::action::elb_deregister_instance")
13
- end
14
-
15
- def call(env)
16
- if elb_name = env[:machine].provider_config.elb
17
- deregister_instance env, elb_name, env[:machine].id
18
- end
19
- @app.call(env)
20
- end
21
- end
22
- end
23
- end
24
- end
@@ -1,24 +0,0 @@
1
- require 'vagrant-mos/util/elb'
2
-
3
- module VagrantPlugins
4
- module MOS
5
- module Action
6
- # This registers instance in ELB
7
- class ElbRegisterInstance
8
- include ElasticLoadBalancer
9
-
10
- def initialize(app, env)
11
- @app = app
12
- @logger = Log4r::Logger.new("vagrant_mos::action::elb_register_instance")
13
- end
14
-
15
- def call(env)
16
- @app.call(env)
17
- if elb_name = env[:machine].provider_config.elb
18
- register_instance env, elb_name, env[:machine].id
19
- end
20
- end
21
- end
22
- end
23
- end
24
- end
@@ -1,56 +0,0 @@
1
- module VagrantPlugins
2
- module MOS
3
- module ElasticLoadBalancer
4
-
5
- def register_instance(env, elb_name, instance_id)
6
- env[:ui].info I18n.t("vagrant_mos.elb.registering", instance_id: instance_id, elb_name: elb_name), :new_line => false
7
- elb = get_load_balancer(env[:mos_elb], elb_name)
8
- unless elb.instances.include? instance_id
9
- elb.register_instances([instance_id])
10
- env[:ui].info I18n.t("vagrant_mos.elb.ok"), :prefix => false
11
- adjust_availability_zones env, elb
12
- else
13
- env[:ui].info I18n.t("vagrant_mos.elb.skipped"), :prefix => false
14
- end
15
- end
16
-
17
- def deregister_instance(env, elb_name, instance_id)
18
- env[:ui].info I18n.t("vagrant_mos.elb.deregistering", instance_id: instance_id, elb_name: elb_name), :new_line => false
19
- elb = get_load_balancer(env[:mos_elb], elb_name)
20
- if elb.instances.include? instance_id
21
- elb.deregister_instances([instance_id])
22
- env[:ui].info I18n.t("vagrant_mos.elb.ok"), :prefix => false
23
- adjust_availability_zones env, elb
24
- else
25
- env[:ui].info I18n.t("vagrant_mos.elb.skipped"), :prefix => false
26
- end
27
- end
28
-
29
- def adjust_availability_zones(env, elb)
30
- env[:ui].info I18n.t("vagrant_mos.elb.adjusting", elb_name: elb.id), :new_line => false
31
-
32
- instances = env[:mos_compute].servers.all("instance-id" => elb.instances)
33
-
34
- azs = if instances.empty?
35
- ["#{env[:machine].provider_config.region}a"]
36
- else
37
- instances.map(&:availability_zone).uniq
38
- end
39
-
40
- az_to_disable = elb.availability_zones - azs
41
- az_to_enable = azs - elb.availability_zones
42
-
43
- elb.enable_availability_zones az_to_enable unless az_to_enable.empty?
44
- elb.disable_availability_zones az_to_disable unless az_to_disable.empty?
45
-
46
- env[:ui].info I18n.t("vagrant_mos.elb.ok"), :prefix => false
47
- end
48
-
49
- private
50
-
51
- def get_load_balancer(mos, name)
52
- mos.load_balancers.find { |lb| lb.id == name } or raise Errors::ElbDoesNotExistError
53
- end
54
- end
55
- end
56
- end