vagrant-goodhosts 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2a413f4af6b28126f7bfa544c51fd1861d6809d3f2092ca512f4f3cb92b66a98
4
- data.tar.gz: 278595e91fb77a7f0b1e9a439f21718c3c89c88d6cba2642cc15fc41f063c959
3
+ metadata.gz: 14f2491ca0ba5cd0b97ed3cba9cdb6d0bd53264424bd99e7f332f4f5a5c33478
4
+ data.tar.gz: a86835472ca8dedb943669bfbcae46ffd4a98bcbe317fa3e2b7db4ad9ca2dcd8
5
5
  SHA512:
6
- metadata.gz: e23da17547129d300c21c3c4850994ff34f936feb65cfb06d102cca35051ed679d22c535f4e7d0edb9019687b7816c9e755b64f4cef871c063aa00a7d2fa615a
7
- data.tar.gz: db90290bfcfa853afc27f4993ab87cf0bafe81b2ad094888b1dafb83664cb3837847f6e814211b22676ede0f4ed3f24debfe3ba56490d8efdb4b7450c3ba9ac5
6
+ metadata.gz: e5b067114de507eca9cce70bfc5e0b04ba9913ec0f864d0e50224d9a2ff55ba4b0a77d6d58e0849901584ef462e62882df37206c6d70c3ca4e9bad036afd3a6f
7
+ data.tar.gz: d69cb0b9c0aa641af51cf5c13eb6aa335fa7580e312bfb275286978b32bbed3864a6884d0f88c3bad2e0b773cbaeec80a25ce7d9051ab260544676da69fa3031
@@ -36,12 +36,13 @@ module VagrantPlugins
36
36
  end
37
37
  end
38
38
 
39
- return ips
39
+
40
40
  end
41
+ return ips
41
42
  end
42
43
 
43
44
  # https://stackoverflow.com/a/13586108/1902215
44
- def get_OS
45
+ def get_os_binary
45
46
  return os ||= (host_os = RbConfig::CONFIG["host_os"]
46
47
  case host_os
47
48
  when /mswin|msys|mingw|cygwin|bccwin|wince|emc/
@@ -56,9 +57,9 @@ module VagrantPlugins
56
57
  end
57
58
 
58
59
  def get_cli
59
- cli = get_OS
60
+ binary = get_os_binary
60
61
  path = File.expand_path(File.dirname(File.dirname(__FILE__))) + "/vagrant-goodhosts/bundle/"
61
- path = "#{path}#{cli}"
62
+ path = "#{path}#{binary}"
62
63
 
63
64
  return path
64
65
  end
@@ -99,9 +100,9 @@ module VagrantPlugins
99
100
  hostnames_by_ips = generateHostnamesByIps
100
101
  hostnames_by_ips.each do |hostnames, ip_address|
101
102
  if cli.include? ".exe"
102
- stdin, stdout, stderr, wait_thr = Open3.popen3(cli, "a", ip_address, hostnames)
103
+ stdin, stdout, stderr, wait_thr = Open3.popen3(cli, "add", ip_address, hostnames)
103
104
  else
104
- stdin, stdout, stderr, wait_thr = Open3.popen3("sudo", cli, "a", ip_address, hostnames)
105
+ stdin, stdout, stderr, wait_thr = Open3.popen3("sudo", cli, "add", ip_address, hostnames)
105
106
  end
106
107
  if !wait_thr.value.success?
107
108
  error = true
@@ -117,10 +118,14 @@ module VagrantPlugins
117
118
  cli = get_cli
118
119
  hostnames_by_ips = generateHostnamesByIps
119
120
  hostnames_by_ips.each do |hostnames, ip_address|
121
+ if !ip_address.nil?
122
+ @ui.error "[vagrant-goodhosts] Error adding some hosts, no IP was provided for the following hostnames: #{hostnames}"
123
+ next
124
+ end
120
125
  if cli.include? ".exe"
121
- stdin, stdout, stderr, wait_thr = Open3.popen3(cli, "r", ip_address, hostnames)
126
+ stdin, stdout, stderr, wait_thr = Open3.popen3(cli, "remove", ip_address, hostnames)
122
127
  else
123
- stdin, stdout, stderr, wait_thr = Open3.popen3("sudo", cli, "r", ip_address, hostnames)
128
+ stdin, stdout, stderr, wait_thr = Open3.popen3("sudo", cli, "remove", ip_address, hostnames)
124
129
  end
125
130
  if !wait_thr.value.success?
126
131
  error = true
@@ -153,7 +158,7 @@ module VagrantPlugins
153
158
  ip_address = ip
154
159
  hostnames[ip].each do |hostname|
155
160
  if !ip_address.nil?
156
- @ui.info "[vagrant-goodhosts] - remove entry for: #{ip_address} #{hostname}"
161
+ @ui.info "[vagrant-goodhosts] - removing entry for: #{ip_address} #{hostname}"
157
162
  end
158
163
  end
159
164
  hostnames_by_ips = { ip_address => hostnames[ip].join(" ") }
@@ -162,7 +167,7 @@ module VagrantPlugins
162
167
  ip_address = ips[0]
163
168
  hostnames[ip_address].each do |hostname|
164
169
  if !ip_address.nil?
165
- @ui.info "[vagrant-goodhosts] - remove entry for: #{ip_address} #{hostname}"
170
+ @ui.info "[vagrant-goodhosts] - removing entry for: #{ip_address} #{hostname}"
166
171
  end
167
172
  end
168
173
  hostnames_by_ips = { ip_address => hostnames[ip_address].join(" ") }
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module GoodHosts
3
- VERSION = '1.0.2'
3
+ VERSION = '1.0.3'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-goodhosts
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniele Scasciafratte
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-29 00:00:00.000000000 Z
11
+ date: 2020-08-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler