111: def self.teardown
112: unless Puppet.features.rails?
113: raise Puppet::DevError, "No activerecord, cannot init Puppet::Rails"
114: end
115:
116: Puppet.settings.use(:puppetmasterd, :rails)
117:
118: begin
119: ActiveRecord::Base.establish_connection(database_arguments())
120: rescue => detail
121: if Puppet[:trace]
122: puts detail.backtrace
123: end
124: raise Puppet::Error, "Could not connect to database: %s" % detail
125: end
126:
127: ActiveRecord::Base.connection.tables.each do |t|
128: ActiveRecord::Base.connection.drop_table t
129: end
130: end