Пример #1
0
    def configure(self, configfile, service):
        cfg = loadConfigurationFile(configfile)
        wconfig = cfg.section_("Webtools")
        app = wconfig.application
        appconfig = cfg.section_(app)
        dbsconfig = getattr(appconfig.views.active, service)
	databasecore = cfg.CoreDatabase
	
	# Eitehr we change formatter 
	# OR change the 'Accept' type to application/json (which we don't know how to do at thi moment)	
	dbsconfig.formatter.object="WMCore.WebTools.RESTFormatter"
        config = Configuration()

	config.section_("CoreDatabase")
	config.CoreDatabase = databasecore
	
        config.component_('DBS')
        config.DBS.application = app
	config.DBS.model       = dbsconfig.model
	config.DBS.formatter   = dbsconfig.formatter
        config.DBS.version     = dbsconfig.version
	config.DBS.default_expires = 300
	# DBS uses owner name, directly from app section at the moment (does not pick it from CoreDatabse)
	config.DBS.dbowner     = databasecore.dbowner
	# Add the CoreDatabase section to DBS
	config.DBS.database = config.CoreDatabase
	
	
        return config