Permalink
Browse files

darn you Ruby, repackaging my exceptions...

Ruby's Tempfile class repackages file I/O exceptions to RuntimeErrors.
This was causing ConcertoClient::LiveImage.readonly? to fail when the
filesystem was actually readonly. Now, any exception is taken to mean
that the filesystem is readonly.
  • Loading branch information...
asquared committed Jun 13, 2012
1 parent 729d3ea commit 23957456254dde8f36af09965403aa962dbe68d3
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/concerto_client/live_image.rb
@@ -15,7 +15,8 @@ def self.readonly?
f = Tempfile.new('test', self.mountpoint)
f.close!
false
- rescue Errno::EROFS
+ rescue
+ # if the tempfile creation bombs we assume readonly
true
end
end

0 comments on commit 2395745

Please sign in to comment.