diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2014-07-31 14:25:13 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2014-07-31 14:25:13 -0700 |
commit | d5a01bf1e6d97e1cdd40dbd0567c6d5c024f3a5c (patch) | |
tree | 7df6ccea97d34dfad0addd615feffd38a242b0db | |
parent | dfbf815aafc9452a42567fc65ed3a433ca054364 (diff) | |
download | ohai-d5a01bf1e6d97e1cdd40dbd0567c6d5c024f3a5c.tar.gz |
Revert "Fix linux::filesystem reading of /proc/mounts"
This reverts commit 144ec4c1e5ee4e881d944456b870cae723ea9b0f.
See OHAI-196
-rw-r--r-- | lib/ohai/plugins/linux/filesystem.rb | 2 | ||||
-rw-r--r-- | spec/unit/plugins/linux/filesystem_spec.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/ohai/plugins/linux/filesystem.rb b/lib/ohai/plugins/linux/filesystem.rb index 7a16b191..572f2205 100644 --- a/lib/ohai/plugins/linux/filesystem.rb +++ b/lib/ohai/plugins/linux/filesystem.rb @@ -90,7 +90,7 @@ end # Grab any missing mount information from /proc/mounts if File.exists?('/proc/mounts') - File.open('/proc/mounts').read.each_line do |line| + File.open('/proc/mounts').read_nonblock(4096).each_line do |line| if line =~ /^(\S+) (\S+) (\S+) (\S+) \S+ \S+$/ filesystem = $1 next if fs.has_key?(filesystem) diff --git a/spec/unit/plugins/linux/filesystem_spec.rb b/spec/unit/plugins/linux/filesystem_spec.rb index b73c6c66..49cc6989 100644 --- a/spec/unit/plugins/linux/filesystem_spec.rb +++ b/spec/unit/plugins/linux/filesystem_spec.rb @@ -264,7 +264,7 @@ describe Ohai::System, "Linux filesystem plugin" do before(:each) do File.stub!(:exists?).with("/proc/mounts").and_return(true) @mock_file = mock("/proc/mounts") - @mock_file.stub!(:read).and_return(@mock_file) + @mock_file.stub!(:read_nonblock).and_return(@mock_file) @mock_file.stub!(:each_line). and_yield("rootfs / rootfs rw 0 0"). and_yield("none /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0"). |