vagrant-mos 0.8.86 → 0.8.87
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/describe_templates.rb +38 -0
- data/lib/vagrant-mos/command.rb +5 -0
- data/lib/vagrant-mos/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c925faaccdfc3b637882972bc078d375229d9ff1
|
4
|
+
data.tar.gz: 310be3e8b74769091197787f532517c57106ba37
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/lib/vagrant-mos/command.rb
CHANGED
data/lib/vagrant-mos/version.rb
CHANGED
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.
|
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
|