vagrant 0.9.5 → 0.9.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,19 @@
1
+ ## 0.9.7 (February 9, 2012)
2
+
3
+ - Fix regression where all subprocess IO simply didn't work with
4
+ Windows. [GH-721]
5
+
6
+ ## 0.9.6 (February 7, 2012)
7
+
8
+ - Fix strange issue with inconsistent childprocess reads on JRuby. [GH-711]
9
+ - `vagrant ssh` does a direct `exec()` syscall now instead of going through
10
+ the shell. This makes it so things like shell expansion oddities no longer
11
+ cause problems. [GH-715]
12
+ - Fix crashing case if there are no ports to forward.
13
+ - Fix issue surrounding improper configuration of host only networks on
14
+ RedHat guests. [GH-719]
15
+ - NFS should work properly on Gentoo. [GH-706]
16
+
1
17
  ## 0.9.5 (February 5, 2012)
2
18
 
3
19
  - Fix crashing case when all network options are `:auto_config false`.
@@ -160,6 +160,7 @@ Vagrant.hosts.register(:arch) { Vagrant::Hosts::Arch }
160
160
  Vagrant.hosts.register(:bsd) { Vagrant::Hosts::BSD }
161
161
  Vagrant.hosts.register(:fedora) { Vagrant::Hosts::Fedora }
162
162
  Vagrant.hosts.register(:freebsd) { Vagrant::Hosts::FreeBSD }
163
+ Vagrant.hosts.register(:gentoo) { Vagrant::Hosts::Gentoo }
163
164
  Vagrant.hosts.register(:linux) { Vagrant::Hosts::Linux }
164
165
  Vagrant.hosts.register(:windows) { Vagrant::Hosts::Windows }
165
166
 
@@ -81,7 +81,10 @@ module Vagrant
81
81
  ports << options.merge(:name => options[:name], :adapter => options[:adapter])
82
82
  end
83
83
 
84
- @env[:vm].driver.forward_ports(ports)
84
+ if !ports.empty?
85
+ # We only need to forward ports if there are any to forward
86
+ @env[:vm].driver.forward_ports(ports)
87
+ end
85
88
  end
86
89
  end
87
90
  end
@@ -144,7 +144,7 @@ module Vagrant
144
144
  pf_builder.join(",")])
145
145
  end
146
146
 
147
- execute("modifyvm", @uuid, *args)
147
+ execute("modifyvm", @uuid, *args) if !args.empty?
148
148
  end
149
149
 
150
150
  def halt
@@ -144,7 +144,7 @@ module Vagrant
144
144
  pf_builder.join(",")])
145
145
  end
146
146
 
147
- execute("modifyvm", @uuid, *args)
147
+ execute("modifyvm", @uuid, *args) if !args.empty?
148
148
  end
149
149
 
150
150
  def halt
@@ -39,9 +39,9 @@ module Vagrant
39
39
  # each specifically, we avoid reconfiguring eth0 (the NAT interface) so
40
40
  # SSH never dies.
41
41
  interfaces.each do |interface|
42
- vm.channel.sudo("/sbin/ifconfig eth#{interface} down 2> /dev/null")
42
+ vm.channel.sudo("/sbin/ifdown eth#{interface} 2> /dev/null", :error_check => false)
43
43
  vm.channel.sudo("cat /tmp/vagrant-network-entry_#{interface} >> #{network_scripts_dir}/ifcfg-eth#{interface}")
44
- vm.channel.sudo("/sbin/ifconfig eth#{interface} up 2> /dev/null")
44
+ vm.channel.sudo("/sbin/ifup eth#{interface} 2> /dev/null")
45
45
  end
46
46
  end
47
47
 
@@ -7,6 +7,7 @@ module Vagrant
7
7
  autoload :BSD, 'vagrant/hosts/bsd'
8
8
  autoload :FreeBSD, 'vagrant/hosts/freebsd'
9
9
  autoload :Fedora, 'vagrant/hosts/fedora'
10
+ autoload :Gentoo, 'vagrant/hosts/gentoo'
10
11
  autoload :Linux, 'vagrant/hosts/linux'
11
12
  autoload :Windows, 'vagrant/hosts/windows'
12
13
 
