vagrant 0.6.6 → 0.6.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,9 @@
1
+ ## 0.6.7 (November 3, 2010)
2
+
3
+ - Added validation to verify that a box is specified.
4
+ - Proper error message when box is not found for `config.vm.box`. [GH-195]
5
+ - Fix output of `vagrant status` with multi-vm to be correct. [GH-196]
6
+
1
7
  ## 0.6.6 (October 14, 2010)
2
8
 
3
9
  - `vagrant status NAME` works once again. [GH-191]
@@ -8,7 +8,7 @@ GIT
8
8
  PATH
9
9
  remote: .
10
10
  specs:
11
- vagrant (0.6.6)
11
+ vagrant (0.6.7)
12
12
  archive-tar-minitar (= 0.5.2)
13
13
  erubis (~> 2.6.6)
14
14
  i18n (~> 0.4.1)
@@ -16,7 +16,7 @@ module Vagrant
16
16
 
17
17
  def package_base
18
18
  vm = VM.find(options[:base], env)
19
- raise Errors::BaseVMNotFoundError.new(:name => options[:base]) if !vm.created?
19
+ raise Errors::BaseVMNotFound.new(:name => options[:base]) if !vm.created?
20
20
  package_vm(vm)
21
21
  end
22
22
 
@@ -6,7 +6,7 @@ module Vagrant
6
6
  def route
7
7
  state = nil
8
8
  results = target_vms.collect do |vm|
9
- state ||= vm.created? ? vm.vm.state.to_s : "not_created"
9
+ state = vm.created? ? vm.vm.state.to_s : "not_created"
10
10
  "#{vm.name.to_s.ljust(25)}#{state.gsub("_", " ")}"
11
11
  end
12
12
 
@@ -104,8 +104,10 @@ module Vagrant
104
104
  end
105
105
  end
106
106
 
107
+ errors.add(I18n.t("vagrant.config.vm.box_missing")) if !box
108
+ errors.add(I18n.t("vagrant.config.vm.box_not_found", :name => box)) if box && !box_url && !env.box
107
109
  errors.add(I18n.t("vagrant.config.vm.boot_mode_invalid")) if ![:vrdp, :gui].include?(boot_mode.to_sym)
108
- errors.add(I18n.t("vagrant.config.vm.base_mac_invalid")) if !base_mac
110
+ errors.add(I18n.t("vagrant.config.vm.base_mac_invalid")) if env.box && !base_mac
109
111
  end
110
112
  end
111
113
  end
@@ -25,11 +25,16 @@ module Vagrant
25
25
  def vagrantfile(*args)
26
26
  path = args.shift.join("Vagrantfile") if Pathname === args.first
27
27
  path ||= vagrant_app("Vagrantfile")
28
+
29
+ # Create this box so that it exists
30
+ vagrant_box("base")
31
+
28
32
  str = args.shift || ""
29
33
  File.open(path.to_s, "w") do |f|
30
34
  f.puts "Vagrant::Config.run do |config|"
31
35
  f.puts "config.vagrant.home = '#{home_path}'"
32
36
  f.puts "config.vm.base_mac = 'foo' if !config.vm.base_mac"
37
+ f.puts "config.vm.box = 'base'"
33
38
  f.puts str
34
39
  f.puts "end"
35
40
  end
@@ -2,5 +2,5 @@ module Vagrant
2
2
  # This will always be up to date with the current version of Vagrant,
3
3
  # since it is used to generate the gemspec and is also the source of
4
4
  # the version for `vagrant -v`
5
- VERSION = "0.6.6"
5
+ VERSION = "0.6.7"
6
6
  end
@@ -115,6 +115,8 @@ en:
115
115
  vm:
116
116
  base_mac_invalid: "Base MAC address for eth0/NAT must be set. Contact box maintainer for more information."
117
117
  boot_mode_invalid: "Boot mode must be one of: vrdp or gui"
118
+ box_missing: "A box must be specified."
119
+ box_not_found: "The box '%{name}' could not be found."
118
120
  shared_folder_hostpath_missing: "Shared folder host path for '%{name}' doesn't exist: %{path}"
119
121
 
120
122
  #-------------------------------------------------------------------------------
@@ -178,7 +180,9 @@ en:
178
180
  waiting: Waiting for VM to boot. This can take a few minutes.
179
181
  ready: VM booted and ready for use!
180
182
  failed: Failed to connect to VM!
181
- failed_to_boot: VM failed to boot.
183
+ failed_to_boot: |-
184
+ Failed to connect to VM via SSH. Please verify the VM successfully booted
185
+ by looking at the VirtualBox GUI.
182
186
  check_box:
183
187
  not_found: Box %{name} was not found. Fetching box from specified URL...
184
188
  not_specified: |-
@@ -13,18 +13,19 @@ class BoxCollectionTest < Test::Unit::TestCase
13
13
 
14
14
  result = @klass.new(vagrant_env)
15
15
  names = result.collect { |b| b.name }.sort
16
- assert_equal 2, result.length
17
- assert_equal ["bar", "foo"], names
16
+ assert result.length >= 2
17
+ assert names.include?("foo")
18
+ assert names.include?("bar")
18
19
  end
19
20
 
20
21
  should "reload the box list" do
21
22
  instance = @klass.new(vagrant_env)
22
- assert instance.empty?
23
+ amount = instance.length
23
24
 
24
25
  vagrant_box("foo")
25
26
 
26
27
  instance.reload!
27
- assert !instance.empty?
28
+ assert_equal (amount + 1), instance.length
28
29
  end
29
30
 
30
31
  should "find a specific box" do
@@ -0,0 +1,27 @@
1
+ require "test_helper"
2
+
3
+ class CommandPackageCommandTest < Test::Unit::TestCase
4
+ setup do
5
+ @klass = Vagrant::Command::PackageCommand
6
+ @env = vagrant_env
7
+ end
8
+
9
+ def command(args, opts, env)
10
+ @klass.new(args, opts, { :env => env })
11
+ end
12
+
13
+ context "initialization" do
14
+ should "require an environment" do
15
+ assert_raises(Vagrant::Errors::CLIMissingEnvironment) { command([], {}, nil) }
16
+ assert_nothing_raised { command([], {}, @env) }
17
+ end
18
+ end
19
+
20
+ should "raise an exception if VM for supplied base option is not found" do
21
+ Vagrant::VM.stubs(:find).returns(Vagrant::VM.new(nil))
22
+
23
+ assert_raises(Vagrant::Errors::BaseVMNotFound) {
24
+ command([], { :base => "foo" }, @env).execute
25
+ }
26
+ end
27
+ end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 6
8
- - 6
9
- version: 0.6.6
8
+ - 7
9
+ version: 0.6.7
10
10
  platform: ruby
11
11
  authors:
12
12
  - Mitchell Hashimoto
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-10-14 00:00:00 -07:00
18
+ date: 2010-11-03 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -392,6 +392,7 @@ files:
392
392
  - test/vagrant/command/base_test.rb
393
393
  - test/vagrant/command/group_base_test.rb
394
394
  - test/vagrant/command/helpers_test.rb
395
+ - test/vagrant/command/package_test.rb
395
396
  - test/vagrant/config/base_test.rb
396
397
  - test/vagrant/config/error_recorder_test.rb
397
398
  - test/vagrant/config/ssh_test.rb
@@ -440,7 +441,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
440
441
  requirements:
441
442
  - - ">="
442
443
  - !ruby/object:Gem::Version
443
- hash: -3382562829572811448
444
+ hash: -1852392342619946444
444
445
  segments:
445
446
  - 0
446
447
  version: "0"