vagrant-goodhosts 1.0.11 → 1.0.12
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 +4 -4
- data/README.md +3 -3
- data/lib/vagrant-goodhosts/GoodHosts.rb +13 -10
- data/lib/vagrant-goodhosts/config.rb +1 -1
- data/lib/vagrant-goodhosts/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e0a9a9277945173d86017e1adc047ab0f77c2cc1779720feacab37f2095eeaab
|
4
|
+
data.tar.gz: 20814631c5aea07c8eb72a7ea7458ef0e6617ce5358585587a62883c30cee311
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ff28f24b53144938296b34731d73f0569724b4d2bd877ef5e1d148a4a485de2c2aefe34abaecdd60ba9a3a6d3c24296d3a21ddebe42864e32dfa459083ec19b
|
7
|
+
data.tar.gz: 11c2e604dace4cc0cb75a829f0162d0a3a9941f14ba9103fc79333ee87d4eab107c659c463ff4fe3fa19395549a6089e56fda12256da95a9abd6e627e5ba8712
|
data/README.md
CHANGED
@@ -80,13 +80,13 @@ This disables `vagrant-goodhosts` from running on **suspend** and **halt**.
|
|
80
80
|
|
81
81
|
### Disable file hosts clean
|
82
82
|
|
83
|
-
If you
|
83
|
+
If you want `/etc/hosts` file cleaned add in your `VagrantFile`:
|
84
84
|
|
85
85
|
```ruby
|
86
|
-
config.goodhosts.disable_clean =
|
86
|
+
config.goodhosts.disable_clean = false
|
87
87
|
```
|
88
88
|
|
89
|
-
This
|
89
|
+
This enable `vagrant-goodhosts` from running the clean command in every call.
|
90
90
|
|
91
91
|
## Suppressing prompts for elevating privileges
|
92
92
|
|
@@ -80,7 +80,7 @@ module VagrantPlugins
|
|
80
80
|
return hostnames
|
81
81
|
end
|
82
82
|
|
83
|
-
def
|
83
|
+
def disableClean(ip_address)
|
84
84
|
unless ip_address.nil?
|
85
85
|
return @machine.config.goodhosts.disable_clean
|
86
86
|
end
|
@@ -100,15 +100,16 @@ module VagrantPlugins
|
|
100
100
|
@ui.error "[vagrant-goodhosts] Error adding some hosts, no IP was provided for the following hostnames: #{hostnames}"
|
101
101
|
next
|
102
102
|
end
|
103
|
-
clean = ''
|
104
103
|
if cli.include? ".exe"
|
105
|
-
|
106
|
-
|
104
|
+
clean = "\"--clean\","
|
105
|
+
if disableClean(ip_address)
|
106
|
+
clean = ''
|
107
107
|
end
|
108
108
|
stdin, stdout, stderr, wait_thr = Open3.popen3("powershell", "-Command", "Start-Process '#{cli}' -ArgumentList \"add\",#{clean}\"#{ip_address}\",\"#{hostnames}\" -Verb RunAs")
|
109
109
|
else
|
110
|
-
|
111
|
-
|
110
|
+
clean = "--clean"
|
111
|
+
if disableClean(ip_address)
|
112
|
+
clean = ''
|
112
113
|
end
|
113
114
|
stdin, stdout, stderr, wait_thr = Open3.popen3("sudo #{cli} add #{clean} #{ip_address} #{hostnames}")
|
114
115
|
end
|
@@ -134,13 +135,15 @@ module VagrantPlugins
|
|
134
135
|
next
|
135
136
|
end
|
136
137
|
if cli.include? ".exe"
|
137
|
-
|
138
|
-
|
138
|
+
clean = "\"--clean\","
|
139
|
+
if disableClean(ip_address)
|
140
|
+
clean = ''
|
139
141
|
end
|
140
142
|
stdin, stdout, stderr, wait_thr = Open3.popen3("powershell", "-Command", "Start-Process '#{cli}' -ArgumentList \"remove\",#{clean}\"#{ip_address}\",\"#{hostnames}\" -Verb RunAs")
|
141
143
|
else
|
142
|
-
|
143
|
-
|
144
|
+
clean = "\"--clean\","
|
145
|
+
if disableClean(ip_address)
|
146
|
+
clean = ''
|
144
147
|
end
|
145
148
|
stdin, stdout, stderr, wait_thr = Open3.popen3("sudo #{cli} remove #{clean} #{ip_address} #{hostnames}")
|
146
149
|
end
|