@@ -0,0 +1,20 @@
1
+ module Vagrant
2
+ module Hosts
3
+ class Gentoo < Linux
4
+ def self.match?
5
+ return File.exists?("/etc/gentoo-release")
6
+ end
7
+
8
+ # Normal, mid-range precedence.
9
+ def self.precedence
10
+ 5
11
+ end
12
+
13
+ def initialize(*args)
14
+ super
15
+
16
+ @nfs_server_binary = "/etc/init.d/nfs"
17
+ end
18
+ end
19
+ end
20
+ end
@@ -146,12 +146,7 @@ module Vagrant
146
146
  :manifest => @manifest_file)
147
147
 
148
148
  env[:vm].channel.sudo(command) do |type, data|
149
- # Output the data with the proper color based on the stream.
150
- color = type == :stdout ? :green : :red
151
-
152
- # Note: Be sure to chomp the data to avoid the newlines that the
153
- # Chef outputs.
154
- env[:ui].info(data.chomp, :color => color, :prefix => false)
149
+ env[:ui].info(data.chomp, :prefix => false)
155
150
  end
156
151
  end
157
152
 
@@ -75,26 +75,26 @@ module Vagrant
75
75
  options[:private_key_path] = ssh_info[:private_key_path]
76
76
 
77
77
  # Command line options
78
- command_options = ["-p #{options[:port]}", "-o UserKnownHostsFile=/dev/null",
79
- "-o StrictHostKeyChecking=no", "-o IdentitiesOnly=yes",
80
- "-o LogLevel=ERROR"]
81
- command_options << "-i #{options[:private_key_path]}" if !plain_mode
82
- command_options << "-o ForwardAgent=yes" if ssh_info[:forward_agent]
78
+ command_options = ["-p", options[:port].to_s, "-o", "UserKnownHostsFile=/dev/null",
79
+ "-o", "StrictHostKeyChecking=no", "-o", "IdentitiesOnly=yes",
80
+ "-o", "LogLevel=ERROR"]
81
+ command_options += ["-i", options[:private_key_path]] if !plain_mode
82
+ command_options += ["-o", "ForwardAgent=yes"] if ssh_info[:forward_agent]
83
83
 
84
84
  # If there are extra options, then we append those
85
85
  command_options.concat(opts[:extra_args]) if opts[:extra_args]
86
86
 
87
87
  if ssh_info[:forward_x11]
88
88
  # Both are required so that no warnings are shown regarding X11
89
- command_options << "-o ForwardX11=yes"
90
- command_options << "-o ForwardX11Trusted=yes"
89
+ command_options += ["-o", "ForwardX11=yes"]
90
+ command_options += ["-o", "ForwardX11Trusted=yes"]
91
91
  end
92
92
 
93
93
  host_string = options[:host]
94
94
  host_string = "#{options[:username]}@#{host_string}" if !plain_mode
95
- command = "ssh #{command_options.join(" ")} #{host_string}".strip
96
- @logger.info("Invoking SSH: #{command}")
97
- safe_exec(command)
95
+ command_options << host_string
96
+ @logger.info("Invoking SSH: #{command_options.inspect}")
97
+ safe_exec("ssh", *command_options)
98
98
  end
99
99
 
100
100
  # Checks the file permissions for a private key, resetting them
@@ -78,8 +78,11 @@ module Vagrant
78
78
  # given vagrant environment. This allows for testing of middlewares.
79
79
  def action_env(v_env = nil)
80
80
  v_env ||= vagrant_env
81
+ # duplicate the Vagrant::Environment ui and get the default vm object
82
+ # for the new action environment from the first pair in the vms list
83
+ opts = {:ui => v_env.ui.dup, :vm => v_env.vms.first.last}
81
84
  app = lambda { |env| }
82
- env = Vagrant::Action::Environment.new(v_env)
85
+ env = Vagrant::Action::Environment.new(opts)
83
86
  env["vagrant.test"] = true
84
87
  [app, env]
85
88
  end
@@ -15,7 +15,6 @@ module Vagrant
15
15
  matchers = [/\e\[\d*[ABCD]/, # Matches things like \e[4D
16
16
  /\e\[(\d*;)?\d*[HF]/, # Matches \e[1;2H or \e[H
17
17
  /\e\[(s|u|2J|K)/, # Matches \e[s, \e[2J, etc.
18
- /\e\[(\d*;){0,2}\d*m/, # Matches color escapes: \e[32m
19
18
  /\e\[=\d*[hl]/, # Matches \e[=24h
20
19
  /\e\[\?[1-9][hl]/, # Matches \e[?2h
21
20
  /\e\[20[hl]/, # Matches \e[20l]
@@ -7,7 +7,7 @@ module Vagrant
7
7
  # thread. In that case, `safe_exec` automatically falls back to
8
8
  # forking.
9
9
  module SafeExec
10
- def safe_exec(command)
10
+ def safe_exec(command, *args)
11
11
  # Create a list of things to rescue from. Since this is OS
12
12
  # specific, we need to do some defined? checks here to make
13
13
  # sure they exist.
@@ -20,7 +20,7 @@ module Vagrant
20
20
  begin
21
21
  pid = nil
22
22
  pid = fork if fork_instead
23
- Kernel.exec(command) if pid.nil?
23
+ Kernel.exec(command, *args) if pid.nil?
24
24
  Process.wait(pid) if pid
25
25
  rescue *rescue_from
26
26
  # We retried already, raise the issue and be done
@@ -64,9 +64,13 @@ module Vagrant
64
64
  # Make sure the stdin does not buffer
65
65
  process.io.stdin.sync = true
66
66
 
67
- # Close the writer pipes, since we're just reading
68
- stdout_writer.close
69
- stderr_writer.close
67
+ if RUBY_PLATFORM != "java"
68
+ # On Java, we have to close after. See down the method...
69
+ # Otherwise, we close the writers right here, since we're
70
+ # not on the writing side.
71
+ stdout_writer.close
72
+ stderr_writer.close
73
+ end
70
74
 
71
75
  # Create a dictionary to store all the output we see.
72
76
  io_data = { :stdout => "", :stderr => "" }
@@ -140,6 +144,13 @@ module Vagrant
140
144
  yield io_name, extra_data if block_given?
141
145
  end
142
146
 
147
+ if RUBY_PLATFORM == "java"
148
+ # On JRuby, we need to close the writers after the process,
149
+ # for some reason. See GH-711.
150
+ stdout_writer.close
151
+ stderr_writer.close
152
+ end
153
+
143
154
  # Return an exit status container
144
155
  return Result.new(process.exit_code, io_data[:stdout], io_data[:stderr])
145
156
  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.9.5"
5
+ VERSION = "0.9.7"
6
6
  end
@@ -11,7 +11,6 @@ describe Vagrant::Util::ANSIEscapeCodeRemover do
11
11
 
12
12
  it "should remove ANSI escape codes" do
13
13
  klass.remove_ansi_escape_codes("\e[Hyo").should == "yo"
14
- klass.remove_ansi_escape_codes("\e[38myo").should == "yo"
15
14
  end
16
15
  end
17
16
 
@@ -15,7 +15,7 @@ Gem::Specification.new do |s|
15
15
  s.rubyforge_project = "vagrant"
16
16
 
17
17
  s.add_dependency "archive-tar-minitar", "= 0.5.2"
18
- s.add_dependency "childprocess", "~> 0.3.0"
18
+ s.add_dependency "childprocess", "~> 0.3.1"
19
19
  s.add_dependency "erubis", "~> 2.7.0"
20
20
  s.add_dependency "json", "~> 1.5.1"
21
21
  s.add_dependency "log4r", "~> 1.1.9"
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant
3
3
  version: !ruby/object:Gem::Version
4
- hash: 49
4
+ hash: 53
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 9
9
- - 5
10
- version: 0.9.5
9
+ - 7
10
+ version: 0.9.7
11
11
  platform: ruby
12
12
  authors:
13
13
  - Mitchell Hashimoto
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2012-02-05 00:00:00 Z
19
+ date: 2012-02-09 00:00:00 Z
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
22
  version_requirements: &id001 !ruby/object:Gem::Requirement
@@ -40,12 +40,12 @@ dependencies:
40
40
  requirements:
41
41
  - - ~>
42
42
  - !ruby/object:Gem::Version
43
- hash: 19
43
+ hash: 17
44
44
  segments:
45
45
  - 0
46
46
  - 3
47
- - 0
48
- version: 0.3.0
47
+ - 1
48
+ version: 0.3.1
49
49
  name: childprocess
50
50
  type: :runtime
51
51
  prerelease: false
@@ -395,6 +395,7 @@ files:
395
395
  - lib/vagrant/hosts/bsd.rb
396
396
  - lib/vagrant/hosts/fedora.rb
397
397
  - lib/vagrant/hosts/freebsd.rb
398
+ - lib/vagrant/hosts/gentoo.rb
398
399
  - lib/vagrant/hosts/linux.rb
399
400
  - lib/vagrant/hosts/windows.rb
400
401
  - lib/vagrant/plugin.rb