Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Facter.add("oraclesids") do
- sids = []
- filepath="/etc/oratab"
- sid = nil
- setcode do
- if FileTest.file?(filepath)
- begin
- IO.readlines(filepath).each { |line|
- next if line.include? "#"
- next if line.include? "*"
- line = line.lstrip
- sid = line.split(':')
- if ! sid.empty?
- sids << sid[0]
- end
- }
- rescue
- sids = nil
- end
- end
- sids.join(',')
- end # end of proc
- end # end of add
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement