vagrant 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,9 @@
1
+ ## 1.0.3 (May 1, 2012)
2
+
3
+ - Don't enable NAT DNS proxy on machines where resolv.conf already points
4
+ to localhost. This allows Vagrant to work once again with Ubuntu
5
+ 12.04. [GH-909]
6
+
1
7
  ## 1.0.2 (March 25, 2012)
2
8
 
3
9
  - Provisioners will still mount folders and such if `--no-provision` is
@@ -28,13 +28,34 @@ module Vagrant
28
28
  ]
29
29
  attempt_and_log(command, "Enabling the Host I/O cache on the SATA controller...")
30
30
 
31
- # Enable the DNS proxy while in NAT mode. This shields the guest
32
- # VM from external DNS changs on the host machine.
33
- command = [
34
- "modifyvm", env[:vm].uuid,
35
- "--natdnsproxy1", "on"
36
- ]
37
- attempt_and_log(command, "Enable the NAT DNS proxy on adapter 1...")
31
+ enable_dns_proxy = true
32
+ begin
33
+ contents = File.read("/etc/resolv.conf")
34
+
35
+ if contents =~ /^nameserver 127\.0\.0\.1$/
36
+ # The use of both natdnsproxy and natdnshostresolver break on
37
+ # Ubuntu 12.04 that uses resolvconf with localhost. When used
38
+ # VirtualBox will give the client dns server 10.0.2.3, while
39
+ # not binding to that address itself. Therefore disable this
40
+ # feature if host uses the resolvconf server 127.0.0.1
41
+ @logger.info("Disabling DNS proxy since resolv.conf contains 127.0.0.1")
42
+ enable_dns_proxy = false
43
+ end
44
+ rescue Errno::ENOENT; end
45
+
46
+ # Enable/disable the NAT DNS proxy as necessary
47
+ if enable_dns_proxy
48
+ command = [
49
+ "modifyvm", env[:vm].uuid,
50
+ "--natdnsproxy1", "on"
51
+ ]
52
+ attempt_and_log(command, "Enable the NAT DNS proxy on adapter 1...")
53
+ else
54
+ command = [ "modifyvm", env[:vm].uuid, "--natdnsproxy1", "off" ]
55
+ attempt_and_log(command, "Disable the NAT DNS proxy on adapter 1...")
56
+ command = [ "modifyvm", env[:vm].uuid, "--natdnshostresolver1", "off" ]
57
+ attempt_and_log(command, "Disable the NAT DNS resolver on adapter 1...")
58
+ end
38
59
 
39
60
  @app.call(env)
40
61
  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 = "1.0.2"
5
+ VERSION = "1.0.3"
6
6
  end
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: 19
4
+ hash: 17
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 2
10
- version: 1.0.2
9
+ - 3
10
+ version: 1.0.3
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-03-25 00:00:00 Z
19
+ date: 2012-05-02 00:00:00 Z
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
22
  name: archive-tar-minitar