veewee 0.3.0.beta2 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/doc/requirements.md +7 -1
- data/lib/python/parallels_send_string.py +76 -0
- data/lib/veewee/provider/core/helper/scancode.rb +31 -48
- data/lib/veewee/provider/parallels/box/helper/console_type.rb +54 -76
- data/lib/veewee/provider/virtualbox/box/helper/buildinfo.rb +2 -2
- data/lib/veewee/provider/virtualbox/box/helper/create.rb +1 -1
- data/lib/veewee/provider/virtualbox/box/helper/guest_additions.rb +1 -2
- data/lib/veewee/provider/virtualbox/box/helper/version.rb +8 -0
- data/lib/veewee/version.rb +1 -1
- data/templates/Debian-6.0.5-i386-netboot/virtualbox.sh +1 -1
- data/templates/Debian-6.0.6-amd64-netboot/base.sh +27 -0
- data/templates/Debian-6.0.6-amd64-netboot/chef.sh +2 -0
- data/templates/Debian-6.0.6-amd64-netboot/cleanup-virtualbox.sh +4 -0
- data/templates/Debian-6.0.6-amd64-netboot/cleanup.sh +17 -0
- data/templates/Debian-6.0.6-amd64-netboot/definition.rb +49 -0
- data/templates/Debian-6.0.6-amd64-netboot/preseed.cfg +315 -0
- data/templates/Debian-6.0.6-amd64-netboot/puppet.sh +2 -0
- data/templates/Debian-6.0.6-amd64-netboot/ruby.sh +10 -0
- data/templates/Debian-6.0.6-amd64-netboot/vagrant.sh +25 -0
- data/templates/Debian-6.0.6-amd64-netboot/virtualbox.sh +13 -0
- data/templates/Debian-6.0.6-amd64-netboot/zerodisk.sh +3 -0
- data/templates/Debian-6.0.6-i386-netboot/base.sh +27 -0
- data/templates/Debian-6.0.6-i386-netboot/chef.sh +2 -0
- data/templates/Debian-6.0.6-i386-netboot/cleanup-virtualbox.sh +4 -0
- data/templates/Debian-6.0.6-i386-netboot/cleanup.sh +17 -0
- data/templates/Debian-6.0.6-i386-netboot/definition.rb +51 -0
- data/templates/Debian-6.0.6-i386-netboot/preseed.cfg +315 -0
- data/templates/Debian-6.0.6-i386-netboot/puppet.sh +2 -0
- data/templates/Debian-6.0.6-i386-netboot/ruby.sh +10 -0
- data/templates/Debian-6.0.6-i386-netboot/vagrant.sh +25 -0
- data/templates/Debian-6.0.6-i386-netboot/virtualbox.sh +13 -0
- data/templates/Debian-6.0.6-i386-netboot/zerodisk.sh +3 -0
- data/templates/Debian-7.0-b2-i386-netboot/base.sh +27 -0
- data/templates/Debian-7.0-b2-i386-netboot/chef.sh +2 -0
- data/templates/Debian-7.0-b2-i386-netboot/cleanup-virtualbox.sh +4 -0
- data/templates/Debian-7.0-b2-i386-netboot/cleanup.sh +17 -0
- data/templates/Debian-7.0-b2-i386-netboot/definition.rb +51 -0
- data/templates/Debian-7.0-b2-i386-netboot/preseed.cfg +315 -0
- data/templates/Debian-7.0-b2-i386-netboot/puppet.sh +2 -0
- data/templates/Debian-7.0-b2-i386-netboot/ruby.sh +10 -0
- data/templates/Debian-7.0-b2-i386-netboot/vagrant.sh +25 -0
- data/templates/Debian-7.0-b2-i386-netboot/virtualbox.sh +13 -0
- data/templates/Debian-7.0-b2-i386-netboot/zerodisk.sh +3 -0
- data/templates/Fedora-17-i386/ks.cfg +4 -0
- data/templates/Fedora-17-x86_64/ks.cfg +4 -0
- data/templates/freebsd-9.0-RELEASE-amd64/definition.rb +19 -0
- data/templates/freebsd-9.0-RELEASE-amd64/postinstall.sh +93 -0
- data/templates/ubuntu-12.04.1-server-amd64/definition.rb +1 -1
- data/templates/ubuntu-12.10-server-amd64-packages/definition.rb +35 -0
- data/templates/ubuntu-12.10-server-amd64-packages/postinstall.sh +75 -0
- data/templates/ubuntu-12.10-server-amd64-packages/preseed.cfg +87 -0
- data/templates/ubuntu-12.10-server-amd64/definition.rb +35 -0
- data/templates/ubuntu-12.10-server-amd64/postinstall.sh +97 -0
- data/templates/ubuntu-12.10-server-amd64/preseed.cfg +87 -0
- data/templates/ubuntu-12.10-server-i386-packages/definition.rb +35 -0
- data/templates/ubuntu-12.10-server-i386-packages/postinstall.sh +75 -0
- data/templates/ubuntu-12.10-server-i386-packages/preseed.cfg +87 -0
- data/templates/ubuntu-12.10-server-i386/definition.rb +35 -0
- data/templates/ubuntu-12.10-server-i386/postinstall.sh +98 -0
- data/templates/ubuntu-12.10-server-i386/preseed.cfg +87 -0
- data/test/veewee/provider/virtualbox/box/helper/guest_additions_test.rb +95 -0
- data/test/veewee/provider/virtualbox/box/helper/version.rb +67 -0
- data/validation/features/steps/veewee_steps.rb +1 -1
- metadata +54 -4
data/doc/requirements.md
CHANGED
@@ -0,0 +1,76 @@
|
|
1
|
+
import sys
|
2
|
+
import prlsdkapi
|
3
|
+
import string
|
4
|
+
|
5
|
+
if len(sys.argv) != 3:
|
6
|
+
print "Usage: parallels_send_string '<VM_NAME>' '<string>'"
|
7
|
+
exit()
|
8
|
+
|
9
|
+
# Parse arguments
|
10
|
+
vm_name=sys.argv[1]
|
11
|
+
# String to use
|
12
|
+
keynames = sys.argv[2].split(' ');
|
13
|
+
|
14
|
+
prlsdk = prlsdkapi.prlsdk
|
15
|
+
consts = prlsdkapi.prlsdk.consts
|
16
|
+
|
17
|
+
# Initialize the Parallels API Library
|
18
|
+
prlsdk.InitializeSDK(consts.PAM_DESKTOP_MAC)
|
19
|
+
|
20
|
+
# Obtain a server object identifying the Parallels Service.
|
21
|
+
server = prlsdkapi.Server()
|
22
|
+
|
23
|
+
# Log in. (local as we do Parallels Desktop
|
24
|
+
login_job=server.login_local()
|
25
|
+
login_job.wait()
|
26
|
+
|
27
|
+
# Get a list of virtual machines.
|
28
|
+
# Find the specified virtual machine and
|
29
|
+
# obtain an object identifying it.
|
30
|
+
vm_list = server.get_vm_list()
|
31
|
+
result= vm_list.wait()
|
32
|
+
|
33
|
+
print prlsdkapi.prlsdk.consts.ScanCodesList
|
34
|
+
|
35
|
+
# Look for the VM with the name speficied on the CLI
|
36
|
+
found = False
|
37
|
+
for i in range(result.get_params_count()):
|
38
|
+
VM = result.get_param_by_index(i)
|
39
|
+
print VM.get_name()
|
40
|
+
if VM.get_name() == vm_name:
|
41
|
+
found = True
|
42
|
+
break
|
43
|
+
|
44
|
+
press = consts.PKE_PRESS
|
45
|
+
release = consts.PKE_RELEASE
|
46
|
+
|
47
|
+
# Access the Remote Desktop Access session
|
48
|
+
vm_io = prlsdkapi.VmIO()
|
49
|
+
try:
|
50
|
+
vm_io.connect_to_vm(VM).wait()
|
51
|
+
except prlsdkapi.PrlSDKError, e:
|
52
|
+
print "Error: %s" % e
|
53
|
+
exit()
|
54
|
+
|
55
|
+
for keyname in keynames:
|
56
|
+
if(keyname != ''):
|
57
|
+
# Keys can also contain special keys like shift, that has to be pressed before and release after
|
58
|
+
# eg. SHIFT-C (Press shift, then press C)
|
59
|
+
keys = keyname.split('#');
|
60
|
+
|
61
|
+
for keypress in keys:
|
62
|
+
scan_code = consts.ScanCodesList[keypress]
|
63
|
+
vm_io.send_key_event(VM,scan_code,press,50)
|
64
|
+
|
65
|
+
# And now the reversed order
|
66
|
+
# eg. Now release C then SHIFT
|
67
|
+
for keypress in reversed(keys):
|
68
|
+
scan_code = consts.ScanCodesList[keypress]
|
69
|
+
vm_io.send_key_event(VM,scan_code,release,50)
|
70
|
+
|
71
|
+
# End the Remote Deskop Access session
|
72
|
+
vm_io.disconnect_from_vm(VM)
|
73
|
+
|
74
|
+
# Logoff and deinitialize the library
|
75
|
+
server.logoff()
|
76
|
+
prlsdkapi.deinit_sdk
|
@@ -8,44 +8,35 @@ module Veewee
|
|
8
8
|
|
9
9
|
#http://www.win.tue.nl/~aeb/linux/kbd/scancodes-1.html
|
10
10
|
|
11
|
-
|
12
|
-
k
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
k[';'] = '27 a7' ;k['"']='2a 28 aa a8';k['\'']='28 a8';
|
28
|
-
|
29
|
-
k['\\'] = '2b ab'; k['|'] = '2a 2b aa 8b';
|
30
|
-
|
31
|
-
k['[']='1a 9a'; k[']']='1b 9b';
|
32
|
-
k['<']='2a 33 aa b3'; k['>']='2a 34 aa b4';
|
33
|
-
k['$']='2a 05 aa 85';
|
34
|
-
k['+']='2a 0d aa 8d';
|
35
|
-
|
36
|
-
k['?']='2a 35 aa b5';
|
37
|
-
k['z'] = '2c ac'; k['x'] = '2d ad' ; k['c'] = '2e ae' ; k['v'] = '2f af'; k['b'] = '30 b0' ; k['n'] = '31 b1' ;
|
38
|
-
k['m'] = '32 b2';
|
39
|
-
k['Z'] = '2a 2c aa ac'; k['X'] = '2a 2d aa ad' ; k['C'] = '2a 2e aa ae' ; k['V'] = '2a 2f aa af';
|
40
|
-
k['B'] = '2a 30 aa b0' ; k['N'] = '2a 31 aa b1' ; k['M'] = '2a 32 aa b2';
|
41
|
-
|
42
|
-
k[',']= '33 b3' ; k['.']='34 b4'; k['/'] = '35 b5' ;k[':'] = '2a 27 aa a7';
|
43
|
-
k['%'] = '2a 06 aa 86'; k['_'] = '2a 0c aa 8c';
|
44
|
-
k['&'] = '2a 08 aa 88';
|
45
|
-
k['('] = '2a 0a aa 8a';
|
46
|
-
k[')'] = '2a 0b aa 8b';
|
47
|
-
|
11
|
+
# keycode hash, seeded with 'Tab' - which is special as it's longer than 1 char
|
12
|
+
k = { 'Tab' => '0f 8f' }
|
13
|
+
|
14
|
+
# add keycodes
|
15
|
+
|
16
|
+
# "pure" keys (no modifier keys)
|
17
|
+
lower_keys = {
|
18
|
+
'1234567890-=' => 0x02,
|
19
|
+
'qwertyuiop[]' => 0x10,
|
20
|
+
'asdfghjkl;\'`' => 0x1e,
|
21
|
+
'\\zxcvbnm,./' => 0x2b
|
22
|
+
}.each do |keys, offset|
|
23
|
+
keys.split('').each_with_index do |key, idx|
|
24
|
+
k[key] = sprintf('%02x %02x', idx + offset, idx + offset + 0x80)
|
25
|
+
end
|
26
|
+
end
|
48
27
|
|
28
|
+
# upcase keys (with shift)
|
29
|
+
{
|
30
|
+
'!@#$%^&*()_+' => 0x02,
|
31
|
+
'QWERTYUIOP{}' => 0x10,
|
32
|
+
'ASDFGHJKL:"~' => 0x1e,
|
33
|
+
'|ZXCVBNM<>?' => 0x2b
|
34
|
+
}.each do |keys, offset|
|
35
|
+
keys.split('').each_with_index do |key, idx|
|
36
|
+
k[key] = sprintf('2a %02x aa %02x', idx + offset, idx + offset + 0x80)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
49
40
|
special=Hash.new;
|
50
41
|
special['<Enter>'] = '1c 9c';
|
51
42
|
special['<Backspace>'] = '0e 8e';
|
@@ -53,7 +44,7 @@ module Veewee
|
|
53
44
|
special['<Return>'] = '1c 9c'
|
54
45
|
special['<Esc>'] = '01 81';
|
55
46
|
special['<Tab>'] = '0f 8f';
|
56
|
-
special['<KillX>'] = '1d 38 0e';
|
47
|
+
special['<KillX>'] = '1d 38 0e b8';
|
57
48
|
special['<Wait>'] = 'wait';
|
58
49
|
|
59
50
|
special['<Up>'] = '48 c8';
|
@@ -67,16 +58,8 @@ module Veewee
|
|
67
58
|
special['<Right>'] = '4d cd';
|
68
59
|
special['<Home>'] = '47 c7';
|
69
60
|
|
70
|
-
|
71
|
-
special[
|
72
|
-
special['<F3>'] = '3d';
|
73
|
-
special['<F4>'] = '3e';
|
74
|
-
special['<F5>'] = '3f';
|
75
|
-
special['<F6>'] = '40';
|
76
|
-
special['<F7>'] = '41';
|
77
|
-
special['<F8>'] = '42';
|
78
|
-
special['<F9>'] = '43';
|
79
|
-
special['<F10>'] = '44';
|
61
|
+
# F1 .. F10
|
62
|
+
(1..10).each { |num| special["<F#{num}>"] = sprintf('%02x', num + 0x3a) }
|
80
63
|
|
81
64
|
keycodes=''
|
82
65
|
thestring.gsub!(/ /,"<Spacebar>")
|
@@ -19,18 +19,11 @@ module Veewee
|
|
19
19
|
|
20
20
|
ui.info "Typing:[#{counter}]: "+s
|
21
21
|
|
22
|
-
|
22
|
+
# No need to send the state, we always PRESS then RELEASE.
|
23
|
+
# So we send the whole string at once and press/release every string item
|
24
|
+
keystring=self.string_to_parallels_keycode_string(s)
|
23
25
|
|
24
|
-
|
25
|
-
keycodes.each do |keycode|
|
26
|
-
unless keycode['code']=="wait"
|
27
|
-
send_keycode(keycode)
|
28
|
-
sleep 0.01
|
29
|
-
else
|
30
|
-
sleep 1
|
31
|
-
end
|
32
|
-
end
|
33
|
-
#sleep after each sequence (needs to be param)
|
26
|
+
send_string(keystring);
|
34
27
|
}
|
35
28
|
|
36
29
|
ui.info "Done typing."
|
@@ -39,95 +32,76 @@ module Veewee
|
|
39
32
|
|
40
33
|
end
|
41
34
|
|
42
|
-
def
|
43
|
-
python_script=File.join(File.dirname(__FILE__),'..','..','..','..','..','python','
|
44
|
-
command="python #{python_script} '#{self.name}' '#{
|
35
|
+
def send_string(keystring)
|
36
|
+
python_script=File.join(File.dirname(__FILE__),'..','..','..','..','..','python','parallels_send_string.py')
|
37
|
+
command="python #{python_script} '#{self.name}' '#{keystring}'"
|
45
38
|
shell_results=shell_exec("#{command}")
|
46
39
|
end
|
47
40
|
|
48
|
-
# Returns hash
|
49
|
-
def k2h(key,state)
|
50
|
-
return { 'code' => key, 'state' => state}
|
51
|
-
end
|
52
|
-
|
53
|
-
# Returns hash
|
54
|
-
def press2h(key)
|
55
|
-
k2h(key,'press')
|
56
|
-
end
|
57
|
-
|
58
|
-
# Returns hash
|
59
|
-
def release2h(key)
|
60
|
-
k2h(key,'release')
|
61
|
-
end
|
62
|
-
|
63
41
|
# Returns array
|
64
|
-
def
|
65
|
-
|
66
|
-
seq << press2h(key)
|
67
|
-
seq << release2h(key)
|
68
|
-
return seq
|
42
|
+
def press_key(key)
|
43
|
+
return key
|
69
44
|
end
|
70
45
|
|
71
46
|
# Returns array
|
72
47
|
def shift(sequence)
|
73
48
|
seq=Array.new
|
74
|
-
seq <<
|
49
|
+
seq << press_key('SHIFT_LEFT')
|
75
50
|
sequence.each do |s|
|
76
51
|
seq << s
|
77
52
|
end
|
78
|
-
seq << release2h('SHIFT_LEFT')
|
79
53
|
return seq
|
80
54
|
end
|
81
55
|
|
82
|
-
def
|
56
|
+
def string_to_parallels_keycode_string(thestring)
|
83
57
|
|
84
58
|
|
85
59
|
# Setup one key presses
|
86
60
|
k=Hash.new
|
87
61
|
for key in 'A'..'Z'
|
88
|
-
k[key] = shift(
|
62
|
+
k[key] = shift(press_key(key))
|
89
63
|
end
|
90
64
|
|
91
65
|
for key in 'a'..'z'
|
92
|
-
k[key] =
|
66
|
+
k[key] = press_key(key.upcase)
|
93
67
|
end
|
94
68
|
|
95
69
|
for key in '0'..'9'
|
96
|
-
k[key] =
|
70
|
+
k[key] = press_key(key.upcase)
|
97
71
|
end
|
98
72
|
|
99
|
-
k['>'] = shift(
|
100
|
-
k['.'] =
|
101
|
-
k['<'] = shift(
|
102
|
-
k[':'] = shift(
|
103
|
-
k[';'] =
|
104
|
-
k['/'] =
|
105
|
-
k[' '] =
|
106
|
-
k['-'] =
|
107
|
-
k['\''] =
|
108
|
-
k['{'] =
|
109
|
-
k['}'] =
|
110
|
-
k['`'] =
|
111
|
-
k['~'] = shift(
|
112
|
-
|
113
|
-
k['_'] = shift(
|
114
|
-
k['?'] = shift(
|
115
|
-
k['"'] = shift(
|
116
|
-
k[')'] = shift(
|
117
|
-
k['!'] = shift(
|
118
|
-
k['@'] = shift(
|
119
|
-
k['#'] = shift(
|
120
|
-
k['$'] = shift(
|
121
|
-
k['%'] = shift(
|
122
|
-
k['^'] = shift(
|
123
|
-
k['&'] = shift(
|
124
|
-
k['*'] = shift(
|
125
|
-
k['('] = shift(
|
126
|
-
k['|'] = shift(
|
127
|
-
k[','] =
|
128
|
-
k['\\'] =
|
129
|
-
k['+'] = shift(
|
130
|
-
k['='] =
|
73
|
+
k['>'] = shift(press_key('GREATER'))
|
74
|
+
k['.'] = press_key('GREATER')
|
75
|
+
k['<'] = shift(press_key('LESS'))
|
76
|
+
k[':'] = shift(press_key('COLON'))
|
77
|
+
k[';'] = press_key('COLON')
|
78
|
+
k['/'] = press_key('SLASH')
|
79
|
+
k[' '] = press_key('SPACE')
|
80
|
+
k['-'] = press_key('MINUS')
|
81
|
+
k['\''] = press_key('QUOTE')
|
82
|
+
k['{'] = press_key('CBRACE_LEFT')
|
83
|
+
k['}'] = press_key('CBRACE_RIGHT')
|
84
|
+
k['`'] = press_key('TILDA')
|
85
|
+
k['~'] = shift(press_key('TILDA'))
|
86
|
+
|
87
|
+
k['_'] = shift(press_key('MINUS'))
|
88
|
+
k['?'] = shift(press_key('SLASH'))
|
89
|
+
k['"'] = shift(press_key('QUOTE'))
|
90
|
+
k[')'] = shift(press_key('0'))
|
91
|
+
k['!'] = shift(press_key('1'))
|
92
|
+
k['@'] = shift(press_key('2'))
|
93
|
+
k['#'] = shift(press_key('3'))
|
94
|
+
k['$'] = shift(press_key('4'))
|
95
|
+
k['%'] = shift(press_key('5'))
|
96
|
+
k['^'] = shift(press_key('6'))
|
97
|
+
k['&'] = shift(press_key('7'))
|
98
|
+
k['*'] = shift(press_key('8'))
|
99
|
+
k['('] = shift(press_key('9'))
|
100
|
+
k['|'] = shift(press_key('BACKSLASH'))
|
101
|
+
k[','] = press_key('LESS')
|
102
|
+
k['\\'] = press_key('BACKSLASH')
|
103
|
+
k['+'] = shift(press_key('PLUS'))
|
104
|
+
k['='] = press_key('PLUS')
|
131
105
|
|
132
106
|
# Setup special keys
|
133
107
|
special=Hash.new;
|
@@ -153,10 +127,10 @@ module Veewee
|
|
153
127
|
special['<Home>'] = [{ 'code' => 'HOME', 'state' => 'press' }]
|
154
128
|
|
155
129
|
for i in 1..12 do
|
156
|
-
special["<F#{i}>"] =
|
130
|
+
special["<F#{i}>"] = press_key("F#{i}")
|
157
131
|
end
|
158
132
|
|
159
|
-
keycodes=
|
133
|
+
keycodes= ""
|
160
134
|
|
161
135
|
until thestring.length == 0
|
162
136
|
nospecial=true;
|
@@ -165,7 +139,7 @@ module Veewee
|
|
165
139
|
#take thestring
|
166
140
|
#check if it starts with a special key + pop special string
|
167
141
|
special[key].each do |c|
|
168
|
-
keycodes
|
142
|
+
keycodes.concat("#{c['code']} ")
|
169
143
|
end
|
170
144
|
thestring=thestring.slice(key.length,thestring.length-key.length)
|
171
145
|
nospecial=false;
|
@@ -176,7 +150,11 @@ module Veewee
|
|
176
150
|
code=k[thestring.slice(0,1)]
|
177
151
|
if !code.nil?
|
178
152
|
code.each do |c|
|
179
|
-
|
153
|
+
if(c == 'SHIFT_LEFT'):
|
154
|
+
keycodes.concat("#{c}\#")
|
155
|
+
else
|
156
|
+
keycodes.concat("#{c} ")
|
157
|
+
end
|
180
158
|
end
|
181
159
|
else
|
182
160
|
ui.info "no scan code for #{thestring.slice(0,1)}"
|
@@ -6,7 +6,7 @@ module Veewee
|
|
6
6
|
def build_info
|
7
7
|
info=super
|
8
8
|
info << { :filename => ".vbox_version",
|
9
|
-
:content => "#{self.
|
9
|
+
:content => "#{self.vboxga_version}" }
|
10
10
|
end
|
11
11
|
|
12
12
|
# Transfer information provide by the provider to the box
|
@@ -14,7 +14,7 @@ module Veewee
|
|
14
14
|
#
|
15
15
|
def transfer_buildinfo(options)
|
16
16
|
super(options)
|
17
|
-
iso_image="VBoxGuestAdditions_#{self.
|
17
|
+
iso_image="VBoxGuestAdditions_#{self.vboxga_version}.iso"
|
18
18
|
env.logger.info "About to transfer virtualbox guest additions iso to the box #{name} - #{ip_address} - #{ssh_options}"
|
19
19
|
self.scp("#{File.join(env.config.veewee.iso_dir,iso_image)}",File.basename(iso_image))
|
20
20
|
end
|
@@ -98,7 +98,7 @@ module Veewee
|
|
98
98
|
end
|
99
99
|
|
100
100
|
def attach_guest_additions
|
101
|
-
full_iso_file=File.join(env.config.veewee.iso_dir,"VBoxGuestAdditions_#{self.
|
101
|
+
full_iso_file=File.join(env.config.veewee.iso_dir,"VBoxGuestAdditions_#{self.vboxga_version}.iso")
|
102
102
|
ui.info "Mounting guest additions: #{full_iso_file}"
|
103
103
|
command ="#{@vboxcmd} storageattach \"#{name}\" --storagectl \"IDE Controller\" --type dvddrive --port 1 --device 0 --medium \"#{full_iso_file}\""
|
104
104
|
shell_exec("#{command}")
|
@@ -4,13 +4,12 @@ module Veewee
|
|
4
4
|
module BoxCommand
|
5
5
|
|
6
6
|
def download_vbox_guest_additions_iso(options)
|
7
|
-
version=self.
|
7
|
+
version=self.vboxga_version
|
8
8
|
isofile="VBoxGuestAdditions_#{version}.iso"
|
9
9
|
url="http://download.virtualbox.org/virtualbox/#{version}/#{isofile}"
|
10
10
|
ui.info "Downloading vbox guest additions iso v #{version} - #{url}"
|
11
11
|
download_iso(url,isofile)
|
12
12
|
end
|
13
|
-
|
14
13
|
end
|
15
14
|
end
|
16
15
|
end
|
@@ -2,6 +2,7 @@ module Veewee
|
|
2
2
|
module Provider
|
3
3
|
module Virtualbox
|
4
4
|
module BoxCommand
|
5
|
+
UNSYNCED_VERSIONS = {"4.2.1" => "4.2.0", "4.1.23" => "4.1.22"}
|
5
6
|
|
6
7
|
# Return the major/minor/incremental version of VirtualBox.
|
7
8
|
# For example: 4.1.8_Debianr75467 -> 4.1.8
|
@@ -12,6 +13,13 @@ module Veewee
|
|
12
13
|
return version
|
13
14
|
end
|
14
15
|
|
16
|
+
def vboxga_version
|
17
|
+
affected_version?(self.vbox_version) ? UNSYNCED_VERSIONS[self.vbox_version] : self.vbox_version
|
18
|
+
end
|
19
|
+
protected
|
20
|
+
def affected_version?(ver)
|
21
|
+
RUBY_PLATFORM.downcase.include?("darwin") && UNSYNCED_VERSIONS.has_key?(ver)
|
22
|
+
end
|
15
23
|
end
|
16
24
|
end
|
17
25
|
end
|
data/lib/veewee/version.rb
CHANGED