veewee 0.3.0.alpha6 → 0.3.0.alpha7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. data/lib/veewee/command/kvm.rb +1 -1
  2. data/lib/veewee/command/vagrant/basebox.rb +2 -0
  3. data/lib/veewee/command/vagrant/build.rb +1 -1
  4. data/lib/veewee/command/vagrant/define.rb +1 -1
  5. data/lib/veewee/command/vagrant/destroy.rb +1 -1
  6. data/lib/veewee/command/vagrant/export.rb +1 -1
  7. data/lib/veewee/command/vagrant/halt.rb +1 -1
  8. data/lib/veewee/command/vagrant/list.rb +2 -2
  9. data/lib/veewee/command/vagrant/ostypes.rb +2 -2
  10. data/lib/veewee/command/vagrant/ssh.rb +1 -2
  11. data/lib/veewee/command/vagrant/templates.rb +3 -3
  12. data/lib/veewee/command/vagrant/undefine.rb +2 -2
  13. data/lib/veewee/command/vagrant/up.rb +1 -1
  14. data/lib/veewee/command/vagrant/validate.rb +44 -0
  15. data/lib/veewee/command/virtualbox.rb +3 -3
  16. data/lib/veewee/config/definition.rb +4 -4
  17. data/lib/veewee/definition.rb +8 -0
  18. data/lib/veewee/provider/core/box.rb +7 -0
  19. data/lib/veewee/provider/core/box/build.rb +12 -12
  20. data/lib/veewee/provider/core/box/exec.rb +2 -2
  21. data/lib/veewee/provider/core/box/scp.rb +2 -2
  22. data/lib/veewee/provider/core/box/ssh.rb +1 -1
  23. data/lib/veewee/provider/core/box/vnc.rb +3 -3
  24. data/lib/veewee/provider/core/helper/iso.rb +30 -30
  25. data/lib/veewee/provider/core/helper/scancode.rb +1 -1
  26. data/lib/veewee/provider/core/helper/shell.rb +6 -6
  27. data/lib/veewee/provider/core/helper/ssh.rb +15 -17
  28. data/lib/veewee/provider/core/helper/tcp.rb +4 -4
  29. data/lib/veewee/provider/core/helper/web.rb +6 -6
  30. data/lib/veewee/provider/core/provider.rb +20 -13
  31. data/lib/veewee/provider/core/provider/tunnel.rb +8 -8
  32. data/lib/veewee/provider/kvm/box/helper/console_type.rb +1 -1
  33. data/lib/veewee/provider/kvm/box/validate_kvm.rb +2 -2
  34. data/lib/veewee/provider/parallels/box/create.rb +1 -1
  35. data/lib/veewee/provider/parallels/box/destroy.rb +1 -1
  36. data/lib/veewee/provider/parallels/box/helper/buildinfo.rb +1 -1
  37. data/lib/veewee/provider/parallels/box/helper/console_type.rb +5 -5
  38. data/lib/veewee/provider/parallels/box/validate_parallels.rb +2 -2
  39. data/lib/veewee/provider/virtualbox/box/destroy.rb +7 -7
  40. data/lib/veewee/provider/virtualbox/box/export_vagrant.rb +18 -18
  41. data/lib/veewee/provider/virtualbox/box/helper/console_type.rb +8 -8
  42. data/lib/veewee/provider/virtualbox/box/helper/create.rb +8 -8
  43. data/lib/veewee/provider/virtualbox/box/helper/guest_additions.rb +1 -1
  44. data/lib/veewee/provider/virtualbox/box/poweroff.rb +1 -1
  45. data/lib/veewee/provider/virtualbox/box/up.rb +2 -2
  46. data/lib/veewee/provider/virtualbox/box/validate_vagrant.rb +3 -3
  47. data/lib/veewee/providers.rb +1 -1
  48. data/lib/veewee/ui.rb +2 -0
  49. data/lib/veewee/version.rb +1 -1
  50. data/templates/CentOS-5.7-i386-netboot/definition.rb +1 -1
  51. data/templates/CentOS-5.7-i386-netboot/ks.cfg +1 -1
  52. data/templates/Debian-6.0.3-amd64-netboot/definition.rb +1 -1
  53. data/templates/Debian-6.0.3-i386-netboot/definition.rb +1 -1
  54. metadata +3 -2
@@ -12,13 +12,13 @@ module Veewee
12
12
 
13
13
  def send_virtualbox_sequence(sequence)
14
14
 
15
- env.ui.info ""
15
+ ui.info ""
16
16
 
17
17
  counter=0
18
18
  sequence.each { |s|
19
19
  counter=counter+1
20
20
 
21
- env.ui.info "Typing:[#{counter}]: "+s
21
+ ui.info "Typing:[#{counter}]: "+s
22
22
 
23
23
  keycodes=Veewee::Provider::Core::Helper::Scancode.string_to_keycode(s)
24
24
 
@@ -38,8 +38,8 @@ module Veewee
38
38
  sleep 0.5
39
39
  }
40
40
 
41
- env.ui.info "Done typing."
42
- env.ui.info ""
41
+ ui.info "Done typing."
42
+ ui.info ""
43
43
 
44
44
  end
45
45
 
@@ -48,10 +48,10 @@ module Veewee
48
48
  env.logger.info "#{command}"
49
49
  sshresult=shell_exec("#{command}",{:mute => true})
50
50
  unless sshresult.stdout.index("E_ACCESSDENIED").nil?
51
- env.ui.error "There was an error typing the commands on the console"
52
- env.ui.error "Probably the VM did not get started."
53
- env.ui.error ""
54
- env.ui.error "#{sshresult.stdout}"
51
+ ui.error "There was an error typing the commands on the console"
52
+ ui.error "Probably the VM did not get started."
53
+ ui.error ""
54
+ ui.error "#{sshresult.stdout}"
55
55
  exit -1
56
56
  end
57
57
  end
@@ -66,7 +66,7 @@ module Veewee
66
66
 
67
67
 
68
68
  def create_disk
69
- env.ui.info "Creating new harddrive of size #{definition.disk_size.to_i} "
69
+ ui.info "Creating new harddrive of size #{definition.disk_size.to_i} "
70
70
 
71
71
 
72
72
  place=get_vbox_home
@@ -81,7 +81,7 @@ module Veewee
81
81
  location=name+"."+definition.disk_format.downcase
82
82
 
83
83
  location="#{File.join(place,name,location)}"
84
- env.ui.info "Attaching disk: #{location}"
84
+ ui.info "Attaching disk: #{location}"
85
85
 
86
86
  #command => "${vboxcmd} storageattach \"${vname}\" --storagectl \"SATA Controller\" --port 0 --device 0 --type hdd --medium \"${vname}.vdi\"",
87
87
  command ="#{@vboxcmd} storageattach \"#{name}\" --storagectl \"SATA Controller\" --port 0 --device 0 --type hdd --medium \"#{location}\""
@@ -92,14 +92,14 @@ module Veewee
92
92
 
93
93
  def attach_isofile
94
94
  full_iso_file=File.join(env.config.veewee.iso_dir,definition.iso_file)
95
- env.ui.info "Mounting cdrom: #{full_iso_file}"
95
+ ui.info "Mounting cdrom: #{full_iso_file}"
96
96
  command ="#{@vboxcmd} storageattach \"#{name}\" --storagectl \"IDE Controller\" --type dvddrive --port 0 --device 0 --medium \"#{full_iso_file}\""
97
97
  shell_exec("#{command}")
98
98
  end
99
99
 
100
100
  def attach_guest_additions
101
101
  full_iso_file=File.join(env.config.veewee.iso_dir,"VBoxGuestAdditions_#{self.vbox_version}.iso")
102
- env.ui.info "Mounting guest additions: #{full_iso_file}"
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}")
105
105
  end
@@ -137,7 +137,7 @@ module Veewee
137
137
  #Exec and system stop the execution here
138
138
  shell_exec("#{command}")
139
139
 
140
- env.ui.info "Creating vm #{name} : #{definition.memory_size}M - #{definition.cpu_count} CPU - #{vbox_os_type_id(definition.os_type_id)}"
140
+ ui.info "Creating vm #{name} : #{definition.memory_size}M - #{definition.cpu_count} CPU - #{vbox_os_type_id(definition.os_type_id)}"
141
141
 
142
142
  #setting cpu's
143
143
  command="#{@vboxcmd} modifyvm \"#{name}\" --cpus #{definition.cpu_count}"
@@ -157,8 +157,8 @@ module Veewee
157
157
  vm_flags.each do |vm_flag|
158
158
  if definition.instance_variable_defined?("@#{vm_flag}")
159
159
  vm_flag_value=definition.instance_variable_get("@#{vm_flag}")
160
- env.ui.info "Setting VM Flag #{vm_flag} to #{vm_flag_value}"
161
- env.ui.warn "Used of #{vm_flag} is deprecated - specify your options in :virtualbox => { : vm_options => [\"#{vm_flag}\" => \"#{vm_flag_value}\"]}"
160
+ ui.info "Setting VM Flag #{vm_flag} to #{vm_flag_value}"
161
+ ui.warn "Used of #{vm_flag} is deprecated - specify your options in :virtualbox => { : vm_options => [\"#{vm_flag}\" => \"#{vm_flag_value}\"]}"
162
162
  command="#{@vboxcmd} modifyvm #{name} --#{vm_flag.to_s} #{vm_flag_value}"
163
163
  shell_exec("#{command}")
164
164
  end
@@ -166,7 +166,7 @@ module Veewee
166
166
 
167
167
  unless definition.virtualbox[:vm_options][0].nil?
168
168
  definition.virtualbox[:vm_options][0].each do |vm_flag,vm_flag_value|
169
- env.ui.info "Setting VM Flag #{vm_flag} to #{vm_flag_value}"
169
+ ui.info "Setting VM Flag #{vm_flag} to #{vm_flag_value}"
170
170
  command="#{@vboxcmd} modifyvm #{name} --#{vm_flag.to_s} #{vm_flag_value}"
171
171
  shell_exec("#{command}")
172
172
  end
@@ -7,7 +7,7 @@ module Veewee
7
7
  version=self.vbox_version
8
8
  isofile="VBoxGuestAdditions_#{version}.iso"
9
9
  url="http://download.virtualbox.org/virtualbox/#{version}/#{isofile}"
10
- env.ui.info "Downloading vbox guest additions iso v #{version} - #{url}"
10
+ ui.info "Downloading vbox guest additions iso v #{version} - #{url}"
11
11
  download_iso(url,isofile)
12
12
  end
13
13
 
@@ -6,7 +6,7 @@ module Veewee
6
6
  def poweroff(options={})
7
7
  # If the vm is not powered off, perform a shutdown
8
8
  if (self.exists? && self.running?)
9
- env.ui.info "Shutting down vm #{name}"
9
+ ui.info "Shutting down vm #{name}"
10
10
  #We force it here, maybe vm.shutdown is cleaner
11
11
  command="#{@vboxcmd} controlvm \"#{name}\" poweroff"
12
12
  shell_exec("#{command}")
@@ -6,7 +6,7 @@ module Veewee
6
6
  def up(options={})
7
7
 
8
8
  unless self.exists?
9
- env.ui.error "Error:: You tried to up a non-existing box '#{name}'"
9
+ ui.error "Error:: You tried to up a non-existing box '#{name}'"
10
10
  exit -1
11
11
  end
12
12
 
@@ -23,7 +23,7 @@ module Veewee
23
23
  if guessed_port!=forward[:guest_port]
24
24
  # Remove the existing one
25
25
  self.delete_forwarding("guestssh")
26
- env.ui.warn "Changing ssh port from #{forward[:guest_port]} to #{guessed_port}"
26
+ ui.warn "Changing ssh port from #{forward[:guest_port]} to #{guessed_port}"
27
27
  self.add_ssh_nat_mapping
28
28
  end
29
29
  else
@@ -6,7 +6,7 @@ module Veewee
6
6
  def validate_vagrant(options)
7
7
 
8
8
  unless self.running?
9
- env.ui.error "Error:: You tried to validate box '#{name}' but it is not running"
9
+ ui.error "Error:: You tried to validate box '#{name}' but it is not running"
10
10
  exit -1
11
11
  end
12
12
 
@@ -40,8 +40,8 @@ module Veewee
40
40
  rescue SystemExit => e
41
41
  Kernel.exit(e.status)
42
42
  rescue Exception => e
43
- env.ui.error("#{e.message} (#{e.class})")
44
- env.ui.error(e.backtrace.join("\n"))
43
+ ui.error("#{e.message} (#{e.class})")
44
+ ui.error(e.backtrace.join("\n"))
45
45
  Kernel.exit(1)
46
46
  end
47
47
 
@@ -19,7 +19,7 @@ module Veewee
19
19
  rescue ::Veewee::Error => e
20
20
  raise
21
21
  rescue Error => e
22
- env.ui.error "Error loading provider with #{name},#{$!}"
22
+ env.ui.error "Error loading provider with #{name},#{$!}",:prefix => false
23
23
  end
24
24
  end
25
25
 
@@ -5,6 +5,7 @@ module Veewee
5
5
  # of `warn`, `error`, `info`, and `success`.
6
6
  class UI
7
7
  attr_accessor :env
8
+ attr_accessor :resource
8
9
 
9
10
  def initialize(env)
10
11
  @env = env
@@ -71,6 +72,7 @@ module Veewee
71
72
  def format_message(message, opts=nil)
72
73
  opts = { :prefix => true }.merge(opts || {})
