summaryrefslogtreecommitdiff
path: root/lib/ohai/plugins/filesystem.rb
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2018-11-24 13:56:48 -0800
committerTim Smith <tsmith@chef.io>2018-11-24 13:56:48 -0800
commit35f32a12f756c50a9cfd17ab9224853c2161fc0e (patch)
tree4e5cfe43b8cf6cf8476c6682b43383522c41a7b7 /lib/ohai/plugins/filesystem.rb
parenta946ff969ae335b163a1766901ccd960ad6dc4eb (diff)
downloadohai-35f32a12f756c50a9cfd17ab9224853c2161fc0e.tar.gz
Require Ruby 2.5 or later
As we do every year Ohai 15 will drop support for the N-2 support of Ruby. In the ~5 weeks Ruby 2.6 comes out so by the time we release this new version of Ohai N-2 will be Ruby 2.4. Also while we're at it get rid of the begins in rescue blocks. Ruby 2.5 doesn't require this and it's on the path to ruby throwing errors eventually. It's a Ruby < 2.4-ism. Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'lib/ohai/plugins/filesystem.rb')
-rw-r--r--lib/ohai/plugins/filesystem.rb20
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/ohai/plugins/filesystem.rb b/lib/ohai/plugins/filesystem.rb
index 1a823f8b..76ab8ed9 100644
--- a/lib/ohai/plugins/filesystem.rb
+++ b/lib/ohai/plugins/filesystem.rb
@@ -250,16 +250,16 @@ Ohai.plugin(:Filesystem) do
# we have to non-block read dev files. Ew.
f = File.open("/proc/mounts")
loop do
- begin
- data = f.read_nonblock(4096)
- mounts << data
- # We should just catch EOFError, but the kernel had a period of
- # bugginess with reading virtual files, so we're being extra
- # cautious here, catching all exceptions, and then we'll read
- # whatever data we might have
- rescue Exception
- break
- end
+
+ data = f.read_nonblock(4096)
+ mounts << data
+ # We should just catch EOFError, but the kernel had a period of
+ # bugginess with reading virtual files, so we're being extra
+ # cautious here, catching all exceptions, and then we'll read
+ # whatever data we might have
+ rescue Exception
+ break
+
end
f.close
mounts.each_line do |line|