Displaying 1 result from an estimated 1 matches for "bcrelease".
Did you mean:
atrelease
2007 May 11
3
Exception handling in custom facts
Hi.
I''d like to use exception handling in my custom facts. For example, in
plain Ruby:
begin
buildno = ''''
bcrelease = open("/etc/BCrelease")
while (line = bcrelease.gets)
line = line.chomp
buildno = $1 if line =~ /^Build:\s+(\d+)/
end
bcrelease.close
print "#{buildno}\n"
rescue
print "No file?\n"
end
Works fine. However, in a custom fact the res...