vagrant-ovirt3 1.9.1 → 1.9.2
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/example_box/Vagrantfile +5 -1
- data/lib/vagrant-ovirt3/action.rb +4 -1
- data/lib/vagrant-ovirt3/action/create_vm.rb +3 -0
- data/lib/vagrant-ovirt3/action/wait_till_down.rb +45 -0
- data/lib/vagrant-ovirt3/errors.rb +4 -0
- data/lib/vagrant-ovirt3/version.rb +1 -1
- data/locales/en.yml +4 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f4381759317a8261e528eac75a53692f96db524
|
4
|
+
data.tar.gz: 0520499d7cb7c254ae47f0e25da3b8340fb2f5d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3770ab823335d22323ca3963f3cbe51843386fad2040ab364231c6a88e1ee3735f5856c4535593697a647fb486bfabae48ce231ad2df73038e73dbf500119834
|
7
|
+
data.tar.gz: 659916d19908bab14d4becb247a79095c7cb44b9efe831ae3633de968cec46a98b8f5bc08d040876ec273d5519e88c61061d79cedadb67f161279672eea4f488
|
data/example_box/Vagrantfile
CHANGED
@@ -14,6 +14,10 @@ Vagrant.configure("2") do |config|
|
|
14
14
|
ovirt.template = "vagrant-centos65"
|
15
15
|
ovirt.cpus = 1
|
16
16
|
ovirt.memory = 512
|
17
|
-
ovirt.ca_no_verify = true
|
17
|
+
# ovirt.ca_no_verify = true
|
18
|
+
# ovirt.user_data =<<EOF
|
19
|
+
#runcmd:
|
20
|
+
# - yum install -y java-1.7.0-openjdk
|
21
|
+
#EOF
|
18
22
|
end
|
19
23
|
end
|
@@ -99,7 +99,9 @@ module VagrantPlugins
|
|
99
99
|
end
|
100
100
|
|
101
101
|
b2.use ConnectOVirt
|
102
|
-
|
102
|
+
b2.use ProvisionerCleanup, :before if defined?(ProvisionerCleanup)
|
103
|
+
b2.use HaltVM
|
104
|
+
b2.use WaitTillDown
|
103
105
|
b2.use DestroyVM
|
104
106
|
end
|
105
107
|
end
|
@@ -213,6 +215,7 @@ module VagrantPlugins
|
|
213
215
|
autoload :ReadState, action_root.join("read_state")
|
214
216
|
autoload :ReadSSHInfo, action_root.join("read_ssh_info")
|
215
217
|
autoload :WaitTillUp, action_root.join("wait_till_up")
|
218
|
+
autoload :WaitTillDown, action_root.join("wait_till_down")
|
216
219
|
autoload :SyncFolders, action_root.join("sync_folders")
|
217
220
|
autoload :MessageAlreadyCreated, action_root.join("message_already_created")
|
218
221
|
autoload :MessageAlreadyUp, action_root.join("message_already_up")
|
@@ -0,0 +1,45 @@
|
|
1
|
+
require 'log4r'
|
2
|
+
require 'vagrant-ovirt3/util/timer'
|
3
|
+
require 'vagrant/util/retryable'
|
4
|
+
|
5
|
+
module VagrantPlugins
|
6
|
+
module OVirtProvider
|
7
|
+
module Action
|
8
|
+
|
9
|
+
# Wait till VM is stopped
|
10
|
+
class WaitTillDown
|
11
|
+
include Vagrant::Util::Retryable
|
12
|
+
|
13
|
+
def initialize(app, env)
|
14
|
+
@logger = Log4r::Logger.new("vagrant_ovirt3::action::wait_till_down")
|
15
|
+
@app = app
|
16
|
+
end
|
17
|
+
|
18
|
+
def call(env)
|
19
|
+
config = env[:machine].provider_config
|
20
|
+
connect_timeout = config.connect_timeout
|
21
|
+
|
22
|
+
env[:ui].info(I18n.t("vagrant_ovirt3.wait_till_down"))
|
23
|
+
for i in 0..connect_timeout
|
24
|
+
ready = true
|
25
|
+
server = env[:ovirt_compute].servers.get(env[:machine].id.to_s)
|
26
|
+
if env[:machine].state.id != :down
|
27
|
+
ready = false
|
28
|
+
end
|
29
|
+
break if ready
|
30
|
+
sleep 2
|
31
|
+
end
|
32
|
+
|
33
|
+
if not ready
|
34
|
+
raise Errors::WaitForShutdownVmTimeout
|
35
|
+
end
|
36
|
+
|
37
|
+
|
38
|
+
@app.call(env)
|
39
|
+
end
|
40
|
+
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
@@ -63,6 +63,10 @@ module VagrantPlugins
|
|
63
63
|
error_key(:wait_for_ready_vm_timeout)
|
64
64
|
end
|
65
65
|
|
66
|
+
class WaitForShutdownVmTimeout < VagrantOVirtError
|
67
|
+
error_key(:wait_for_shutdown_vm_timeout)
|
68
|
+
end
|
69
|
+
|
66
70
|
class NoIpAddressError < VagrantOVirtError
|
67
71
|
error_key(:no_ip_address_error)
|
68
72
|
end
|
data/locales/en.yml
CHANGED
@@ -16,6 +16,8 @@ en:
|
|
16
16
|
Halting VM...
|
17
17
|
error_recovering: |-
|
18
18
|
An error occured. Recovering..
|
19
|
+
wait_till_down: |-
|
20
|
+
Waiting for VM to shutdown...
|
19
21
|
waiting_for_ip: |-
|
20
22
|
Waiting for VM to get an IP address...
|
21
23
|
waiting_for_ssh: |-
|
@@ -83,6 +85,8 @@ en:
|
|
83
85
|
Error while updating volume. %{error_message}
|
84
86
|
wait_for_ready_resized_volume_timeout: |-
|
85
87
|
Timeout occurred while waiting for resized volume to become ready
|
88
|
+
wait_for_shutdown_vm_timeout: |-
|
89
|
+
Timeout occurred while waiting for VM to shutdown
|
86
90
|
|
87
91
|
states:
|
88
92
|
short_paused: |-
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-ovirt3
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.9.
|
4
|
+
version: 1.9.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marcus Young
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-05-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fog
|
@@ -96,6 +96,7 @@ files:
|
|
96
96
|
- lib/vagrant-ovirt3/action/start_vm.rb
|
97
97
|
- lib/vagrant-ovirt3/action/suspend_vm.rb
|
98
98
|
- lib/vagrant-ovirt3/action/sync_folders.rb
|
99
|
+
- lib/vagrant-ovirt3/action/wait_till_down.rb
|
99
100
|
- lib/vagrant-ovirt3/action/wait_till_up.rb
|
100
101
|
- lib/vagrant-ovirt3/cap/nic_mac_addresses.rb
|
101
102
|
- lib/vagrant-ovirt3/config.rb
|