vagrant-logs 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/vagrant-logs/command.rb +40 -22
- data/lib/vagrant-logs/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e6b5f43f532a04d7c2d656437af8e9890708c6d0
|
4
|
+
data.tar.gz: 7d174e0841e7ecb93e9aa53386d147dbb0037590
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f94b8bb366f429d909de71279293d45513197e013a9fbfab3e8f6eb5ae147ad5edd76b47cc045485db7f80bff97a4c2f1818c35a8ef357b9085ee981db585f27
|
7
|
+
data.tar.gz: 196c55703e0a200cc354fd903b8b365e2fb04f0c9bda67cfb2279bf699963b51c2afba19559fce25b66abe5df3559bf03c267c0b58d87fab6549eef972b34201
|
data/lib/vagrant-logs/command.rb
CHANGED
@@ -45,20 +45,24 @@ module VagrantPlugins
|
|
45
45
|
|
46
46
|
log_files.delete_if do |log_file|
|
47
47
|
if log_file.include?('*')
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
48
|
+
begin
|
49
|
+
vm.communicate.sudo("ls -1 #{log_file}") do |type, data|
|
50
|
+
case type
|
51
|
+
when :stdout
|
52
|
+
expanded_file_names << data.split(/[\r\n]+/)
|
53
|
+
when :stderr
|
54
|
+
puts data and exit 1
|
55
|
+
end
|
54
56
|
end
|
57
|
+
rescue Vagrant::Errors::VagrantError => e
|
58
|
+
print_sudo_exception(e)
|
55
59
|
end
|
56
60
|
|
57
61
|
true
|
58
62
|
end
|
59
63
|
end
|
60
64
|
|
61
|
-
puts "
|
65
|
+
puts "Done\n"
|
62
66
|
|
63
67
|
(log_files + expanded_file_names).flatten
|
64
68
|
end
|
@@ -68,17 +72,21 @@ module VagrantPlugins
|
|
68
72
|
result = {}
|
69
73
|
|
70
74
|
vm.config.vagrant_logs.log_files.each do |log_file|
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
75
|
+
begin
|
76
|
+
vm.communicate.sudo("tail -#{vm.config.vagrant_logs.lines} #{log_file}") do |type, data|
|
77
|
+
case type
|
78
|
+
when :stdout
|
79
|
+
result[log_file] = data.split(/[\r\n]+/)
|
80
|
+
when :stderr
|
81
|
+
puts data and exit 1
|
82
|
+
end
|
77
83
|
end
|
84
|
+
rescue Vagrant::Errors::VagrantError => e
|
85
|
+
print_sudo_exception(e)
|
78
86
|
end
|
79
87
|
end
|
80
88
|
|
81
|
-
puts "
|
89
|
+
puts "Done\n"
|
82
90
|
|
83
91
|
result
|
84
92
|
end
|
@@ -157,16 +165,21 @@ module VagrantPlugins
|
|
157
165
|
|
158
166
|
result = ''
|
159
167
|
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
168
|
+
begin
|
169
|
+
vm.communicate.sudo("host -t ns google.com") do |type, data|
|
170
|
+
case type
|
171
|
+
when :stdout
|
172
|
+
result = data
|
173
|
+
when :stderr
|
174
|
+
puts data and exit 1
|
175
|
+
end
|
166
176
|
end
|
167
|
-
end
|
168
177
|
|
169
|
-
|
178
|
+
puts "Ok\n"
|
179
|
+
rescue Vagrant::Errors::VagrantError => e
|
180
|
+
print("Failed\n")
|
181
|
+
print_sudo_exception(e)
|
182
|
+
end
|
170
183
|
|
171
184
|
!result.include?('no servers could be reached')
|
172
185
|
end
|
@@ -211,6 +224,11 @@ module VagrantPlugins
|
|
211
224
|
|
212
225
|
puts "\n"
|
213
226
|
end
|
227
|
+
|
228
|
+
def print_sudo_exception(exception)
|
229
|
+
puts "Following error occured, but will be ignored:\n"
|
230
|
+
puts exception.message
|
231
|
+
end
|
214
232
|
end
|
215
233
|
end
|
216
234
|
end
|
data/lib/vagrant-logs/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-logs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- seppsepp
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-02-
|
12
|
+
date: 2016-02-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: gist
|