vagrant-hostmanager 1.2.1 → 1.2.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,14 +6,20 @@ module VagrantPlugins
6
6
  def update_guest(machine)
7
7
  return unless machine.communicate.ready?
8
8
 
9
+ if (machine.communicate.test("uname -s | grep SunOS"))
10
+ realhostfile = '/etc/inet/hosts'
11
+ else
12
+ realhostfile = '/etc/hosts'
13
+ end
14
+
9
15
  # download and modify file with Vagrant-managed entries
10
16
  file = @global_env.tmp_path.join("hosts.#{machine.name}")
11
- machine.communicate.download('/etc/hosts', file)
17
+ machine.communicate.download(realhostfile, file)
12
18
  update_file(file)
13
19
 
14
20
  # upload modified file and remove temporary file
15
21
  machine.communicate.upload(file, '/tmp/hosts')
16
- machine.communicate.sudo('mv /tmp/hosts /etc/hosts')
22
+ machine.communicate.sudo("mv /tmp/hosts #{realhostfile}")
17
23
  # i have no idea if this is a windows competibility issue or not, but sometimes it dosen't work on my machine
18
24
  begin
19
25
  FileUtils.rm(file)
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module HostManager
3
- VERSION = '1.2.1'
3
+ VERSION = '1.2.2'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-hostmanager
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-09-09 00:00:00.000000000 Z
12
+ date: 2013-10-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler