18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
# File 'lib/orabase/utils/title_parser.rb', line 18
def parse_database_name
lambda do |name|
begin
groups = name.scan(/^((@?.*?)?(\@.*?)?)$/).flatten
sid = parse_database_sid.call(groups.last)
object_name = groups[1]
if self.name != :ora_exec && object_name.include?('/')
Puppet.deprecation_warning("Using 'sid/name' in title is deprecated. Use 'name@sid'.")
sid, object_name = object_name.scan(/^(.*)\/(.*)$/).flatten.flatten
end
"#{object_name}@#{sid}"
rescue
fail ArgumentError, 'a failure in parsing the database object title. Check the documentation for the correct syntax of the title'
end
end
end
|