vagrant-cloudstack 1.3.0 → 1.4.0
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/.gitignore +18 -19
- data/.ruby-version +1 -1
- data/.travis.yml +19 -19
- data/CHANGELOG.md +179 -171
- data/Docker/.dockerignore +2 -0
- data/Docker/Dockerfile +51 -0
- data/Docker/Dockerfile.chefdk_0_17 +49 -0
- data/Docker/Dockerfile.latest_dependencies +49 -0
- data/Docker/README.md +67 -0
- data/Docker/vac.ps1 +29 -0
- data/Docker/vac.sh +30 -0
- data/Gemfile +20 -20
- data/LICENSE +8 -8
- data/README.md +416 -416
- data/Rakefile +106 -99
- data/bootstrap.key +27 -0
- data/build_rpm.sh +7 -7
- data/functional-tests/basic/Vagrantfile.basic_networking +45 -45
- data/functional-tests/basic/basic_spec.rb +21 -21
- data/functional-tests/networking/Vagrantfile.advanced_networking +119 -102
- data/functional-tests/networking/networking_spec.rb +14 -0
- data/functional-tests/rsync/Vagrantfile.advanced_networking +39 -56
- data/functional-tests/rsync/rsync_spec.rb +9 -9
- data/functional-tests/vmlifecycle/Vagrantfile.advanced_networking +66 -82
- data/functional-tests/vmlifecycle/vmlifecycle_spec.rb +13 -13
- data/lib/vagrant-cloudstack/action/connect_cloudstack.rb +47 -47
- data/lib/vagrant-cloudstack/action/is_created.rb +18 -18
- data/lib/vagrant-cloudstack/action/is_stopped.rb +18 -18
- data/lib/vagrant-cloudstack/action/message_already_created.rb +16 -16
- data/lib/vagrant-cloudstack/action/message_not_created.rb +16 -16
- data/lib/vagrant-cloudstack/action/message_will_not_destroy.rb +16 -16
- data/lib/vagrant-cloudstack/action/read_rdp_info.rb +76 -76
- data/lib/vagrant-cloudstack/action/read_ssh_info.rb +104 -87
- data/lib/vagrant-cloudstack/action/read_state.rb +38 -38
- data/lib/vagrant-cloudstack/action/read_winrm_info.rb +103 -103
- data/lib/vagrant-cloudstack/action/run_instance.rb +798 -703
- data/lib/vagrant-cloudstack/action/start_instance.rb +81 -81
- data/lib/vagrant-cloudstack/action/stop_instance.rb +28 -28
- data/lib/vagrant-cloudstack/action/terminate_instance.rb +269 -224
- data/lib/vagrant-cloudstack/action/timed_provision.rb +21 -21
- data/lib/vagrant-cloudstack/action/wait_for_state.rb +41 -41
- data/lib/vagrant-cloudstack/action/warn_networks.rb +19 -19
- data/lib/vagrant-cloudstack/action.rb +210 -210
- data/lib/vagrant-cloudstack/capabilities/rdp.rb +12 -12
- data/lib/vagrant-cloudstack/capabilities/winrm.rb +12 -12
- data/lib/vagrant-cloudstack/config.rb +566 -548
- data/lib/vagrant-cloudstack/errors.rb +27 -27
- data/lib/vagrant-cloudstack/exceptions/exceptions.rb +10 -10
- data/lib/vagrant-cloudstack/model/cloudstack_resource.rb +51 -33
- data/lib/vagrant-cloudstack/plugin.rb +82 -82
- data/lib/vagrant-cloudstack/provider.rb +58 -58
- data/lib/vagrant-cloudstack/service/cloudstack_resource_service.rb +64 -58
- data/lib/vagrant-cloudstack/util/timer.rb +17 -17
- data/lib/vagrant-cloudstack/version.rb +5 -5
- data/lib/vagrant-cloudstack.rb +17 -17
- data/locales/en.yml +131 -123
- data/spec/spec_helper.rb +8 -6
- data/spec/vagrant-cloudstack/action/read_ssh_info_spec.rb +80 -0
- data/spec/vagrant-cloudstack/config_spec.rb +355 -355
- data/spec/vagrant-cloudstack/model/cloudstack_resource_spec.rb +95 -73
- data/spec/vagrant-cloudstack/service/cloudstack_resource_service_spec.rb +43 -43
- data/spec/vagrant-cloudstack/support/be_a_resource.rb +6 -0
- data/vagrant-cloudstack.gemspec +59 -59
- data/vagrant-cloudstack.spec +42 -42
- metadata +14 -7
- data/dummy.box +0 -0
- data/example_box/README.md +0 -13
- data/example_box/metadata.json +0 -3
- data/functional-tests/networking/rsync_spec.rb +0 -12
@@ -0,0 +1,14 @@
|
|
1
|
+
describe 'Networking features' do
|
2
|
+
it 'creates firewall and portwarding rules for both Virtual Router and VPC' do
|
3
|
+
expect(`vagrant up`).to include(
|
4
|
+
'VRbox1: Machine is booted and ready for use!',
|
5
|
+
'VRbox2: Machine is booted and ready for use!',
|
6
|
+
'VPCbox1: Machine is booted and ready for use!',
|
7
|
+
'VPCbox2: Machine is booted and ready for use!'
|
8
|
+
)
|
9
|
+
expect($?.exitstatus).to eq(0)
|
10
|
+
|
11
|
+
expect(`vagrant destroy --force`).to include('Terminating the instance...')
|
12
|
+
expect($?.exitstatus).to eq(0)
|
13
|
+
end
|
14
|
+
end
|
@@ -1,56 +1,39 @@
|
|
1
|
-
# -*- mode: ruby -*-
|
2
|
-
# vi: set ft=ruby :
|
3
|
-
|
4
|
-
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
|
5
|
-
VAGRANTFILE_API_VERSION = '2'
|
6
|
-
|
7
|
-
Vagrant.require_version '>= 1.5.0'
|
8
|
-
|
9
|
-
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
10
|
-
config.vm.box = ENV['LINUX_TEMPLATE_NAME']
|
11
|
-
|
12
|
-
config.vm.synced_folder ".", "/vagrant", type: "rsync",
|
13
|
-
rsync__exclude: [".git/", "vendor"]
|
14
|
-
|
15
|
-
config.vm.provider :cloudstack do |cloudstack, override|
|
16
|
-
cloudstack.display_name = ENV['TEST_NAME']
|
17
|
-
|
18
|
-
cloudstack.host = ENV['CLOUDSTACK_HOST']
|
19
|
-
cloudstack.path = '/client/api'
|
20
|
-
cloudstack.port = '443'
|
21
|
-
cloudstack.scheme = 'https'
|
22
|
-
cloudstack.api_key = ENV['CLOUDSTACK_API_KEY']
|
23
|
-
cloudstack.secret_key = ENV['CLOUDSTACK_SECRET_KEY']
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
cloudstack.
|
30
|
-
cloudstack.
|
31
|
-
cloudstack.
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
{
|
41
|
-
ipaddress: public_source_nat_ip,
|
42
|
-
cidrlist: ENV['SOURCE_CIDR'],
|
43
|
-
protocol: 'tcp',
|
44
|
-
startport: public_ssh_port.to_i,
|
45
|
-
endport: public_ssh_port.to_i
|
46
|
-
}
|
47
|
-
]
|
48
|
-
end
|
49
|
-
|
50
|
-
unless ENV['SSH_KEY'].nil?
|
51
|
-
cloudstack.ssh_key = ENV['SSH_KEY']
|
52
|
-
cloudstack.ssh_user = ENV['SSH_USER']
|
53
|
-
end
|
54
|
-
end
|
55
|
-
|
56
|
-
end
|
1
|
+
# -*- mode: ruby -*-
|
2
|
+
# vi: set ft=ruby :
|
3
|
+
|
4
|
+
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
|
5
|
+
VAGRANTFILE_API_VERSION = '2'
|
6
|
+
|
7
|
+
Vagrant.require_version '>= 1.5.0'
|
8
|
+
|
9
|
+
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
10
|
+
config.vm.box = ENV['LINUX_TEMPLATE_NAME']
|
11
|
+
|
12
|
+
config.vm.synced_folder ".", "/vagrant", type: "rsync",
|
13
|
+
rsync__exclude: [".git/", "vendor"]
|
14
|
+
|
15
|
+
config.vm.provider :cloudstack do |cloudstack, override|
|
16
|
+
cloudstack.display_name = ENV['TEST_NAME']
|
17
|
+
|
18
|
+
cloudstack.host = ENV['CLOUDSTACK_HOST']
|
19
|
+
cloudstack.path = '/client/api'
|
20
|
+
cloudstack.port = '443'
|
21
|
+
cloudstack.scheme = 'https'
|
22
|
+
cloudstack.api_key = ENV['CLOUDSTACK_API_KEY']
|
23
|
+
cloudstack.secret_key = ENV['CLOUDSTACK_SECRET_KEY']
|
24
|
+
|
25
|
+
cloudstack.zone_name = ENV['ZONE_NAME']
|
26
|
+
cloudstack.network_name = ENV['NETWORK_NAME']
|
27
|
+
cloudstack.service_offering_name = ENV['SERVICE_OFFERING_NAME']
|
28
|
+
|
29
|
+
cloudstack.pf_ip_address = ENV['PUBLIC_SOURCE_NAT_IP']
|
30
|
+
cloudstack.pf_trusted_networks = ENV['SOURCE_CIDR']
|
31
|
+
cloudstack.pf_open_firewall = false
|
32
|
+
|
33
|
+
unless ENV['SSH_KEY'].nil?
|
34
|
+
cloudstack.ssh_key = ENV['SSH_KEY']
|
35
|
+
cloudstack.ssh_user = ENV['SSH_USER']
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
@@ -1,9 +1,9 @@
|
|
1
|
-
describe 'VM RSync' do
|
2
|
-
it 'does rsync to the VM' do
|
3
|
-
expect(`vagrant up`).to include('Machine is booted and ready for use!')
|
4
|
-
expect($?.exitstatus).to eq(0)
|
5
|
-
expect(`vagrant ssh -c "ls /vagrant; echo;"`).to include('Vagrantfile.advanced_networking')
|
6
|
-
expect(`vagrant destroy --force`).to include('Terminating the instance...')
|
7
|
-
expect($?.exitstatus).to eq(0)
|
8
|
-
end
|
9
|
-
end
|
1
|
+
describe 'VM RSync' do
|
2
|
+
it 'does rsync to the VM' do
|
3
|
+
expect(`vagrant up`).to include('Machine is booted and ready for use!')
|
4
|
+
expect($?.exitstatus).to eq(0)
|
5
|
+
expect(`vagrant ssh -c "ls /vagrant; echo;"`).to include('Vagrantfile.advanced_networking')
|
6
|
+
expect(`vagrant destroy --force`).to include('Terminating the instance...')
|
7
|
+
expect($?.exitstatus).to eq(0)
|
8
|
+
end
|
9
|
+
end
|
@@ -1,82 +1,66 @@
|
|
1
|
-
# -*- mode: ruby -*-
|
2
|
-
# vi: set ft=ruby :
|
3
|
-
|
4
|
-
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
|
5
|
-
VAGRANTFILE_API_VERSION = '2'
|
6
|
-
|
7
|
-
Vagrant.require_version '>= 1.5.0'
|
8
|
-
|
9
|
-
machines = {
|
10
|
-
'linux-box' => {
|
11
|
-
'
|
12
|
-
'
|
13
|
-
'
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
'
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
cloudstack.
|
38
|
-
|
39
|
-
cloudstack.
|
40
|
-
cloudstack.
|
41
|
-
cloudstack.
|
42
|
-
|
43
|
-
cloudstack.
|
44
|
-
cloudstack.
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
cloudstack.
|
51
|
-
cloudstack.
|
52
|
-
|
53
|
-
cloudstack.
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
}
|
68
|
-
]
|
69
|
-
end
|
70
|
-
|
71
|
-
unless ENV['SSH_KEY'].nil?
|
72
|
-
cloudstack.ssh_key = ENV['SSH_KEY']
|
73
|
-
cloudstack.ssh_user = ENV['SSH_USER']
|
74
|
-
end
|
75
|
-
|
76
|
-
unless ENV['WINDOWS_USER'].nil?
|
77
|
-
cloudstack.vm_user = ENV['WINDOWS_USER']
|
78
|
-
end
|
79
|
-
end
|
80
|
-
end
|
81
|
-
end
|
82
|
-
end
|
1
|
+
# -*- mode: ruby -*-
|
2
|
+
# vi: set ft=ruby :
|
3
|
+
|
4
|
+
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
|
5
|
+
VAGRANTFILE_API_VERSION = '2'
|
6
|
+
|
7
|
+
Vagrant.require_version '>= 1.5.0'
|
8
|
+
|
9
|
+
machines = {
|
10
|
+
'linux-box' => {
|
11
|
+
'template' => ENV['LINUX_TEMPLATE_NAME'],
|
12
|
+
'communicator' => 'ssh',
|
13
|
+
'rsync_disabled' => true
|
14
|
+
},
|
15
|
+
'windows-box' => {
|
16
|
+
'template' => ENV['WINDOWS_TEMPLATE_NAME'],
|
17
|
+
'communicator' => 'winrm',
|
18
|
+
'rsync_disabled' => true
|
19
|
+
}
|
20
|
+
}
|
21
|
+
|
22
|
+
|
23
|
+
Vagrant.configure(VAGRANTFILE_API_VERSION) do |global_config|
|
24
|
+
machines.each_pair do |name, options|
|
25
|
+
global_config.vm.define name do |config|
|
26
|
+
config.vm.box = options['template']
|
27
|
+
|
28
|
+
config.vm.communicator = options['communicator']
|
29
|
+
config.vm.synced_folder ".", "/vagrant", type: "rsync",
|
30
|
+
rsync__exclude: [".git/", "vendor"], disabled: options['rsync_disabled']
|
31
|
+
config.vm.provider :cloudstack do |cloudstack, override|
|
32
|
+
|
33
|
+
cloudstack.display_name = ENV['TEST_NAME']
|
34
|
+
|
35
|
+
cloudstack.host = ENV['CLOUDSTACK_HOST']
|
36
|
+
cloudstack.path = '/client/api'
|
37
|
+
cloudstack.port = '443'
|
38
|
+
cloudstack.scheme = 'https'
|
39
|
+
cloudstack.api_key = ENV['CLOUDSTACK_API_KEY']
|
40
|
+
cloudstack.secret_key = ENV['CLOUDSTACK_SECRET_KEY']
|
41
|
+
cloudstack.expunge_on_destroy = ENV['EXPUNGE_ON_DESTROY']=="true"
|
42
|
+
|
43
|
+
cloudstack.zone_name = ENV['ZONE_NAME']
|
44
|
+
cloudstack.network_name = ENV['NETWORK_NAME']
|
45
|
+
cloudstack.service_offering_name = ENV['SERVICE_OFFERING_NAME']
|
46
|
+
cloudstack.disk_offering_name = ENV['DISK_OFFERING_NAME']
|
47
|
+
|
48
|
+
cloudstack.pf_ip_address = ENV['PUBLIC_SOURCE_NAT_IP']
|
49
|
+
|
50
|
+
cloudstack.pf_public_port = options['public_port']
|
51
|
+
cloudstack.pf_private_port = options['private_port']
|
52
|
+
cloudstack.pf_trusted_networks = ENV['SOURCE_CIDR']
|
53
|
+
cloudstack.pf_open_firewall = false
|
54
|
+
|
55
|
+
unless ENV['SSH_KEY'].nil?
|
56
|
+
cloudstack.ssh_key = ENV['SSH_KEY']
|
57
|
+
cloudstack.ssh_user = ENV['SSH_USER']
|
58
|
+
end
|
59
|
+
|
60
|
+
unless ENV['WINDOWS_USER'].nil?
|
61
|
+
cloudstack.vm_user = ENV['WINDOWS_USER']
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
@@ -1,13 +1,13 @@
|
|
1
|
-
describe 'VM Life Cycle' do
|
2
|
-
it 'starts Linux and Windows VM' do
|
3
|
-
expect(`vagrant up`).to include(
|
4
|
-
'linux-box: Machine is booted and ready for use!',
|
5
|
-
'windows-box: Machine is booted and ready for use!'
|
6
|
-
)
|
7
|
-
expect($?.exitstatus).to eq(0)
|
8
|
-
end
|
9
|
-
it 'destroys Linux and Windows VM' do
|
10
|
-
expect(`vagrant destroy --force`).to include('
|
11
|
-
expect($?.exitstatus).to eq(0)
|
12
|
-
end
|
13
|
-
end
|
1
|
+
describe 'VM Life Cycle' do
|
2
|
+
it 'starts Linux and Windows VM' do
|
3
|
+
expect(`vagrant up`).to include(
|
4
|
+
'linux-box: Machine is booted and ready for use!',
|
5
|
+
'windows-box: Machine is booted and ready for use!'
|
6
|
+
)
|
7
|
+
expect($?.exitstatus).to eq(0)
|
8
|
+
end
|
9
|
+
it 'destroys Linux and Windows VM' do
|
10
|
+
expect(`vagrant destroy --force`).to include('Done removing resources')
|
11
|
+
expect($?.exitstatus).to eq(0)
|
12
|
+
end
|
13
|
+
end
|
@@ -1,47 +1,47 @@
|
|
1
|
-
require 'fog'
|
2
|
-
require 'log4r'
|
3
|
-
|
4
|
-
module VagrantPlugins
|
5
|
-
module Cloudstack
|
6
|
-
module Action
|
7
|
-
# This action connects to Cloudstack, verifies credentials work, and
|
8
|
-
# puts the Cloudstack connection object into the
|
9
|
-
# `:cloudstack_compute` key in the environment.
|
10
|
-
class ConnectCloudstack
|
11
|
-
def initialize(app, env)
|
12
|
-
@app = app
|
13
|
-
@logger = Log4r::Logger.new('vagrant_cloudstack::action::connect_cloudstack')
|
14
|
-
end
|
15
|
-
|
16
|
-
def call(env)
|
17
|
-
# Get the domain we're going to booting up in
|
18
|
-
domain = env[:machine].provider_config.domain_id
|
19
|
-
|
20
|
-
# Get the configs
|
21
|
-
domain_config = env[:machine].provider_config.get_domain_config(domain)
|
22
|
-
|
23
|
-
# Build the fog config
|
24
|
-
fog_config = {
|
25
|
-
:provider => :cloudstack
|
26
|
-
#:domain => domain_config
|
27
|
-
}
|
28
|
-
|
29
|
-
if domain_config.api_key
|
30
|
-
fog_config[:cloudstack_api_key] = domain_config.api_key
|
31
|
-
fog_config[:cloudstack_secret_access_key] = domain_config.secret_key
|
32
|
-
end
|
33
|
-
|
34
|
-
fog_config[:cloudstack_host] = domain_config.host if domain_config.host
|
35
|
-
fog_config[:cloudstack_path] = domain_config.path if domain_config.path
|
36
|
-
fog_config[:cloudstack_port] = domain_config.port if domain_config.port
|
37
|
-
fog_config[:cloudstack_scheme] = domain_config.scheme if domain_config.scheme
|
38
|
-
|
39
|
-
@logger.info('Connecting to Cloudstack...')
|
40
|
-
env[:cloudstack_compute] = Fog::Compute.new(fog_config)
|
41
|
-
|
42
|
-
@app.call(env)
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
1
|
+
require 'fog'
|
2
|
+
require 'log4r'
|
3
|
+
|
4
|
+
module VagrantPlugins
|
5
|
+
module Cloudstack
|
6
|
+
module Action
|
7
|
+
# This action connects to Cloudstack, verifies credentials work, and
|
8
|
+
# puts the Cloudstack connection object into the
|
9
|
+
# `:cloudstack_compute` key in the environment.
|
10
|
+
class ConnectCloudstack
|
11
|
+
def initialize(app, env)
|
12
|
+
@app = app
|
13
|
+
@logger = Log4r::Logger.new('vagrant_cloudstack::action::connect_cloudstack')
|
14
|
+
end
|
15
|
+
|
16
|
+
def call(env)
|
17
|
+
# Get the domain we're going to booting up in
|
18
|
+
domain = env[:machine].provider_config.domain_id
|
19
|
+
|
20
|
+
# Get the configs
|
21
|
+
domain_config = env[:machine].provider_config.get_domain_config(domain)
|
22
|
+
|
23
|
+
# Build the fog config
|
24
|
+
fog_config = {
|
25
|
+
:provider => :cloudstack
|
26
|
+
#:domain => domain_config
|
27
|
+
}
|
28
|
+
|
29
|
+
if domain_config.api_key
|
30
|
+
fog_config[:cloudstack_api_key] = domain_config.api_key
|
31
|
+
fog_config[:cloudstack_secret_access_key] = domain_config.secret_key
|
32
|
+
end
|
33
|
+
|
34
|
+
fog_config[:cloudstack_host] = domain_config.host if domain_config.host
|
35
|
+
fog_config[:cloudstack_path] = domain_config.path if domain_config.path
|
36
|
+
fog_config[:cloudstack_port] = domain_config.port if domain_config.port
|
37
|
+
fog_config[:cloudstack_scheme] = domain_config.scheme if domain_config.scheme
|
38
|
+
|
39
|
+
@logger.info('Connecting to Cloudstack...')
|
40
|
+
env[:cloudstack_compute] = Fog::Compute.new(fog_config)
|
41
|
+
|
42
|
+
@app.call(env)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -1,18 +1,18 @@
|
|
1
|
-
module VagrantPlugins
|
2
|
-
module Cloudstack
|
3
|
-
module Action
|
4
|
-
# This can be used with "Call" built-in to check if the machine
|
5
|
-
# is created and branch in the middleware.
|
6
|
-
class IsCreated
|
7
|
-
def initialize(app, env)
|
8
|
-
@app = app
|
9
|
-
end
|
10
|
-
|
11
|
-
def call(env)
|
12
|
-
env[:result] = env[:machine].state.id != :not_created
|
13
|
-
@app.call(env)
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
1
|
+
module VagrantPlugins
|
2
|
+
module Cloudstack
|
3
|
+
module Action
|
4
|
+
# This can be used with "Call" built-in to check if the machine
|
5
|
+
# is created and branch in the middleware.
|
6
|
+
class IsCreated
|
7
|
+
def initialize(app, env)
|
8
|
+
@app = app
|
9
|
+
end
|
10
|
+
|
11
|
+
def call(env)
|
12
|
+
env[:result] = env[:machine].state.id != :not_created
|
13
|
+
@app.call(env)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -1,18 +1,18 @@
|
|
1
|
-
module VagrantPlugins
|
2
|
-
module Cloudstack
|
3
|
-
module Action
|
4
|
-
# This can be used with "Call" built-in to check if the machine
|
5
|
-
# is stopped and branch in the middleware.
|
6
|
-
class IsStopped
|
7
|
-
def initialize(app, env)
|
8
|
-
@app = app
|
9
|
-
end
|
10
|
-
|
11
|
-
def call(env)
|
12
|
-
env[:result] = env[:machine].state.id == :stopped
|
13
|
-
@app.call(env)
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
1
|
+
module VagrantPlugins
|
2
|
+
module Cloudstack
|
3
|
+
module Action
|
4
|
+
# This can be used with "Call" built-in to check if the machine
|
5
|
+
# is stopped and branch in the middleware.
|
6
|
+
class IsStopped
|
7
|
+
def initialize(app, env)
|
8
|
+
@app = app
|
9
|
+
end
|
10
|
+
|
11
|
+
def call(env)
|
12
|
+
env[:result] = env[:machine].state.id == :stopped
|
13
|
+
@app.call(env)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|