73
74
  opts[:prefix]=false if env.resource=="veewee"
75
+ opts[:prefix]=false if env.resource=="vagrant"
74
76
  message = "[#{env.resource}] #{message}" if opts[:prefix]
75
77
  message
76
78
  end
@@ -4,5 +4,5 @@ end
4
4
 
5
5
  # Only set the version constant if it wasn't set before
6
6
  unless defined?(Veewee::VERSION)
7
- ::Veewee::VERSION="0.3.0.alpha6"
7
+ ::Veewee::VERSION="0.3.0.alpha7"
8
8
  end
@@ -3,7 +3,7 @@ Veewee::Session.declare({
3
3
  :disk_size => '10140', :disk_format => 'VDI', :hostiocache => 'off', :ioapic => 'on', :pae => 'on',
4
4
  :os_type_id => 'RedHat',
5
5
  :iso_file => "CentOS-5.7-i386-netinstall.iso",
6
- :iso_src => "http://mirror.atlanticmetro.net/centos/5.7/isos/i386/CentOS-5.7-i386-netinstall.iso",
6
+ :iso_src => "http://vault.centos.org/5.7/isos/i386/CentOS-5.7-i386-netinstall.iso",
7
7
  :iso_md5 => "11222d9134cdfc101f6f91fe544254c9",
8
8
  :iso_download_timeout => 1000,
9
9
  :boot_wait => "10", :boot_cmd_sequence => [ 'linux text ks=http://%IP%:%PORT%/ks.cfg<Enter>' ],
@@ -1,7 +1,7 @@
1
1
  # Kickstart file automatically generated by anaconda.
2
2
 
3
3
  install
4
- url --url=http://mirror.atlanticmetro.net/centos/5.7/os/i386
4
+ url --url=http://vault.centos.org/5.7/os/i386
5
5
  lang en_US.UTF-8
6
6
  langsupport --default=en_US.UTF-8 en_US.UTF-8
7
7
  keyboard us
@@ -4,7 +4,7 @@ Veewee::Definition.declare({
4
4
  :disk_size => '10140', :disk_format => 'VDI', :hostiocache => 'off',
5
5
  :os_type_id => 'Debian_64',
6
6
  :iso_file => "debian-6.0.3-amd64-netinst.iso",
7
- :iso_src => "http://cdimage.debian.org/debian-cd/6.0.3/amd64/iso-cd/debian-6.0.3-amd64-netinst.iso",
7
+ :iso_src => "http://cdimage.debian.org/cdimage/archive/6.0.3/amd64/iso-cd/debian-6.0.3-amd64-netinst.iso",
8
8
  :iso_md5 => "b663727d7f5b572c329cea8e2ff5e29c",
9
9
  :iso_download_timeout => "1000",
10
10
  :boot_wait => "10", :boot_cmd_sequence => [
@@ -6,7 +6,7 @@ Veewee::Definition.declare({
6
6
  :disk_size => '10140', :disk_format => 'VDI', :hostiocache => 'off',
7
7
  :os_type_id => 'Debian',
8
8
  :iso_file => "debian-6.0.3-i386-netinst.iso",
9
- :iso_src => "http://cdimage.debian.org/debian-cd/6.0.3/i386/iso-cd/debian-6.0.3-i386-netinst.iso",
9
+ :iso_src => "http://cdimage.debian.org/cdimage/archive/6.0.3/i386/iso-cd/debian-6.0.3-i386-netinst.iso",
10
10
  :iso_md5 => "bf10748a0b867912727b248d2e21e8ba",
11
11
  :iso_download_timeout => "1000",
12
12
  :boot_wait => "10", :boot_cmd_sequence => [
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: veewee
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease: 6
5
- version: 0.3.0.alpha6
5
+ version: 0.3.0.alpha7
6
6
  platform: ruby
7
7
  authors:
8
8
  - Patrick Debois
@@ -260,6 +260,7 @@ files:
260
260
  - lib/veewee/command/vagrant/templates.rb
261
261
  - lib/veewee/command/vagrant/undefine.rb
262
262
  - lib/veewee/command/vagrant/up.rb
263
+ - lib/veewee/command/vagrant/validate.rb
263
264
  - lib/veewee/command/version.rb
264
265
  - lib/veewee/command/virtualbox.rb
265
266
  - lib/veewee/command/vmfusion.rb
@@ -916,7 +917,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
916
917
  requirements:
917
918
  - - ">="
918
919
  - !ruby/object:Gem::Version
919
- hash: -1280042332517595849
920
+ hash: 71648237759924019
920
921
  segments:
921
922
  - 0
922
923
  version: "0"