X-Git-Url: https://git.tokkee.org/?p=sysdb.git;a=blobdiff_plain;f=src%2Fbackend%2Fpuppet%2Fstore-configs.c;h=23d261bacf46baf7b3939f5718fe529c714f98d7;hp=0f95ae51e00f22cbca9d11057eaf489b2282e9da;hb=e48ff35c0684d772d4ba8bdc9f75dafcc0df6a36;hpb=a0c8961e4732d71aaed1f4cda663203ff722b23e diff --git a/src/backend/puppet/store-configs.c b/src/backend/puppet/store-configs.c index 0f95ae5..23d261b 100644 --- a/src/backend/puppet/store-configs.c +++ b/src/backend/puppet/store-configs.c @@ -33,8 +33,6 @@ #include "liboconfig/utils.h" -#include - #include #include @@ -196,7 +194,6 @@ static int sdb_puppet_stcfg_config_conn(oconfig_item_t *ci) { char *name = NULL; - char cb_name[1024]; sdb_object_t *user_data; sdb_dbi_client_t *client; @@ -317,9 +314,6 @@ sdb_puppet_stcfg_config_conn(oconfig_item_t *ci) return -1; } - snprintf(cb_name, sizeof(cb_name), "puppet::storeconfigs::%s", name); - cb_name[sizeof(cb_name) - 1] = '\0'; - client = sdb_dbi_client_create(driver, database); if (! client) { char errbuf[1024]; @@ -340,10 +334,10 @@ sdb_puppet_stcfg_config_conn(oconfig_item_t *ci) return -1; } - sdb_plugin_register_init(cb_name, sdb_puppet_stcfg_init, user_data); - sdb_plugin_register_shutdown(cb_name, sdb_puppet_stcfg_shutdown, + sdb_plugin_register_init(name, sdb_puppet_stcfg_init, user_data); + sdb_plugin_register_shutdown(name, sdb_puppet_stcfg_shutdown, user_data); - sdb_plugin_register_collector(cb_name, sdb_puppet_stcfg_collect, + sdb_plugin_register_collector(name, sdb_puppet_stcfg_collect, /* interval */ NULL, user_data); /* pass control to the list */ @@ -383,16 +377,7 @@ sdb_module_init(sdb_plugin_info_t *info) sdb_plugin_set_info(info, SDB_PLUGIN_INFO_VERSION, SDB_VERSION); sdb_plugin_set_info(info, SDB_PLUGIN_INFO_PLUGIN_VERSION, SDB_VERSION); - /* don't reinitialize dbi when reinitializing the plugin */ - if (info && (dbi_initialize(/* driver dir = */ NULL) < 0)) { - sdb_log(SDB_LOG_ERR, "puppet::store-configs backend: failed to " - "initialize DBI; possibly you don't have any drivers " - "installed."); - return -1; - } - - sdb_plugin_register_config("puppet::store-configs", - sdb_puppet_stcfg_config); + sdb_plugin_register_config(sdb_puppet_stcfg_config); return 0; } /* sdb_version_extra */