char *uri;
uri = lib->settings->get_str(lib->settings,
- "libhydra.plugins.attr-sql.database", NULL);
+ "%s.plugins.attr-sql.database", NULL, lib->ns);
if (!uri)
{
DBG1(DBG_CFG, "attr-sql plugin: database URI not set");
},
},
);
+ lib->settings->add_fallback(lib->settings, "%s.plugins.attr-sql",
+ "libhydra.plugins.attr-sql", lib->ns);
return &this->public.plugin;
}
},
.db = db,
.history = lib->settings->get_bool(lib->settings,
- "libhydra.plugins.attr-sql.lease_history", TRUE),
+ "%s.plugins.attr-sql.lease_history", TRUE, lib->ns),
);
/* close any "online" leases in the case we crashed */
{
exit(SS_RC_INITIALIZATION_FAILED);
}
-
- uri = lib->settings->get_str(lib->settings, "libhydra.plugins.attr-sql.database", NULL);
+ /* TODO: make database URI or setting key configurable via command line */
+ uri = lib->settings->get_str(lib->settings,
+ "pool.database",
+ lib->settings->get_str(lib->settings,
+ "charon.plugins.attr-sql.database",
+ lib->settings->get_str(lib->settings,
+ "libhydra.plugins.attr-sql.database", NULL)));
if (!uri)
{
- fprintf(stderr, "database URI libhydra.plugins.attr-sql.database not set.\n");
+ fprintf(stderr, "database URI pool.database not set.\n");
exit(SS_RC_INITIALIZATION_FAILED);
}
db = lib->db->create(lib->db, uri);