vagrant-mos 0.8.86 → 0.8.87

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: c40794d19a9172c3514e584f3c081f57a55f0edd
4
- data.tar.gz: 9dbf47f97d02da0bab0425b31b419532fffb0d17
3
+ metadata.gz: c925faaccdfc3b637882972bc078d375229d9ff1
4
+ data.tar.gz: 310be3e8b74769091197787f532517c57106ba37
5
5
  SHA512:
6
- metadata.gz: 9fa92a57667d2e5bca010604e25770ab79642f1feb483e04da2f27563490e8b3b48abdac38c7942e7e25b93afd42fcfd7f00e6f28ae0663b41bd98f56506ef23
7
- data.tar.gz: f7646e8aec6236972238f74dfd8af96f18c85117f3ffa7b579a79fe7adba1114d3ea4cc889dc517e7b8d29e664bda83fa78c1fe9e9c7c3869baf91fc5b87bbb5
6
+ metadata.gz: 8ad02fbfa51d7a56fc7e3f01656d0d13e88da0cb01813ad193392ccd60bc8e6534b03d4bda1050dbde2c1946b2d6c3f68c7b0c36c9a35c0d1972586d735c353b
7
+ data.tar.gz: b02c42cd89ec25d20bec111c3645259f09a6d7f4101eee98e17cdba0888340361fb617cf88cd8cb1f8d6b16099e22a445a0ee852878e545e05520321b207e911
@@ -0,0 +1,38 @@
1
+ require "log4r"
2
+
3
+ module VagrantPlugins
4
+ module MOS
5
+ module Action
6
+ # This action reads the state of the machine and puts it in the
7
+ # `:machine_state_id` key in the environment.
8
+ class DescribeTemplates
9
+ def initialize(app, env)
10
+ @app = app
11
+ @logger = Log4r::Logger.new("vagrant_mos::action::read_state")
12
+ end
13
+
14
+ def call(env)
15
+ env[:machine_state_id] = read_state(env[:mos_compute], env[:machine])
16
+
17
+ @app.call(env)
18
+ end
19
+
20
+ def describe_templates(mos, machine)
21
+ return :not_created if machine.id.nil?
22
+
23
+ # Find the templates
24
+ server = (mos.describe_templates())
25
+ if server.nil? || [:"deleting"].include?(server["status"])
26
+ # The machine can't be found
27
+ @logger.info("Machine not found or terminated, assuming it got destroyed.")
28
+ machine.id = nil
29
+ return :not_created
30
+ end
31
+
32
+ return server["Template"]
33
+
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
@@ -10,6 +10,11 @@ module VagrantPlugins
10
10
 
11
11
  def execute
12
12
  puts "Hello!"
13
+ Vagrant::Action::Builder.new.tap do |b|
14
+ b.use ConfigValidate
15
+ b.use ConnectMOS
16
+ b.use DescribeTemplates
17
+ end
13
18
  0
14
19
  end
15
20
  end
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module MOS
3
- VERSION = '0.8.86'
3
+ VERSION = '0.8.87'
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.86
4
+ version: 0.8.87
5
5
  platform: ruby
6
6
  authors:
7
7
  - yangcs2009
@@ -97,6 +97,7 @@ files:
97
97
  - lib/vagrant-mos.rb
98
98
  - lib/vagrant-mos/action.rb
99
99
  - lib/vagrant-mos/action/connect_mos.rb
100
+ - lib/vagrant-mos/action/describe_templates.rb
100
101
  - lib/vagrant-mos/action/is_created.rb
101
102
  - lib/vagrant-mos/action/is_stopped.rb
102
103
  - lib/vagrant-mos/action/message_already_created.rb